Current location - Recipe Complete Network - Healthy recipes - Can you tell me the respective advantages and disadvantages of median filtering and mean filtering?
Can you tell me the respective advantages and disadvantages of median filtering and mean filtering?

The mean and median filters are very basic. The mean filter is equivalent to a low-pass filter, which has a tendency to blur the image, and is basically powerless against pretzel noise. The advantage of median filtering is that it can filter out the pretzel noise very well, the disadvantage is that it is easy to cause image discontinuity. The difference between the above two filtering methods can be clearly seen through the following three diagrams.

The original image is an image with pretzel noise

After processing with median filtering, the pretzel noise is almost completely removed

After processing with mean filtering, the pretzel noise is processed into small bubbles, but at the same time the image starts to become blurred.

:

Median filtering is a nonlinear signal processing technique based on the theory of sorting statistics that can effectively suppress noise. The basic principle of median filtering is to replace the value of a point in a digital image or a digital sequence with the median of the values of the points in one of the neighborhoods of that point, so that the values of the surrounding pixels are close to the true value. Thus, isolated noise points are eliminated. The method is to use a two-dimensional sliding template of some structure to generate a monotonically ascending (or descending) as a two-dimensional data sequence by ordering the pixels in the plate according to the size of the pixel values. The two-dimensional median filter output is g(x,y)=med{f(x-k,y-l),(k,l∈W)}, where f(x,y), g(x,y) are the original image and the processed image, respectively. w is a two-dimensional template, which is usually a 3*3, 5*5 region, and can be of different shapes such as a line, a circle, a cross, and a torus.

Mean value filtering is also known as linear filtering, and the main method used is neighborhood averaging. The basic principle of linear filtering is to replace each pixel value in the original image with the mean value, i.e., the current pixel point (x, y) to be processed, select a template, which consists of a number of pixels in its immediate neighborhood, seek the mean value of all the pixels in the template, and then the mean value is given to the current pixel point (x, y) as a processed image in the gray level of the point g(x, y), i.e., g(x, y) = 1/m ∑ f ( x, y)m is the total number of pixels in this template including the current pixel.