Ask Your Question
0

opencv VideoCapture property

asked 2016-12-28 06:26:43 -0600

Akhilesh gravatar image

Hi, Is there any API in opencv ( or any programmatic way ) to get the range of a particular property of VideoCapture class like exposure or brightness.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-28 06:39:07 -0600

pi-null-mezon gravatar image

The answer is NO, if you have asked about one universal way for the all kind of supported platforms and videobackends. BUT if you have saked for MS Windows than you can adjust exposure and brightness by means of this simple call:

cv::VideoCapture _capture;
if(_capture.open(_desiredvideodeviceid)) {
     // Lets's try to open DirectShow video device settings dialog
     _capture.set(CV_CAP_PROP_SETTINGS,0.0);

    // Processing code
}
edit flag offensive delete link more

Comments

Thanks for immediate responding, but actually I am changing the focus value of the camera and not able to get range.

Akhilesh gravatar imageAkhilesh ( 2016-12-28 06:45:34 -0600 )edit
0

answered 2016-12-28 06:33:45 -0600

LBerger gravatar image

updated 2016-12-28 06:34:19 -0600

Most of case this is not possible. For some specfic API you should look for in this list

edit flag offensive delete link more

Comments

Thanks for immediate responding, but actually I am changing the focus value of the camera and not able to get range.

Akhilesh gravatar imageAkhilesh ( 2016-12-28 06:45:31 -0600 )edit

I solved this problem using set method. If value is true I call get to check if value is really set. but read note in get

That's not a direct way but it works

LBerger gravatar imageLBerger ( 2016-12-28 06:50:32 -0600 )edit

set() is always returning true and while getting using videoCapture::get(), it is returning the same value which is been set by set().

Akhilesh gravatar imageAkhilesh ( 2016-12-28 07:04:33 -0600 )edit

Which camera opencv and system do you use?

LBerger gravatar imageLBerger ( 2016-12-28 07:07:54 -0600 )edit

linux 14.04, opencv 3.1.0 and actually, camera is underdevelopment. So if would solve the issue, I will let you know.

Akhilesh gravatar imageAkhilesh ( 2016-12-28 07:19:18 -0600 )edit

"camera is underdevelopment" you will have to write code...If you want to share your code make a pull request

About autofocus you can try this sample

LBerger gravatar imageLBerger ( 2016-12-28 07:26:44 -0600 )edit

Ok. Thank you

Akhilesh gravatar imageAkhilesh ( 2016-12-28 07:57:02 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-28 06:26:43 -0600

Seen: 1,113 times

Last updated: Dec 28 '16