与 Windows 10 相比,v4l2 手动曝光不起作用 [英] v4l2 manual exposure not working compared to Windows 10

查看:146
本文介绍了与 Windows 10 相比,v4l2 手动曝光不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题很像

如果我执行 v4l2-ctl -d0 -all 这就是我得到的:

<预><代码>pi@raspberrypi:~ $ v4l2-ctl -d0 --all司机资料:驱动程序名称:uvcvideo卡类型 : HD USB CAMERA: HD USB CAMERA巴士信息:usb-0000:01:00.0-1.3驱动程序版本:5.4.79能力:0x84a00001视频截取元数据捕获流媒体扩展像素格式设备功能设备上限:0x04200001视频截取流媒体扩展像素格式媒体驱动信息:驱动程序名称:uvcvideo型号 : HD USB CAMERA: HD USB CAMERA序列号:01.00.00巴士信息:usb-0000:01:00.0-1.3媒体版本:5.4.79硬件版本:0x00000224 (548)驱动程序版本:5.4.79接口信息:编号:0x03000002类型 : V4L 视频实体信息:ID : 0x00000001 (1)名称:高清USB摄像头:高清USB摄像头功能 : V4L2 I/O标志:默认垫 0x01000007 : 0: 接收器链接 0x02000013:来自实体扩展 4"的远程键盘 0x100000a:数据,已启用,不可变优先级:2视频输入 : 0 (Camera 1: ok)格式视频捕获:宽/高:640/480像素格式:'YUYV' (YUYV 4:2:2)字段:无每行字节数:1280图片尺寸:614400色彩空间:sRGB传递函数:默认(映射到 sRGB)YCbCr/HSV 编码:默认(映射到 ITU-R 601)量化:默认(映射到有限范围)标志:裁剪功能视频捕获:边界:左 0,上 0,宽 640,高 480默认值:左 0,上 0,宽度 640,高度 480像素长宽比:1/1选择:crop_default,Left 0,Top 0,宽度 640,高度 480,标志:选择:crop_bounds,Left 0,Top 0,宽度 640,高度 480,标志:流媒体参数视频采集:能力:时间帧每秒帧数:30.000 (30/1)读取缓冲区:0亮度 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=-6对比 0x00980901 (int) : min=0 max=95 step=1 default=1 value=6饱和度 0x00980902 (int) : min=0 max=100 step=1 default=52 value=22色调 0x00980903 (int) : min=-2000 max=2000 step=1 default=0 value=0white_balance_temperature_auto 0x0098090c (bool):默认值=1 值=0gamma 0x00980910 (int) : min=100 max=300 step=1 default=115 value=115power_line_frequency 0x00980918(菜单):min=0 max=2 default=1 value=1white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600锐度 0x0098091b (int) : min=0 max=7 step=1 default=0 value=0背光补偿 0x0098091c (int) : min=36 max=160 step=1 default=54 value=36Exposure_auto 0x009a0901(菜单):min=0 max=3 default=3 value=1Exposure_absolute 0x009a0902 (int) : min=5 max=2500 step=1 default=156 value=1659错误 22 获取 ext_ctrl 平移(绝对)错误 22 获取 ext_ctrl 倾斜(绝对)focus_absolute 0x009a090a (int) : min=0 max=1023 step=1 default=0 value=355focus_auto 0x009a090c(布尔值):默认值=1 值=0错误 22 获取 ext_ctrl 缩放,绝对

我尝试在 MJPEGYUYV 之间更改格式而没有任何更改.

我假设这是驱动程序问题或我忽略的某些设置?

解决方案

Amcap (Windows) 在我的情况下有 5 个离散的曝光级别 [-6,-5,-4,-3,-2].

