How to coded for Order-statistic (Nonlinear) Filter
조회 수: 9 (최근 30일)
이전 댓글 표시
This code is Order-statistic (Nonlinear) Filters. Based on ordering (ranking) the pixels contained in the filter mask. Replacing the value of the center pixel with the value. Determined by the ranking result. E.g., median filter, max filter, min filter.
Matlab Code (median):
result = medfilt2(image);
..........................................................................................................................................................
clc
clear all
img=double(imread('glassware_noisy.png','png'));
[m n]=size(img);
p=3;
for i=1:m-p
for j=1:n-p
w=img(i:i+p-1,j:j+p-1);
img2(i,j) = median(w(:));
end
end
img2 = uint8(img2);
imshow(img2)
imwrite(img2,'median_filter_2015.png','png');
I wrote code blog for p=3; If we get p = 5 instead of p = 3 How does it changes the for loop and other codes? I'll be happy if you can help me.
clc
clear all
img=double(imread('glassware_noisy.png','png'));
[m n]=size(img);
p=5;
for....
...........
...........
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!