【发布时间】:2018-03-06 18:28:11
【问题描述】:
我正在尝试使用 skimage.transform.estimate_transform 确定两个图像之间的转换,但我只将 NaN 作为转换参数,因此,转换后的图像的所有 NaN。
这是我的代码:
from skimage import data
from skimage.transform import warp, estimate_transform
from scipy.ndimage.interpolation import zoom
# Get the image to transform
image = zoom(data.camera(),4)[-256:,:]
# Make the source and destination images
dst = np.array([range(i,i+2048) for i in range(256)])
src = np.tile(np.mean(dst, axis=0), (256,1))
# Estimate the transform between the two
tform = estimate_transform('affine', src, dst)
# Transform the input image
out = warp(image, tform)
但正如您所见,输出只是一个二维数组 NaN。任何人都可以解释出了什么问题吗?谢谢!
更新:
我找到了一个名为 imreg_dft 的很棒的包,它完全符合我的要求。
【问题讨论】:
标签: python transform scikit-image