set webcam properties (e.g. gain, brightness, expo

2019-08-05 04:39发布

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条回答
地球回转人心会变
2楼-- · 2019-08-05 04:56

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.

查看更多
登录 后发表回答