开发者

Getting and Setting Camera Settings

开发者 https://www.devze.com 2023-01-04 23:03 出处:网络
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 h

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


cvSetCaptureProperty()

with these flags:

CV_CAP_PROP_FRAME_WIDTH  - width of frames in the video stream (only for cameras)
CV_CAP_PROP_FRAME_HEIGHT - height of frames in the video stream (only for cameras)
CV_CAP_PROP_FPS          - frame rate (only for cameras)


I built a Directshow camera library which able to acquire the camera resolutions and properties.

https://github.com/kcwongjoe/directshow_camera

The fps is usually depended on your machine, resolution and exposure time. To change the fps, you can modify the exposure time in a fixed resolution.

0

精彩评论

暂无评论...
验证码 换一张
取 消