matlab均值滤波(原创).docVIP

  • 164
  • 0
  • 约1.74千字
  • 约 3页
  • 2018-02-08 发布于河南
  • 举报
matlab均值滤波(原创)

clear all; close all; P=input(input picture data:); d=size(P); if(d(3)1) P=rgb2gray(P); end choice=1; while(choice~=0) P=imnoise(P,salt pepper,0.02); subplot(221);imshow(P); title(加入椒盐噪声后的图像); P=double(P); [m n]=size(P); g=zeros(m,n); m1=m+2; n1=n+2; PP=zeros(m1,n1); for i=2:m1-1 for j=2:n1-1 PP(i,j)=P(i-1,j-1); end end PP(1,2:n1-1)=P(2,1:n); PP(m1,2:n1-1)=P(m-1,1:n); PP(1:m1,1)=PP(1:m1,3); PP(1:m1,n1)=PP(1:m1,n1-2); disp(-----------------------------------------------); disp( 主 菜 单 ); disp(The Number of Ngeighbourhood-Av

文档评论(0)

1亿VIP精品文档

相关文档