Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to put colors over a 1 channel gray image?


I have a grayscale image (CV_8UC1) and I use findContours to identify contours. These contours I would like to draw colored into the grayscale image.

I tried to merge two empty Mats(CV_8UC1) together with the grayscale image and this works not really well. So I have my wished colors, but the original image is blue, red or green depending on the merged channel position.

How can I achieve the grayscale image staying gray with having colored contoures on top?

Thank you very much :-)