数字图像-频域处理

冈萨雷斯第三版,频域处理代码示例:


% 低通滤波
clc, clear, 


I = imread('blown_ic.tif');
[r,c] = size(I);
subplot(331),imshow(I);title('Origin');


Id = padarray(I,[r,c],'post');
subplot(332),imshow(Id);title('pad array');


for i = 1:2*r
    for j = 1:2*c
        hp(i,j) = (-1)^(i-1+j-1);
    end
end
Ip = hp.*double(Id);
subplot(333),imshow(Ip,[]);title('shift array');


F = fft2(Ip);% padding of  H
subplot(334),imshow(log(1+abs(F)),[]);title('spectrum of F');


H = lpfilter('gaussian',2*r,2*c,50,1);% 
subplot(335),imshow(H,[]);title('H');


G = H.*F;
subplot(336),imshow(G);title('G=H.*F ');


gp = hp.*real(ifft2(G));% filtering
subplot(337),imshow(gp,[]);title('gp ');


g = gp(1:r,1:c);% cropped images
subplot(338),imshow(g,[]);title('g ');



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值