Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get bit depth of original jpg image

I have 32 bit per pixle jpg image i used the following vode to read the image

int Ret = 0;
    //read the input image
    Mat orgMat = cv::imread(strInputFile,CV_LOAD_IMAGE_UNCHANGED );     

    if( orgMat.empty() )
    {
        return ERROR_READ_FILE;     
    }
    int iChannelsNum = orgMat.channels();
    int iImageType = orgMat.type();
    int iImageDepth = orgMat.depth();

How i can find the value which tell me the original bit depth of the image which 32 bpp
the return values are
iChannelsNum = 3
iImageType  = 16
iImageDepth  = 0
and the same return values when i read 24 bpp
so how i can know that the original image is 32 bpp ?