Skip to content

Instantly share code, notes, and snippets.

@0V
Created June 11, 2014 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0V/a99a9840d7531067b0dc to your computer and use it in GitHub Desktop.
Save 0V/a99a9840d7531067b0dc to your computer and use it in GitHub Desktop.
using OpenCvSharp;
namespace OpenCvTest
{
class Program
{
static void Main(string[] args)
{
//初期設定
var capture = Cv.CreateCameraCapture(0);
Cv.SetCaptureProperty(capture, CaptureProperty.FrameWidth, 640.0);
Cv.SetCaptureProperty(capture, CaptureProperty.FrameHeight, 480.0);
var frame = Cv.QueryFrame(capture);
Cv.NamedWindow("Capture", WindowMode.AutoSize);
//50フレーム分表示
for (int i = 0; i <= 50; i++)
{
frame = Cv.QueryFrame(capture);
Cv.ShowImage("Capture", frame);
//間に入れないと処理が追いつかない
Cv.WaitKey(10);
}
Cv.DestroyWindow("Capture");
Cv.ReleaseImage(frame);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment