gpt4 book ai didi

c# - 网络摄像头时间不准确,设置曝光时间

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:02 25 4
gpt4 key购买 nike

我有一个复杂的问题,我已经研究了几个星期了。我的程序是一个教育软件,它使用网络摄像头来分析物理实验(例如振荡运动)。我经历过以下情况:

  • 如果处理器忙,时间测量不准确(ISampleGrabberCB.BufferCB(SampleTime))
  • 如果我不用时间,就数数样本:0、1、2……看起来更好的。当我看的时候我察觉到这一点在运动曲线处。

我的主要目标是减少不准确性,我试图通过限制 FPS(这会导致处理器繁忙)来实现。

最佳答案

摘自关于 Time and Clocks in DirectShow 的 MSDN 文章:

Any object that supports the IReferenceClock interface can serve as a reference clock. A filter with access to a hardware timer can provide a clock (an example is the audio renderer), or the filter graph manager can create one that uses the system time.

我从未尝试过使用过滤器中的 IReferenceClock,但我怀疑它可能无法提供您需要的高分辨率时钟。

SO post on high resolution timers可能正是您所需要的。

IAMStreamConfig.AvgTimePerFrame 仅供引用,尝试调整它不会有任何效果。它只是一个值,您可以根据该值计算视频流的平均帧速率。

例如

VIDEOINFOHEADER* pVih = (VIDEOINFOHEADER*)m_MediaTypes.VideoType.pbFormat;

if( pVih )
int nFrameRate = (int)( (double) (10000000.0f / pVih->AvgTimePerFrame) );

关于c# - 网络摄像头时间不准确,设置曝光时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4318600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com