Median
Apply median filter to image
1. imgMedian d:=10;
2. imgMedian d:=5 img:=mat(1) oimg:=mat(2);
Please refer to the page for additional option switches when accessing the x-function from script
Input
int
Specifies the dimensions of the neighborhood on which median filtering is applied. This value should not be less than 2.
Image
Specifies the source image to be manipulated. The default input is the active image.
Output
Specifies the output image. By default, the output image is the same as the input image.
See the syntax here.
This function applies median filtering to an image. Each pixel of the input image is replaced by the median of the pixels in its neighborhood.
Median filter is usually used for noise removal. It is especially suitable for removing salt and pepper noise and pulse noise.
It is more advantageous over average filter in that it tends to preserve more features, for example, true edges, in the input image.
In this example, we use the imgMedian function to remove noise from the input image:
The original image
The output image
The computation uses L_MedianFilterBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read L_MedianFilterBitmap topic.
LEADTOOLS Main API Help file, Version 14
imgAverage, imgUserfilter