资源简介
一个较好的程序%中值滤波
clc,clear;
f=imread('2.bmp');
subplot(221),imshow(f);
f1=imnoise(f,'gaussian',0.002,0.0008);
subplot(222),imshow(f1);
k1=floor(3/2)+1;
k2=floor(3/2)+1;
X=f1;
[M,N]=size(X);
代码片段和文件信息
%中值滤波
clcclear;
f=imread(‘2.bmp‘);
subplot(221)imshow(f);
f1=imnoise(f‘gaussian‘0.0020.0008);
subplot(222)imshow(f1);
k1=floor(3/2)+1;
k2=floor(3/2)+1;
X=f1;
[MN]=size(X);
uint8 Y=zeros(MN);
funBox=zeros(33);
for i=1:M-3
for j=1:N-3
funBox=X(i:i+3j:j+3);
s=sum(funBox(:));
h=s/9;
Y(i+k1j+k2)=h;
评论
共有 条评论