Issue
I'm trying to read a 16 bit TIFF image (26446 x 16688) in Python. Using OpenCV only reads a black image (all the intensities reads 0) by:
self.img = cv2.imread(self.filename, cv2.IMREAD_UNCHANGED)
Can openCV handle 16 bit or large images (~840mb)? Any workaround?
EDIT: Also
cv2.imshow("output", self.img[0:600])
displays a black image.
Solution
As suggested by Andrew Paxson a different library can be used. There is a library dedicated exclusively for playing with tiff
images.
Use the following code for the same. Make sure you have tif
installed in your system.
import tifffile as tiff
import matplotlib.pyplot as plt
filename = 'Image.tif'
img = tiff.imread(filename)
plt.imshow(img)
Answered By - Jeru Luke
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.