How can a single channel represent a color image?
I am a total newbie and am going through the tutorials. So, I randomly picked up a pic from my computer and printed the number of channels of the image.
cv::Mat A;
A = cv::imread("../data/image.png", CV_8UC3);
std::cout << A.channels();
The answer is 1. But, what utterly confuses me is that how can a colored image can just be represented with one channel. And if it is only 1 channel, how do I know which channel does it represent ( R, G or B ) ?
Maybe I am missing the basics and corresponding materials can be referred to?
Hi,
Just out of curiosity, did you try to change "A.channels" to lets say "R.channels" ? If the answer would be again 1, then it is how many of A, or R, or G, or B channels do your image have,,, It seems to me that you "asked" how many Alpha channels does your image have, since A may mean Alpha channel.
Digital image can include four channels, the RGB as you mentioned plus one Alpha channel (transparency).
I am just another newbie in OpenCV... Let me know