How do I get a median filtered image?

How do I get a median filtered image? I want to convert the first image like the second image using median filter.

답변 (1개)

David Young
David Young 2015년 8월 25일

1 개 추천

If you have the Image Processing Toolbox, you can use medfilt2.

댓글 수: 4

kiruthika r
kiruthika r 2015년 8월 26일
This is not working. Do you have any other option?
Guillaume
Guillaume 2015년 8월 26일
편집: Guillaume 2015년 8월 26일
medfilt2 is designed to do exactly what you asked, so if "it is not working" it's either because you're not using it correctly, or what you've asked is not what you want.
Either way, you need to give more information. What error do you get, or in what way is the result not what you wanted?
kiruthika r
kiruthika r 2015년 8월 26일
When I use medfilt2 code, I am getting the image exactly like my first image.
Guillaume
Guillaume 2015년 8월 26일
편집: Guillaume 2015년 8월 26일
Have you tried increasing the size of the kernel. The default is 3x3. Your desired output image is extremely blurred indicative of a large kernel.
Try
medfilt2(img, [10 10]); %kernel size of 10
Note that even with the default, the output of medfilt2 is never exactly the same as the input (unless your image is just uniform)

댓글을 달려면 로그인하십시오.

태그

질문:

2015년 8월 25일

편집:

2015년 8월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by