Richard Knop Richard Knop - 1 month ago 21
C++ Question

Adjusting contrast and brightness with OpenCV

So I am trying to increase both contrast and brightness with OpenCV a bit. This is what I am doing:

Mat image_copy;
cvtColor(image, image_copy, CV_BGRA2BGR);
image_copy.convertTo(image, -1, 1.3, 0.15);


Image I get though looks very strange. It has blue tint. Red and blue colours are inverted. So my red jumper is blue and a blue can on the table is red.

Why?

I am basically trying to achieve the same effect as when you set contrast to 30 and brightness to 15 here:

http://camanjs.com/examples/

Answer

OpenCV has an entire page on the subject: Changing the contrast and brightness of an image!

Comments