class Displacement -- Displacement 对象

位移对象是由 Image.find_displacement() 返回的 attrtuple。它编码了通过两幅图像之间的相位相关估计出的刚性对齐:以像素为单位的平移,以及——当使用 find_displacement(..., logpolar=True) 时——以弧度表示的旋转加上一个缩放因子。

字段可通过属性名(displacement.x_translation)或索引(displacement[0])访问。该对象没有公开的构造函数。

class image.displacement

请调用 Image.find_displacement() 来创建此对象。

x_translation

两幅图像之间沿 X 轴的平移,以像素为单位。浮点数。索引 [0]

y_translation

两幅图像之间沿 Y 轴的平移,以像素为单位。浮点数。索引 [1]

rotation

两幅图像之间的旋转,以弧度表示。仅当使用 find_displacement(..., logpolar=True) 时才有意义;否则为 0.0。浮点数。索引 [2]

scale

两幅图像之间的缩放变化。仅当使用 find_displacement(..., logpolar=True) 时才有意义;否则为 1.0。浮点数。索引 [3]

response

相位相关匹配的质量,范围为 0.0 -- 1.0,其中 1.0 表示完美匹配。可用它来剔除低置信度的结果。浮点数。索引 [4]