图像处理实验2014 联系客服

发布时间 : 星期三 文章图像处理实验2014更新完毕开始阅读a40d8433a8956bec0875e363

5、用高斯高通滤波器进行滤波 二、实验图像: H(u,v)?1?e?D22(u,v)/2D0 原始图像 加噪声后的图像 三、实验主要过程: >> pic=imread('C:\\Documents and Settings\\Administrator\\桌面\\实验图片\\实验五\\sample5-1.bmp') >> [r,c]=size(pic); >> f=fftshift(fft2(double(pic))); >> mx=max(max(f,[],1),[],2); >> imf=abs(f)/mx*25600; >> imshow(uint8(imf)); 布特沃斯低通滤波 D0 = [10,20,40,80]; n = 2; D = f; H = D; for row = 1:r for column = 1:c D(row,column) = sqrt((row-r/2)^2+(column-c/2)^2); end end for type = 1:length(D0) H = 1./(1+(D/D0(type)).^(2*n)); f2 = f.*H; f2 = ifft2(ifftshift(f2)); subplot(2,2,type); imshow(uint8(real(f2))); title(D0(type)); end 高斯低通 D0 = [10,20,40,80]; D = f; H = D; for row = 1:r for column = 1:c D(row,column) = sqrt((row-r/2)^2+(column-c/2)^2); end end for type = 1:length(D0) H = exp(D.^2/(2*D0(type)^2)*(-1)); f2 = f.*H; f2 = ifft2(ifftshift(f2)); subplot(2,2,type); imshow(uint8(real(f2))); title(D0(type)); end D 0越小,结果越模糊,去噪效果越好;D0越大,则相反 布特沃思高通 D0 = [10,20,40,80]; n = 2; D = f; H = D; for row = 1:r for column = 1:c D(row,column) = sqrt((row-r/2)^2+(column-c/2)^2); end end for type = 1:length(D0) H = 1 - 1./(1+(D/D0(type)).^(2*n)); f2 = f.*H; f2 = ifft2(ifftshift(f2)); subplot(2,2,type); imshow(uint8(real(f2))); title(D0(type)); end 高斯高通 D0 = [10,20,40,80]; n = 2; D = f; H = D; for row = 1:r for column = 1:c D(row,column) = sqrt((row-r/2)^2+(column-c/2)^2); end