image_fft = torch.fft.fftn(image.type(torch.complex64), dim = (-2,-1))
cross_low_image_fft = torch.fft.fftn(cross_low_image.type(torch.complex64), dim=(-2, -1))
#相位
image_phase = torch.angle(image_fft)
cross_low_image_phase = torch.angle(cross_low_image_fft)
# 交换相位
image_phase, cross_low_image_phase = cross_low_image_phase, image_phase
# 合成频域
image_new_fft = torch.view_as_complex(torch.stack([torch.cos(image_phase),torch.sin(image_phase)],dim=-1)) * torch.abs(image_fft)
image_new = torch.fft.ifftn(image_new_fft, dim=(-2,-1)).real[:, :image.shape[1], :image.shape[2]]
image = image_new2
发布时间 2023-05-25 09:34:23作者: helloWorldhelloWorld