Skip to content

Instantly share code, notes, and snippets.

@ts-3156
Created June 30, 2011 15:47
Show Gist options
  • Save ts-3156/1056509 to your computer and use it in GitHub Desktop.
Save ts-3156/1056509 to your computer and use it in GitHub Desktop.
void Filter::cameraTest()
{
CvCapture* src;
IplImage* frame;
cvNamedWindow("camera");
src = cvCaptureFromCAM(0);
if(src == NULL){
printf("カメラが見つからない");
cvWaitKey(0);
return;
}
while(1){
frame = cvQueryFrame(src);
cvShowImage("camera", frame);
if(cvWaitKey(33) == 27)
break;
}
cvDestroyAllWindows();
cvReleaseCapture(&src);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment