Home > Software engineering >  Opencv220 vc2010 for camera video program there is no error to open the camera?
Opencv220 vc2010 for camera video program there is no error to open the camera?

Time:10-02



[for] opencv220 + vc2010 for camera video program there is no error to open the camera?
#include
#include

#include

CvCapture * capture;
Void captureCAM ()
{

IplImage * frame;
While (1)
{
Frame=cvQueryFrame (capture);
if (! Frame)
{
break;
}
If (char c=cvWaitKey (100)==27)
{
break;
}
CvShowImage (" Demo ", frame);
}
}
Int main ()
{
The capture=cvCaptureFromCAM (0);
if (! The capture)
{
Printf (" could not initialize capturing... \ n ";
The return - 1;
}
CvNamedWindow (" Demo ", 1);
CaptureCAM ();
CvReleaseCapture (& amp; The capture);
CvDestroyWindow (" Demo ".
return 0;
}

CodePudding user response:

In a computer look at first
  • Related