0

Is it possible to change exposure of a webcam on a frame-to-frame basis, with proper synchronization. My operating system is Ubuntu 14.04. Webcam - Logitech HD Pro 920
I know for sure that it's not possible with OpenCV.
And certainly it would also depend upon the webcam being used.

What I need is a callback mechanism which notifies me when the setting of exposure change has taken effect. And also, to be able to synchronize the exposure change setting command at the correct frame boundaries (just in case this is required to be done by the user).

I assume something like using V4L2 would be my best bet?
Kindly guide me.

Vishal
  • 3,178
  • 2
  • 34
  • 47

1 Answers1

1

You can use v4l2-ctl terminal commands or OpenCV to do this.

In OpenCV you can use this function:

VideoCapture.set(CV_CAP_PROP_EXPOSURE,value);

In a linux terminal you can use:

v4l2-ctl --set-ctrl=exposure_absolute=value --device=/dev/video1

For both ways you can use the get command in a similar way to see the current setting

diip_thomas
  • 1,531
  • 13
  • 25
  • I need a mechanism to receive callbacks when the exposure change has taken effect.. I think you haven't read my question well. – Vishal Aug 01 '14 at 10:09
  • Doing a 'get' delays the operation since that would require a polling. – Vishal Aug 01 '14 at 10:19
  • Sorry, I indeed missed the callback part. I don't think the camera itself "knows" that it has reached the set exposure point. With OpenCV you could measure if the lighting has "stabilized" on a different thread and then make a callback perhaps but it would not be a 100% reliable. – diip_thomas Aug 01 '14 at 10:55