set webcam properties (e.g. gain, brightness, exposure)

故事扮演 提交于 2019-12-11 09:49:44

问题


I'm writing a small application on C# (Winforms) where I am accessing a Webcam to capture some images.

Does anyone know if it's possible to access and set the webcam's properties like gain, brightness and exposure using c#? (Don't pop-up Webcam's own Properties window)

I've tried using the DirectShow library and it only allows me to set the exposure but no the gain nor brightness.

Cheers in advance


回答1:


You can set them using IAMVideoProcAmp::Set method, the settable properties include:

typedef enum tagVideoProcAmpProperty {
  VideoProcAmp_Brightness,
  VideoProcAmp_Contrast,
  VideoProcAmp_Hue,
  VideoProcAmp_Saturation,
  VideoProcAmp_Sharpness,
  VideoProcAmp_Gamma,
  VideoProcAmp_ColorEnable,
  VideoProcAmp_WhiteBalance,
  VideoProcAmp_BacklightCompensation,
  VideoProcAmp_Gain 
} VideoProcAmpProperty;

The camera driver certainly needs to support/implement the properties in order for them to be adjustable.



来源:https://stackoverflow.com/questions/7949828/set-webcam-properties-e-g-gain-brightness-exposure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!