Compare and contrast the advantages and disadvantages of a 3
Compare and contrast the advantages and disadvantages of a 3x3 mean and median filters. Briefly describe why median filter can preserve edges better than the mean filter.
Solution
Answer :
advantages and disadvantages of a 3x3 mean and median filters:-
1) Mean Filter :
The mean filter is a simple sliding-window spatial filter that replaces in the center value. the average mean value of all the pixel values in the window. The window value is usually square but can be any shape.
5 + 3 + 6 + 2 + 1 + 9 + 8 + 4 + 7 = 45
45 / 9 = 5
Center value in previously 1 is replaced by the mean value 5.
2) Median Filter:
The median filter is sliding-window filter value, but it replaces the center value in the window with the median valueof pixel values in the window.
order = 0, 2, 3, 3, 4, 6, 10, 15, 97
Center value in previously 97 is replaced by the median 4.
| 5 | 3 | 6 |
| 2 | 1 | 9 |
| 8 | 4 | 7 |
