我想通过torch.fft
来分离图像的低频和高频分量
最好给我一个这样的样品:
import cv2 as cv
import numpy as np
img = cv.imread('messi5.jpg',0)
f = np.fft.fft2(img)
fshift = np.fft.fftshift(f)
rows, cols = img.shape
crow,ccol = rows/2 , cols/2
fshift[crow-30:crow+30, ccol-30:ccol+30] = 0
f_ishift = np.fft.ifftshift(fshift)
img_back = np.fft.ifft2(f_ishift)
img_back = np.abs(img_back)
目前没有回答
相关问题 更多 >
编程相关推荐