问题
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