用媒体基金会在UVC摄像头上设置高分辨率曝光
我需要在本机C ++应用程序中以毫秒的分辨率设置媒体基础的UVC相机上的曝光。
通过MediaFoundation在UVC摄像机上设置暴露的标准方法似乎正在使用 iamcameracontrol 和 cameracontrol_ exposure 属性,使用这样的log2缩放:
ComPtr<IAMCameraControl> videoProc;
HRESULT hr = m_mediaSource.As(&videoProc);
long exposure_val = long(std::roundf(std::log2(exposure_ms/1000.0f)));
hr = videoProc->Set(CameraControl_Exposure, exposure_val, CameraControl_Flags_Manual);
根据MS Docs中的表,这会导致低端的设置非常粗糙,使得无法获得准确的曝光控制,哪个对于更高的帧速率尤其重要。
val | Exposure
. | .
-3 | 125ms
-4 | 63ms
-5 | 31ms
-6 | 16ms
-7 | 8ms
-8 | 4ms
-9 | 2ms
. | .
UVC标准(4.2.2.1.4曝光时间(绝对)控制)将曝光分辨率定义为100US步骤,由ct_exposure_time_absolute_control
控制选择器设置。因此,从理论上讲,所有UVC 1.5兼容的摄像机都应能够在这种高分辨率下进行配置。
我已经浏览了所有mediafoundation文档,找不到以此解决方案而不是缩放方法来控制曝光的方法。因此,这似乎是MF本身的限制。怎么办?
在2020年提出了一个类似的问题,但从未得到正确的回答:
I need to set the exposure on a UVC Camera with Media Foundation in a native C++ application with a resolution of milliseconds.
The standard method for setting exposure on a UVC camera via MediaFoundation appears to be using IAMCameraControl and the CameraControl_Exposure property, using a log2 scaling like this:
ComPtr<IAMCameraControl> videoProc;
HRESULT hr = m_mediaSource.As(&videoProc);
long exposure_val = long(std::roundf(std::log2(exposure_ms/1000.0f)));
hr = videoProc->Set(CameraControl_Exposure, exposure_val, CameraControl_Flags_Manual);
As per the table in the MS docs, this results in a very coarse range of settings in the low end, making it impossible to get accurate exposure control, which is especially important for higher frame rates.
val | Exposure
. | .
-3 | 125ms
-4 | 63ms
-5 | 31ms
-6 | 16ms
-7 | 8ms
-8 | 4ms
-9 | 2ms
. | .
The UVC standard (4.2.2.1.4 Exposure Time (Absolute) Control) defines the exposure resolution as 100us steps, set by the CT_EXPOSURE_TIME_ABSOLUTE_CONTROL
control selector. So in theory, all UVC 1.5 compliant cameras should be capable of being configured at this high resolution of exposure.
I have looked through all the MediaFoundation documentation and cannot find a method for controlling the exposure at this resolution rather than the scaled method. So this seems to be a limitation of MF itself. How can it be done?
A similar question was asked in 2020 but was never properly answered:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论