0
$\begingroup$

Rosanswers logo

Hello all,

I'm using a Webcam (Logitech HD 720p Autofocus) with OpenCV and ROS. Is it possible to turn off the autofocus of the webcam? I already tried to change the camera parameters by setting the parameters:

rosparam set /autofocus false

rosparam set /focus 0

roslaunch [...]

But after this the camera is still autofocussing. Is there any other way?

Thanks a lot!


Originally posted by tine-lore on ROS Answers with karma: 3 on 2017-07-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Can you disable the autofocus when running the camera outside of ros in a regular camera viewer? guvcview is a good test for this. Also try running v4l2ucp which can be done while the ros driver is running, it doesn't conflict (I made a ros node version of v4l2ucp https://github.com/lucasw/v4l2ucp and the parameters can be changed live via topics).

Or you run uvcdynctrl (not a ros node) separately on the command line to manipulate controls.

Are you using usb_cam?

Is the launch file setting focus or autofocus itself, overwriting your values?

It's possible the way the camera sets autofocus is not wired properly through V4L, or some startup sequence causes the param value to get overridden, so changing it after the launch is complete is the only way.


Originally posted by lucasw with karma: 8729 on 2017-07-10

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.