Created
June 11, 2014 13:13
-
-
Save 0V/a99a9840d7531067b0dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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