How do I get a median filtered image?
2 views (last 30 days)
Show older comments
How do I get a median filtered image? I want to convert the first image like the second image using median filter.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148419/image.bmp)
0 Comments
Answers (1)
David Young
on 25 Aug 2015
4 Comments
Guillaume
on 26 Aug 2015
Edited: Guillaume
on 26 Aug 2015
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)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!