Increasing camera capture resolution in OpenCV

I’m using openCV 1.1pre1 under Windows (videoinput library is used by default by this version of openCv under windows).

With these instructions I can set camera resolution. Note that I call the old cvCreateCameraCapture instead of cvCaptureFromCam.

capture = cvCreateCameraCapture(cameraIndex);

cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH, 640 );

cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT, 480 );


videoFrame = cvQueryFrame(capture);

I’ve tested it with Logitech, Trust and Philips webcams

Leave a Comment