Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

changing focal length in a camera

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?

changing focal length in How can a camerasingle image 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?

How can a single image 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?