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

I use the two OpenCV features mentioned above to extract frames from a webcam. Additional properties are not set, they are simply executed with default parameters.

When reading frames in a loop, I see that image change, brightness and contrast seem to be automatically adjusted. Obviously, this is an OpenCV operation, because the image captured by the camera does not change and constantly burns.

So how can I turn off this automatic correction? I could not find a property that seems to be able to do the job.

+4
source share
2 answers

To answer this on your own: OpenCV is buggy or outdated here.

  • It seems impossible to obtain images in the camera’s native resolution, they are always 640x480; also forcing it to a different value, setting the width and height properties, does not change anything.
  • it seems impossible to turn off automatic image correction, the properties mentioned above do not work
  • the brightness / contrast properties do not seem to work, or at least I could not find any good values ​​for it, or automatic image correction always overlaps them.

To summarize: I would not recommend using OpenCV for more advanced image capture.

0
source

You should try playing with these three options:

CV_CAP_PROP_BRIGHTNESS Image brightness (cameras only) CV_CAP_PROP_CONTRAST Image contrast (cameras only) CV_CAP_PROP_SATURATION Image saturation (cameras only)

Try setting everything to 50. Also (if that doesn't help) try changing the capture settings of another camera from the documentation .

+3
source

Source: https://habr.com/ru/post/1445593/


All Articles