Programmer can extract webcam image throuhg OpenCV easily.
Following is the example code.
[code]
CvCapture *capture;
IplImage *frame;
capture =cvCaptureFromCAM(0) ; //camera init
cvNamedWindow("Webcam",0); //highgui window init
while(TRUE)
{
frame = cvQueryFrame(capture); //extract from CvCapture struct
cvShowImage("Webcam",frame); //show frame
if(cvWaitKey(10)>=0) //wait for key in
{
break;
}
}
cvReleaseCapture(&capture);
cvDestroyWindow("Webcam");
沒有留言:
張貼留言