How to load single bit 3 channel image? [closed]

asked 2016-11-01 23:41:44 -0600

Madalasa gravatar image

Image is in the range [0-1].I tried to use Mat img=imread(filename,CV_LOAD_IMAGE_COLOR); But the rows are 0 and cols are 0 and channels as 3. So how to access it properly. when i'm using CV_LOAD_IMAGE_ANYDEPTH error is coming.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-12-04 11:39:46.910491

Comments

where does that image come from (and in which format did it got saved) ?

berak gravatar imageberak ( 2016-11-01 23:51:26 -0600 )edit

Can you please confirm your bit depth? i.e is it floating point [0.0 - 1.0] or bool (Binary) [0 or 1] ? There is no binary data format in opencv! You can use 8UC instead!

Balaji R gravatar imageBalaji R ( 2016-11-01 23:55:06 -0600 )edit

In matlab it is showing as single bit image

Madalasa gravatar imageMadalasa ( 2016-11-02 00:05:32 -0600 )edit

Image we only computed using ERDAS software. Image is converted to TOA(Top of Atmospheric reflectance)... Stored as tiff format

Madalasa gravatar imageMadalasa ( 2016-11-02 00:06:22 -0600 )edit

Bit depth is [0.0-1.0]

Madalasa gravatar imageMadalasa ( 2016-11-02 00:08:24 -0600 )edit

opencv support for weird tiff formats is unfortunately very sparse.

maybe you 'll have to fall back to use libtiff directly (w/o imread() wrapper)

berak gravatar imageberak ( 2016-11-02 00:14:35 -0600 )edit

Unable to use libtiff properly..So is there any other way to access it

Madalasa gravatar imageMadalasa ( 2016-11-02 00:17:54 -0600 )edit

Tried to use IplImage img=cvLoadImage(filename,-1) but it is also not working

Madalasa gravatar imageMadalasa ( 2016-11-02 00:20:08 -0600 )edit

ahhh please don't (avoid the c-api, it's plain dead.)

berak gravatar imageberak ( 2016-11-02 00:22:05 -0600 )edit

Any other way to read??

Madalasa gravatar imageMadalasa ( 2016-11-02 00:41:21 -0600 )edit