本文介绍了在Linux中禁用网络摄像头的自动对焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Beagleboard的嵌入式系统中工作.源代码使用Python,但是我从OpenCV导入库以进行图像处理.实际上,我使用的是罗技c910网络摄像头,虽然它是出色的相机,但是具有自动对焦功能.我想知道是否可以从Python或Linux中的任何程序禁用自动对焦吗?

I'm working in embebed system in the beagleboard. The source code is in Python, but I import libraries from OpenCV to do image processing. Actually, I'm using the webcam Logitech c910, it's a excellent camera but it has autofocus. I would like to know if I can disable the autofocus from Python or any program in Linux?

推荐答案

使用shell中的程序v4l2-ctl控制网络摄像头上的硬件设置.要关闭自动对焦,只需执行以下操作:

Use program v4l2-ctl from your shell to control hardware settings on your webcam. To turn off autofocus just do:

v4l2-ctl -c focus_auto=0

您可以通过以下方式列出所有可能的控件:

You can list all possible controls with:

v4l2-ctl -l

这些命令默认为您的第一个Video4Linux设备,即/dev/video0.如果插入了多个摄像头,请使用-d开关选择目标设备.

The commands default to your first Video4Linux device, i.e. /dev/video0. If you got more than one webcam plugged in, use -d switch to select your target device.

安装v4l-utils

安装实用程序的最简单方法是使用软件包管理器,例如在Ubuntu或其他基于Debian的系统上尝试:

Easiest way to install the utility is using your package manager, e.g. on Ubuntu or other Debian-based systems try:

apt-get install v4l-utils

或在Fedora,CentOS和其他基于RPM的发行版上使用:

or on Fedora, CentOS and other RPM-based distros use:

yum install v4l-utils

这篇关于在Linux中禁用网络摄像头的自动对焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 04:33