imread doesn't open pbm/tiff images
Hi, I have a code that works with low dynamic range images (like png, jpeg and other normal extensions), but it can't read pbm/tiff files. What can I do?
cv::Mat img = cv::imread(argv[1], CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR);
if (img.rows*img.cols==0){
printf("\nImage not acquired.");
return 0;
}
..of course, if I load one of those kind of images, it returns 0. I've already asked on stackoverflow but nobody answerd me. I'm getting crazy.
Could you post one of those images you can't load?
Thank you for answering :) Actually, any image with a pbm/tiff extension won't be loaded. I even made a 32byte per channel 2x2 pixel image and it didn't get it. If you still need some image I'll upload them :) Thanks again!
It's better to check with one of your images, because I can open .tiff images without problems. Also, please say which version of OpenCV you're working with
I'm pretty sure it's 2.4.11
This is the 2x2 pixel image I was talking about (.tiff) http://postimg.org/image/dnxaang3p/
And this is a part of a bigger .tiff image: http://postimg.org/image/tg2zgc2ut/
The same images converted with photoshop in pbm can't be opened neither.
(I can't upload them directly because I'm a new user and I can't answer to my own posts. All I can do is give you links :) )
It's ok to me if you give links but... uploading the images have automatically convert them into .png images. Can't you upload them anywhere else preserving the format?
This link should automatically download an example tif image, which I tested and can't open http://www.alternatiff.com/testpage.html
Don't know if it can help, but I tried to download a pbm image to give you. I took this one (http://netghost.narod.ru/gff/sample/i...) and, instead of not opening the file, the program crashed. The difference between the pbm files I make with photoshop and this one is that the downloaded one is b/n.
I don't have problems reading the .pbm file, even using flags. I can open the .tif image without the flags, but it does cause an error with the flags, don't know why. I don't really trust the .tif sample I downloaded. I'm using OpenCV 2.4.10
So you don't have any guess.. right?
Should it help somehow, this is the include&define section:
wow, there are too many things in there. Things I'd definitely delete:
And I guess you know what you're doing with that windows define and include