DFT的matlab源代码-fft-ifft:fft-ifft

时间:2021-05-26 05:27:50
【文件属性】:
文件名称:DFT的matlab源代码-fft-ifft:fft-ifft
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-26 05:27:50
系统开源 DFT的matlab源代码fft-ifft 将numpy导入为np 导入cv2 从matplotlib导入pyplot作为plt img = cv2.imread('pic.jpg',0) dft = cv2.dft(np.float32(img),标志= cv2.DFT_COMPLEX_OUTPUT) dft_shift = np.fft.fftshift(dft) itude_spectrum = 20 * np.log(cv2.magnitude(dft_shift [:,:,0],dft_shift [:,:,1])) 行,列= img.shape 乌鸦,ccol =行// 2,列// 2 首先创建一个遮罩,中心正方形为1,其余全为零 mask = np.zeros((rows,cols,2),np.uint8) mask [crow-30:crow + 30,ccol-30:ccol + 30] = 1 应用遮罩和逆DFT fshift = dft_shift *掩码 f_ishift = np.fft.ifftshift(fshift) img_back = cv2.idf
【文件预览】:
fft-ifft-master
----README.md(939B)
----説明(1KB)

网友评论