Is VideoCapture.set implemented (yet) in OpenCV 3? [closed]

asked 2014-10-15 10:43:35 -0600

Doombot gravatar image

updated 2014-10-15 10:44:27 -0600

I am trying to do the following (I used an sample code that work and added two lines):

//Some code before
VideoCapture cap(1); // open the default camera
if(!cap.isOpened())  // check if we succeeded
    return -1;

cap.set(CV_CAP_PROP_FRAME_WIDTH, 1920); //added
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1080); //added
//Some code after

So I am trying to set the size of the frame to something else than the basic 640x480, but CV_CAP_PROP_FRAME_xxxxxx is "undefined". I built opencv 3 form Itseez Github on Sept9-2014. This post suggest the feature is not implemented yet but I don't know if it is the case.

If so, is it possible to use the previous way and use

CvCapture* cvCaptureFromCAM(int device)

and

cvSetCaptureProperty

I need the resolution for my detection application. Using Windows 8.1, Visual Studio 2012 and a Logitech HD Pro c920

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2014-10-16 03:48:57.612839

Comments

1

cv::CAP_PROP_FRAME_WIDTH, not CV_CAP_PROP_FRAME_WIDTH in 3.0 !!

berak gravatar imageberak ( 2014-10-15 11:16:35 -0600 )edit
1

Wow thanks a lot it definitely works! :)

Doombot gravatar imageDoombot ( 2014-10-15 12:38:00 -0600 )edit