我有一个TIF图像(32位,浮点数)
我需要用Python导入
from PIL import Image, ImageDraw
image = "C:\\foo.tif"
im = Image.open(image).convert('F')
im.getextrema()
(0,0)
data = np.array(im)
>>> data
array([[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
...,
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.]], dtype=float32)
极值为0和0,但在原始图像(32位,浮点数)中,min为301.4110107421875,最大值为4563.666015625
当我尝试绘制图像时,我有一个空图
import pylab as pl
pl.imshow(im)
pl.show()