[英]viewing a tif image file using OpenCV in Jupyter notebook
I have a thermal image in TIF format which I can see using display
command in Ubuntu.我有一张 TIF 格式的热图像,我可以使用 Ubuntu 中的display
命令看到它。 I also have the following information from the image file:我还从图像文件中获得了以下信息:
$ file Rec-000026_16bit_counts.tif
Rec-000026_16bit_counts.tif: Big TIFF image data, little-endian
$ exiv2 Rec-000026_16bit_counts.tif
File name : Rec-000026_16bit_counts.tif
File size : 2097433 Bytes
MIME type :
Image size : 0 x 0
Rec-000026_16bit_counts.tif: No Exif data found in the file
also还
$ tiffinfo Rec-000026_16bit_counts.tif
TIFF Directory at offset 0x200010 (2097168)
Image Width: 1024 Image Length: 1024
Bits/Sample: 16
Sample Format: unsigned integer
Compression Scheme: None
Photometric Interpretation: min-is-black
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Planar Configuration: single image plane
Software: ExaminIR
When I run the following cell:当我运行以下单元格时:
import cv2
img = cv2.imread("Rec-000026_16bit_counts.tif", cv2.IMREAD_UNCHANGED)
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
I get the following error:我收到以下错误:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-67-2756e499dadf> in <module>
1 import cv2
2 img = cv2.imread("Rec-000026_16bit_counts.tif", cv2.IMREAD_UNCHANGED)
----> 3 cv2.imshow('image',img)
4 cv2.waitKey(0)
5 cv2.destroyAllWindows()
error: OpenCV(3.4.9) /io/opencv/modules/highgui/src/window.cpp:382: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
How should I fix this?我应该如何解决这个问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.