1 | initial version |
it's one of those png's where a silly webdev put ALL of the information into the alpha channel ONLY. the bgr channels are all black, indeed.
what you have to do is:
Mat m = imread("badalpha.png", IMREAD_UNCHANGED);
Mat bw;
cout << m.type() << " " << m.channels() << endl;
extractChannel(m, bw, 3);
imshow("good", bw);
waitKey();
but, just saying, if you have images like that in your dataset, you have a problem ...