我正在尝试使用以下代码进行辩论。
G1 = im2double(imread('C:\Users\adhil\Desktop\matlab pics\test.JPG'));
figure, imshow (G1);
h_1 = fspecial( 'gaussian', [130 221] , 1.0 );
% Fourier Transform of 2D Gaussian
H_1 = fftshift(h_1);
H_1 = fft2(H_1);
H_1 = ifftshift(H_1);
F_1a = zeros(size(G1));
for idx = 1 : size(G1, 3)
G_1 = fftshift(G1(:,:,idx));
G_1 = fft2(G_1);
G_1 = ifftshift(G_1);
tmp = G_1 ./ H_1;
tmp = ifftshift(tmp);
tmp = ifft2(tmp);
tmp = fftshift(tmp);
F_1a(:,:,idx) = tmp;
end
figure, imshow (F_1);

但结果就是这样。
无论如何我可以优化代码以正确地解开图像吗?请指教。