1-bit TIFF Image reading problem (Patch #2408)
Description
I was unable to read 1-bit TIFF Images(MM type iOS) in openCV while i had no problem in opening the images using irfanview,photoshop and other image viewers.I have attached a sample tiff Image of same type.
I tried to debug the issue in OpenCV 2.2.0(it is present in the latest release too). Following are my observations:
Source Path: OpenCV-2.2.0\modules\highgui\src
File Name: grfmt_tiff.cpp
Line number 172 : "if( (!is_tiled &&
TIFFGetField( tif, TIFFTAG_ROWSPERSTRIP, &tile_height0 )) ||
(is_tiled &&
TIFFGetField( tif, TIFFTAG_TILEWIDTH, &tile_width0 ) &&
TIFFGetField( tif, TIFFTAG_TILELENGTH, &tile_height0 )))"
In Case when images are not tiled the openCV wrapper needs TIFFTAG_ROWSPERSTRIP which is not present in these images headers but i doubt the need to use this TAG as the tile_height will be same as image_height in case of untiled tiff Image. I have done some modification to the grfmt_tiff.cpp which helped me in resolving the problem. I am attaching the modified and unmodified version of the grfmt_tiff.cpp. Please look at the problem and suggest if the fix is a valid one.
Associated revisions
#2408 patch apply (see pull request at https://github.com/Itseez/opencv/pull/33)
Merge pull request #2408 from ilya-lavrenov:tapi_core_opt
History
Updated by Alexander Smorkalov over 12 years ago
Aashish Kumar, could you propose you changes as pull request on github (https://github.com/Itseez/opencv/pulls)?
It helps to integrate your fix faster.
- Category set to highgui-images
- Priority changed from High to Normal
- Assignee set to Vadim Pisarevsky
- Target version set to 2.4.3
Updated by Aashish Kumar over 12 years ago
Hi Alexander Smorkalov,
I have proposed the changes as pull request.
Thanx
Updated by Vadim Pisarevsky over 12 years ago
- Target version deleted (
2.4.3) - Assignee deleted (
Vadim Pisarevsky)
Updated by Evgeny Talanin over 12 years ago
- Assignee set to Evgeny Talanin
Updated by Evgeny Talanin over 12 years ago
Patch from Github Merged in bd4620f0
- Tracker changed from Bug to Patch
- Status changed from Open to Done
Updated by Andrey Kamaev about 12 years ago
- Target version set to 2.4.3