Median filtering performs a two-dimensional filtering operation on the input image using the provided 2D filter kernel, the size of which is the pixel neighborhood range used for the filtering operation. The filter performs a nonlinear operation, computed by weighting the input pixel values according to the filter kernel weights and taking the median value as the output. Median filtering operations are often used for impulse noise reduction, image smoothing, analysis, and so on.
| Input Image | Parameter | Output Image |
|---|---|---|
![]() | - | ![]() |
The median filtering formula is as follows:
is the output image, is the input image, is the filter kernel, and are the width and height of the filter kernel. The specific calculation process is shown as belows:

One of the 5X5 kind of filter kernel is shown below:
For detailed interface information, please refer to hbVPMedianBlur.