matlab 연습 프로그램 (중간값 필터)

1268 단어
cl;
img=imread('1.bmp');
img=double(img);
imshow(mat2gray(img));

[m n]=size(img);
imgn=zeros(m-3,n-3);
temp=[];
for i=1:m-3
for j=1:n-3
temp=img(i:i+3,j:j+3);
imgn(i,j)=median(temp(:));
end
end

figure,imshow(mat2gray(imgn))
imgn=img(1:m-3,1:n-3)-imgn;
figure,imshow(mat2gray(imgn))
imgn=imgn .* (imgn>0);
figure,imshow(mat2gray(abs(imgn)))

전재 대상:https://www.cnblogs.com/tiandsp/archive/2012/02/02/2335632.html

좋은 웹페이지 즐겨찾기