Hi, I am newbie to using opencv with c++. I have a code where I read tif images and count the number of channels and number of layers in the tif image. I have used Mat.channels() to calculate the number of channels in the image and if the channels are more than 1, then I have used cv::split() to split the image into corresponsing channel images. The code works perfectly for 1 channel and 3 channel images. But for 2 channel images (I have also cross verified and confirmed that the image is 2 channel with Halcon), Mat.channels() gives the output as 1 and for 4 channel images, Mat.channels() gives 4 but cv::split() doesn't split the images properly. I would like to know if I am doing anything wrong here and why this is happening.
Any help or input would be greatly appreciated.