CvCapture* capture = cvCreateCameraCapture(0); is not working for me... c++ w10
but VideoCapture cap(0); is working for me..it opens the camera.. please anyone give solution..
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <stdarg.h>
using namespace cv;
using namespace std;
int main( int argc, char** argv ) {
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCaptureFromCAM(0);
IplImage* frame;
while(1) {
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Example2", frame );
char c = cvWaitKey(33);
if( c == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
}
above shows the code...but when cv: :videocapture used cvQueryFrame gets error as there are no pointer in use...how to solve this..?
please try to use
cv::VideoCapture
, not the (deprecated c-api version)