Median Filter
Perform 2-D median filtering
- Library:
Computer Vision Toolbox / Analysis & Enhancement
Computer Vision Toolbox / Filtering
Description
TheMedian Filterblock applies a median filter to each pixel of an input image. For eachM-by-Nneighborhood, the filter replaces the central value with the median value of the neighborhood. If the neighborhood has a center element, the block replaces the center pixel with the median value, as shown in this figure.
If the neighborhood does not have an exact center, then the block has a bias toward the upper-left corner of the neighborhood. In this figure, the median value has been placed in the top-left pixel of the four pixels that meet at the center of the neighborhood.
The block pads the edges of the input image for filtering. This causes the pixels withinM/2pixels of the sides andN/2pixels of the top or bottom of the image to appear distorted.
The median value is less sensitive than the mean to extreme values. Thus,Median Filteris effective for removing salt-and-pepper noise from an image without significantly reducing the sharpness of the image.
Ports
Input
Output
Parameters
Model Examples
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
References
[1] Gonzalez, Rafael C., and Richard E. Woods.Digital Image Processing. 2nd ed.Upper Saddle River, N.J: Prentice Hall, 2002.