This maybe rudimentary, but is it possible to know how many channels a cv::Mat has? For eg, we load an RGB image, I know there are 3 channels. I do the followin
cv::Mat
Call Mat.channels() :
Mat.channels()
cv::Mat img(1,1,CV_8U,cvScalar(0)); std::cout<
Output:
1
which is the number of channels.
Also, try:
std::cout<
0
which belongs to CV_8U (look here at line 542). Study file types_c.h for each define.
types_c.h
define