【问题标题】:Python: Getting all NaNs with `skimage.transform.estimate_transform`Python:使用“skimage.transform.estimate_transform”获取所有 NaN
【发布时间】: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


    【解决方案1】:

    estimate_transform 将两组坐标(不是图像)作为输入,并尝试找到对应的映射。如果您想进行密集或稀疏配准,您要么需要尝试优化,例如,SimilarityTransform,要么提取特征并找到它们之间的转换(例如使用estimate_transform)。

    【讨论】:

    • 好的,我想我明白了。虽然如果我没有在每个图像中识别特征本身,因为它们只是(不一定是线性的)渐变,我该如何进行图像配准?你介意提供一个例子吗?谢谢!
    • 对于密集图像配准,您可能需要查看 Elastix 或 SimpleElastix。如果你只对翻译感兴趣,可以试试scikit-image.org/docs/dev/api/…
    猜你喜欢
    • 2019-06-18
    • 2018-11-06
    • 2021-12-13
    • 2017-06-03
    • 1970-01-01
    • 1970-01-01
    • 2018-08-29
    • 2023-03-06
    • 1970-01-01
    相关资源
    最近更新 更多