Linux(guvcviewv4l2)具有从 [5 到 2500] 的连续范围(如使用 <代码>v4l2-ctl.

我在 Amcap 中手动设置了曝光级别,然后使用 Linux (guvcview) 读取它们:
[-6 = 156;-5 = 312;-4 = 625;-3 = 1250;-2 = 2500]

当我将 exposure 设置为这些级别中的任何一个时,它会按预期工作.然而如果我设置了任何其他值,例如 2499 或 157,只要少一位数,我就会得到几乎全黑!

我确信有一些数学原因可以证明这一点,但是,我发现这具有误导性,因为 Linux 驱动程序报告了一个连续范围,这表明曝光范围是线性的,但它不是而且是离散的!

>

This question is very similar to V4L2 absolute exposure setting has (almost) not effect

I have a UVC compliant camera that I am running on a Raspberry Pi CM3+ module. It appears as video0.
Using the tools/drivers v4l2-ctl, qv4l2 or guvcview the absolute exposure cannot be controlled, yet it can be controlled when using Amcap on Windows 10.

The camera has two exposure modes manual and aperature controlled. When in aperature controlled the exposure levels in the image change dynamically, however, when switched to manual mode the image becomes very dark and does not change whether at the upper or lower limit of the range which can be selected.

When running v4l2-ctl the range min is stated to be 5 and the max is 2500. Yet in windows it is between -2 and -11 and the exposure of the image changes proportionally as you would expect.

Parameter range from v4l2:

exposure_auto 0x009a0901 (menu)       : min=0 max=3 default=3 value=1
exposure_absolute 0x009a0902 (int)    : min=5 max=2500 step=1 default=156 value=1659

Parameter range from Amcap on Windows 10:

If I do v4l2-ctl -d0 -all here is what I get:


pi@raspberrypi:~ $ v4l2-ctl -d0 --all
Driver Info:
        Driver name      : uvcvideo
        Card type        : HD USB CAMERA: HD USB CAMERA
        Bus info         : usb-0000:01:00.0-1.3
        Driver version   : 5.4.79
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : HD USB CAMERA: HD USB CAMERA
        Serial           : 01.00.00
        Bus info         : usb-0000:01:00.0-1.3
        Media version    : 5.4.79
        Hardware revision: 0x00000224 (548)
        Driver version   : 5.4.79
Interface Info:
        ID               : 0x03000002
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : HD USB CAMERA: HD USB CAMERA
        Function         : V4L2 I/O
        Flags         : default
        Pad 0x01000007   : 0: Sink
          Link 0x02000013: from remote pad 0x100000a of entity 'Extension 4': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'YUYV' (YUYV 4:2:2)
        Field             : None
        Bytes per Line    : 1280
        Size Image        : 614400
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 640, Height 480
        Default     : Left 0, Top 0, Width 640, Height 480
        Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480, Flags:
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags:
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
                     brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=-6
                       contrast 0x00980901 (int)    : min=0 max=95 step=1 default=1 value=6
                     saturation 0x00980902 (int)    : min=0 max=100 step=1 default=52 value=22
                            hue 0x00980903 (int)    : min=-2000 max=2000 step=1 default=0 value=0
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=0
                          gamma 0x00980910 (int)    : min=100 max=300 step=1 default=115 value=115
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600
                      sharpness 0x0098091b (int)    : min=0 max=7 step=1 default=0 value=0
         backlight_compensation 0x0098091c (int)    : min=36 max=160 step=1 default=54 value=36
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=1
              exposure_absolute 0x009a0902 (int)    : min=5 max=2500 step=1 default=156 value=1659
error 22 getting ext_ctrl Pan (Absolute)
error 22 getting ext_ctrl Tilt (Absolute)
                 focus_absolute 0x009a090a (int)    : min=0 max=1023 step=1 default=0 value=355
                     focus_auto 0x009a090c (bool)   : default=1 value=0
error 22 getting ext_ctrl Zoom, Absolute

I have tried changing the format between MJPEG and YUYV without any change.

I am assuming that it a driver issue or some setting that I am overlooking?

解决方案

Amcap (Windows) in my case has 5 discrete exposure levels [-6,-5,-4,-3,-2].

Linux (guvcview and v4l2) has a continuous range from [5 to 2500] (as can be seen in the OP using v4l2-ctl.

I have manually set the exposure levels in Amcap and then read them using Linux (guvcview):
[-6 = 156; -5 = 312; -4 = 625; -3 = 1250; -2 = 2500]

When I set the exposure to any of these levels it works as expected. HOWEVER if I set any other values, for example, 2499 or 157, just one digit off I get nearly complete black!

I am sure there is some mathematical reason that will show this, however, I have found this misleading since the Linux drivers report a continuous range which suggests that the exposure range is linear, but it is not and is discrete!

这篇关于与 Windows 10 相比,v4l2 手动曝光不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