OpenCV: Getting and Setting Camera Settings

Posted by jhaip on Stack Overflow See other posts from Stack Overflow or by jhaip
Published on 2010-06-25T15:10:55Z Indexed on 2010/12/26 4:54 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

I have been searching around and can't find an example of how to get and set the camera capturing settings. For example the capturing resolution, fps, color balance, etc. I have only seen examples of how to change the settings when saving the captured video but I want to be able to find all the camera's capturing modes and choose which one I want. For example, I am using the PS3eye webcam and in the test program it allows you to change the settings (320x240 at 15,30,60,120 fps, 640x480 at 15,30,60,75 fps). So is there a function in OpenCV for getting all the camera's capture modes and choosing one? I remember in OpenFrameworks there was a function to change these settings but I would like to know how to do it in OpenCV.

Here is the code for OpenFrameworks with OpenCV that does sort of what I want:

vidGrabber.setDeviceID( 4 );
vidGrabber.setDesiredFrameRate( 30 ); //I want this
vidGrabber.videoSettings();
vidGrabber.setVerbose(true);
vidGrabber.initGrabber(320,240); //And this

© Stack Overflow or respective owner

Related posts about c++

Related posts about settings