Butterworth低通滤波matlab程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

利用matlab编写的Butterworth低通滤波程序,可以运行,运行结果如截图源代码clearall;closeall;P=input('inputimagedata:');d=size(P);if(d(3)1)P=rgb2gray(P);endsubplot(131);imshow(P);title('原始图像');P1=imnoise(P,'salt&pepper',0.02);subplot(132)imshow(P1);title('加入椒盐噪声后的图像');f=double(P1);g=fft2(f);%傅里叶变换g=fftshift(g);%转换数据矩阵[M,N]=size(g);D0=input('inputnonnegativedhresholdD0=');n=input('inputtheorderoffilteringn=');n1=fix(M/2);n2=fix(N/2);fori=1:Mforj=1:Nd=sqrt((i-n1)^2+(j-n2)^2);h=1/(1+(d/D0)^(2*n));result(i,j)=h*g(i,j);endendresult=ifftshift(result);X2=ifft2(result);X3=uint8(real(X2));subplot(133)imshow(X3);title('Butterworth低通滤波所得图像');运行结果截图:

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功