Search code examples
opencvcameravideo-captureimage-capture

cvCaptureFromCAM() / cvQueryFrame(): disable automatic image correction?


I'm using the two OpenCV functions mentioned above to retrieve frames from my webcam. No additional properties are set, just running with default parameters.

While reading frames in a loop I can see that the image changes, brightness and contrast seem to be adjusted automatically. It definitely seems to be a operation of OpenCV because the image captured by the camera is not changed and lit constantly.

So how can I disable this automated correction? I could not find a property that seems to be able to do that job.


Solution

  • To answer that for my own: OpenCV is buggy or outdated here.

    • it seems to be impossible to get images in native resolution of the camera, they're always 640x480; also forcing it to an other value by setting width and height properties does not change anything
    • it seems to be impossible to disable the automatic image correction, the properties mentioned above seem not to work
    • the brightness/contrast properties doesn't seem to work as well - or at least I could not find any good values for it or the automatic image correction always overrides them

    To sum it up: I'd not recommend to use OpenCV for some more enhanced image capturing.