Home » Code » Logitech camera and auto focus

Logitech camera and auto focus

The HD Pro WebCam C920 along with all their later model cameras come with auto focus. This can be an issue when scanning. The CEBSCAN source has system commands it calls to deactivate auto focus and set manual focus. Ubuntu does not come with the v4ls libs so it may be necessary to install them. From the terminal window run the code below.

sudo apt-get install v4l-utils

The library v4l2-ctl is valid and available for both Linux and windows machines

The system commands can be run manually outside CEBSCAN source using any scripting language. Command lines are below. inside c++ its the <cstdlib>

system("v4l2-ctl -d /dev/video0 -c focus_auto=0");
system("v4l2-ctl -d /dev/video0 -c focus_absolute=30");
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: