对图lena_gray_256.tif做以下5个步骤:(1)乘以(-1)^(x+y);(2)计算其DFT;(3)取该变换的共辄复数;(4)计算反DFT;(5)用(-1)^(x+y)乘以结果。请用matlab代码实现
时间: 2023-05-26 20:07:49 浏览: 160
Assignment1.rar_lena_lena.bmp_matlab 抖动_图像抖动_灰度 抖动
步骤一:
img = imread('lena_gray_256.tif');
[row, col] = size(img);
M = 1:row;
N = 1:col;
[X, Y] = meshgrid(N, M);
S = (-1).^(X+Y);
img_new = double(img) .* S;
步骤二:
F = fft2(img_new);
步骤三:
F_conj = conj(F);
步骤四:
f = ifft2(F_conj);
步骤五:
f_new = f .* S;
f_new = uint8(f_new);
imshow(f_new);
阅读全文