利用directshow修改曝光、增益等参数。

移动版  2016-12-30 10:32  来 源:网络整理  字号:

//修改曝光值;

dedecms.com

private void SetExposure(IBaseFilter capFilter, int iExposure)
    {
        IAMCameraControl cameraControl = capFilter as IAMCameraControl;
        DirectShowLib.CameraControlFlags eFlags = CameraControlFlags.Manual;
        cameraControl.Set(CameraControlProperty.Exposure, iExposure, eFlags);
    }

本文来自织梦

//修改增益值; 内容来自dedecms

private void SetGain(IBaseFilter capFilter, int iGain)
    {
        IAMVideoProcAmp videoProcAmp = capFilter as IAMVideoProcAmp;
        DirectShowLib.VideoProcAmpFlags gFlags = VideoProcAmpFlags.Manual;
        videoProcAmp.Set(VideoProcAmpProperty.Gain, iGain, gFlags);
    }
织梦好,好织梦

3.在Capture的SetupGraph函数中加入下面代码 内容来自dedecms

SetGain(capFilter, iGain);
            SetExposure(capFilter, iExposure);

dedecms.com

这样就可以实现曝光等参数的设置了。

copyright dedecms

转载请注明出处: http://www.10000uw.com/view-34771-1.html