Ask Your Question

Change focus of a V4l2 Cam

asked 2012-12-13 04:20:13 -0600

Geppertm gravatar image

Hi there, i´m using Ubuntu 12.10 with all dependencies and libv4l2.I want to change the focus of a V4l2 Cam. I´m trieing it with the following code:

VideoCapture cam;
cam.set(CV_CAP_PROP_FOCUS ,d);

Capture frames works.

If I use Windows 7 the code works fine.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2013-11-06 09:39:30 -0600

Geppertm gravatar image

I´ve found out that this feature isn´t implemented for Linux. I´ve implemented the features. I´m going to commit this features as soon as possible.

edit flag offensive delete link more


I am working on the ubuntu 12.04lts and need the focus control I was about to start this but if you have the change please post the difference here.

mpatalberta gravatar imagempatalberta ( 2013-12-12 18:48:49 -0600 )edit

Hi, I´ve made a 7z File with the changes, you can find it here:

the main changes are in cap_libv4l.cpp.

Geppertm gravatar imageGeppertm ( 2013-12-13 03:22:29 -0600 )edit

I recommend you to contribute your improvements to OpenCV. See instruction here:

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-12-14 01:20:45 -0600 )edit

Is anyone still on this? Seems like there are more missing capabilties for v4l2. Also the link of Geppertm doesn't work anymore.

vliedel gravatar imagevliedel ( 2014-03-06 05:35:50 -0600 )edit

answered 2013-12-13 12:48:10 -0600

mpatalberta gravatar image

Thanks I will try them out.

edit flag offensive delete link more

Question Tools


Asked: 2012-12-13 04:20:13 -0600

Seen: 2,335 times

Last updated: Dec 13 '13