Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 with MinGW.

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 Windows(64 bit) with MinGW.MinGW(32 bit).

click to hide/show revision 3
No.3 Revision

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();

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).