本文整理汇总了Python中shape.Shape.inverse_fourier_transform方法的典型用法代码示例。如果您正苦于以下问题:Python Shape.inverse_fourier_transform方法的具体用法?Python Shape.inverse_fourier_transform怎么用?Python Shape.inverse_fourier_transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shape.Shape
的用法示例。
在下文中一共展示了Shape.inverse_fourier_transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_norm_corr
# 需要导入模块: from shape import Shape [as 别名]
# 或者: from shape.Shape import inverse_fourier_transform [as 别名]
def get_norm_corr(alpha, beta):
'''
Computes normalized convolution of two shapes (3D rasterized models)
Uses Fast Fourier Transform (FFT) to compute convolution efficiently
Input: 'alpha' and 'beta' - Instances of class 'Shape()'
Output: 'corr' - Instance of class 'Shape()'
'''
# taking Fourier tranform of shapes 'alpha' and 'beta'
alpha.fourier_transform()
beta.fourier_transform()
# setting 'corr.voxel_ft' as product of fourier transforms of two shapes
corr = Shape()
corr.set_voxel_ft(alpha.get_voxel_ft() * beta.get_voxel_ft())
# computing inverse Fourier transform for 'corr' and normalizing it
corr.inverse_fourier_transform()
corr.normalize()
return corr