My problem is about working with "SetVideoProperty" of Aforge.Video.DirectShow is in order to set the brightness, contrast, hue ,... of a live usb camera, manually. The problem is that when i changed the contrast and brightness manually, it works correctly, but it does not work for hue, properly.
I have found the minimum, maximum and default value of the hue of the camera using "GetVideoPropertyRange" and found the min=0, max=255, default=128, if I set the hue using "SetVideoProperty" to the values greater than 128, it works correctly, but if I set this to the values under 128, for example if I set it to 100, the value would be changed to 156. In fact this value, 156, is (128-100)+128; I should be noticed that I checked this with another live camera and everything worked well, but with a usb camera, it dose not work like above mentioned problem.
This is a sample code:
- Code: Select all
VideoCaptureDevice Vid = new VideoCaptureDevice(monikorstring);
Vid.start();
Vid.SetVideoProperty(VideoProcAmpProperty.Hue, [b]100[/b], VideoProcAmpFlags.Manual);
int hue;
VideoProcAmpFlags flag;
Vid.GetVideoProperty(VideoProcAmpProperty.Hue, out hue, out flag);
[b]hue=156;[/b]