Why can't open attached tiff file

asked 2015-03-08 13:38:24 -0500

essamzaky gravatar image

updated 2015-03-08 13:57:00 -0500

I'm trying to use imread(filename) but it always to fial to open the attached tiff file , it open some other tiffs i have folder contain many images such as the attached , why openCV fails in that tiff and how i can overcome the problem.

I had opend this tif by using Paint ,ACDSEE ,... D:\Work\OCR\Sakhr\Images\IDs\Xerox\TIFF\TIFF\IDCar005.XSM\00000001 - Copy.TIFF

note the file extension is TIFF but the original extension is TIF , i changed it to TIFF because there is filter does not accept TIF

Another note , i opened windows explorer and viewed the tiff file properties ,it says the coompression is empty

edit retag flag offensive close merge delete


with your file in debug mode we have > opencv_imgcodecs300d.dll!cv::TiffDecoder::readData(cv::Mat & img) Ligne 219 C++

  • errmsg 0x000000000019b670 "Sorry, requested compression method is not configured" char[1024]

http://partners.adobe.com/public/deve... page 5

LBerger gravatar imageLBerger ( 2015-03-08 14:18:02 -0500 )edit

tif_dir {td_fieldsset=0x000000000210f228 {64194026, 896, 2, 0} td_imagewidth=2496 td_imagelength=3520 ...} TIFFDirectory + td_fieldsset 0x000000000210f228 {64194026, 896, 2, 0} unsigned long[4] td_imagewidth 2496 unsigned int td_imagelength 3520 unsigned int td_imagedepth 1 unsigned int td_tilewidth 2496 unsigned int td_tilelength 3520 unsigned int td_tiledepth 1 unsigned int td_subfiletype 2 unsigned int td_bitspersample 8 unsigned short td_sampleformat 1 unsigned short td_compression 7 unsigned short td_photometric 6 unsigned short td_threshholding 1 unsigned short td_fillorder 1 unsigned short td_orientation 1 unsigned short td_samplesperpixel 3 unsigned short

LBerger gravatar imageLBerger ( 2015-03-08 15:16:31 -0500 )edit

Thankx @LBerger , I know that , source of error is the tif compression not assigned , but how i solve this error in opencv , is there any fix to detect and load this tif , i see some other tools are able to detect the correct image format and correct image compression if they are not signed.. This tiff is obtained by famous scanner from Xerox so it's common case and i think opencv should fix this issue

essamzaky gravatar imageessamzaky ( 2015-03-09 03:57:22 -0500 )edit

With opencv I don't know. but I have read your image using wxwidgets handler for tiff images( In your image I have seen a white page with only few grey lines at top page). May be you can use too http://freeimage.sourceforge.net/ to solve your problem using exception throw by opencv

LBerger gravatar imageLBerger ( 2015-03-09 04:29:00 -0500 )edit