【问题标题】:Cannot Enable Autoexposure via V4L2无法通过 V4L2 启用自动曝光
【发布时间】:2016-06-17 04:48:15
【问题描述】:

我正在使用 ELP-USBFHD01M-L21 相机。它声称支持自动曝光,当我将它插入我的 Mac 时,它似乎是这样。我在 OS X 上下载了一个示例应用程序,该应用程序使用 USB 视频类命令启用/禁用自动曝光,看起来不错。

在 Debian 8.5 系统上,我使用 Python 访问 v4l2。在这里,我将曝光设置为手动模式。接受此值 (1) 和值 3:

self._camera = v4l2capture.Video_device(device)

self._frame_size = self._camera.set_format(*requested_frame_size)

# 0: V4L2_EXPOSURE_AUTO
# 1: V4L2_EXPOSURE_MANUAL
# 2: V4L2_EXPOSURE_SHUTTER_PRIORITY
# 3: V4L2_EXPOSURE_APERTURE_PRIORITY

actual = self._camera.set_exposure_auto(1)

如果我尝试将 exposure_auto 设置为零,则会失败:

Traceback (most recent call last):
  File "camera.py", line 207, in <module>
    camera = Camera('/dev/video0')
  File "camera.py", line 45, in __init__
    a = self._camera.set_exposure_auto(0)
IOError: [Errno 34] Numerical result out of range

实用程序的类似结果:

$ v4l2-ctl -c exposure_auto=0
VIDIOC_S_EXT_CTRLS: failed: Numerical result out of range
Error setting controls: Numerical result out of range
$ v4l2-ctl -c exposure_auto=1

如果我使用lsusb -v 检查描述符,我会看到这个(摘录):

  VideoControl Interface Descriptor:
    bLength                18
    bDescriptorType        36
    bDescriptorSubtype      2 (INPUT_TERMINAL)
    bTerminalID             1
    wTerminalType      0x0201 Camera Sensor
    bAssocTerminal          0
    iTerminal               0 
    wObjectiveFocalLengthMin      0
    wObjectiveFocalLengthMax      0
    wOcularFocalLength            0
    bControlSize                  3
    bmControls           0x0000000e
      Auto-Exposure Mode
      Auto-Exposure Priority
      Exposure Time (Absolute)

【问题讨论】:

  • 这不是设置手动曝光时间,而是设置自动曝光模式,可以是0-3,值在cmet中定义。我想我解决了这个问题。

标签: python v4l2


【解决方案1】:

我有点专注于让camera.set_exposure_auto(0) 工作。事实证明,值 3 是手动光圈调整的自动曝光。这台相机没有光圈(至少不是机械光圈),这似乎激活了一种适合我的自动曝光形式。

值 0 表示自动曝光和自动光圈,回想起来为什么不支持它是有道理的。

一些documentation here。搜索“曝光”。

【讨论】:

  • 链接已失效。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-18
  • 2018-09-07
  • 2020-08-18
  • 1970-01-01
  • 2012-05-06
  • 2016-11-01
  • 2012-11-21
相关资源
最近更新 更多