Richard Knop Richard Knop - 1 year ago 260
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.


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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download