Median filter on gray image
Show older comments
I need to write a code for this median filter on gray image for 3 x 3, 5 x 5, 9 x 9 pixels size in matlab...Please help me with this.
Answers (1)
Image Analyst
on 16 Mar 2014
From the help:
B = medfilt2(A, [m n]) performs median filtering of the matrix A in two dimensions. Each output pixel contains the median value in the m-by-n neighborhood around the corresponding pixel in the input image. medfilt2 pads the image with 0s on the edges, so the median values for the points within [m n]/2 of the edges might appear distorted.
Of course, needless to say, a and b take on the values 3, 5, and 9. Let me know if you can't figure it out.
2 Comments
QuestionsAccount
on 15 Feb 2020
please explian it further like what's the values for A.. B m or n. to apply 5×5 median filter on gray image
Image Analyst
on 15 Feb 2020
A is the image variable, a 2-D matrix. B is the filtered version of A. m is the number of rows in the small scanning filter window, and n is the number of columns in the filter window that slides across the input image A.
Categories
Find more on Image Filtering in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!