Is there an alternative to 5x5 median filter in MATLAB?
9 ビュー (過去 30 日間)
古いコメントを表示
I want the same result, but without using medfilt2
x=imread('sadimg.bmp');
y= medfilt2(x,[5 5])
回答 (2 件)
Image Analyst
2021 年 10 月 4 日
編集済み: Image Analyst
2021 年 10 月 4 日
Yes, remember our discussion in your duplicate question in:
Also see my attached Salt and Pepper filter.
0 件のコメント
yanqi liu
2021 年 12 月 11 日
if use self define function,may be use colfilt、nlfilter to get block process,such as
clc;
clear all;
close all;
im = imread('cameraman.tif');
im2 = imnoise(im, 'salt & pepper');
%fun = @(block_struct) median(block_struct(:));
%im3 = nlfilter(im2,[5 5],fun);
fun = @(block_struct) median(block_struct);
im3 = colfilt(im2,[5 5],'sliding',fun);
im4 = medfilt2(im2, [5 5]);
figure;
subplot(2,2,1); imshow(im);
subplot(2,2,2); imshow(im2);
subplot(2,2,3); imshow(im3);
subplot(2,2,4); imshow(im);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!