Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it's one of those silly PNG's where ALL of the information is in the alpha channel ONLY (R,G,B are all black !).

so, when you try to convert it to grayscale, the alpha will be thrown away first, and you're left with a black image.

if you need a grayscale image for findContours(), rather:

Mat gray;
extractChannel( baseImage, gray, 3 ); // get the alpha channel

it will look like this:

image description