Reading a tiff file with skimage

I am using the following code to read a set of tiff files from a folder

from PIL import image
from skimage import io
io.use_plugin('pil')
images = os.listdir(train_data_path)
for image_name in images:
    img = io.imread(os.path.join(train_data_path, image_name))

When you run the above code, most files are read smoothly. But I found that the program will generate some warning message for a specific file

/devl/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/external/tifffile/tifffile.py:1794: RuntimeWarning: py_decodelzw encountered unexpected end of stream                                  
strip = decompress(strip)      

When I open this file, I do not see any obvious difference with others. What is the reason for this?

+4
source share

Source: https://habr.com/ru/post/1658357/


All Articles