depth() and channel() function return incorrect values
Hi,
I am a newbie with opencv. I am using opencv3.1. I was reading the depth and channles of images but it returns weird values.
Here is my code:
string filepath = "C:/Users/studentlab/Desktop/koora/opencv-logo.png";
cv::Mat image_1= cv::imread(filepath.data(),CV_LOAD_IMAGE_UNCHANGED);
int DEPTH = image_1.depth();
int CHANNELS=image_1.channels();
The depth should be 4(CV_32U) but it reads 0(CV_8U). And the channels reads 4 for every image(i tried checking it for a greyscale image too). Can someone point out my mistake ?
I am using Qt Creator on Windows(64 bit) with MinGW(32 bit).
Is there a CV_32U depth?
Try a
image_1.convertTo(floatImage, CV_32F);
, then you can find another depth than 0...Sorry I meant CV_32S.... that would be a 4. I just wanted to read the depth so I code use it later in my code maybe.
Reading a PNG image he will have a GRAY or BGR or BGRA image. So DEPTH=>CV_8U and CHANNELS=>1 or 3 or 4. There are't incorrect values but there is incorrect undestanding :)