How to set up smartphones and PCs. Informational portal

Signal filtering methods median filtering. Median filtering

Median filtering is a non-linear signal processing technique developed by Tukey. This method is useful for noise reduction in an image. The one-dimensional median filter is sliding window A that spans an odd number of image elements. The center element is replaced by the median of all elements in the window. Median of a discrete sequence for odd N is that element for which there are elements less than or equal to it in magnitude, and elements greater than or equal to it in magnitude.

Let the image elements with levels 80, 90, 200, 110 and 120 get into the window; in this case, the center element should be replaced by the value 110, which is the median of the ordered sequence 80, 90, 110, 200. If in this example the value 200 is a noise spike in a monotonically increasing sequence, then median filtering will provide a significant improvement. On the contrary, if a value of 200 corresponds to a useful signal pulse (when using broadband sensors), then the processing will lead to a loss in the clarity of the reproduced image. Thus, the median filter in some cases provides noise suppression, in others it causes unwanted signal suppression.

Consider the effect of the median and averaging (smoothing) filters with a five-element window on the stepped, sawtooth, impulse and triangular discrete signals(Fig. 4.23). From these charts, it can be seen that the median filter does not affect step or sawtooth functions, which is usually a desirable property. However, this filter suppresses impulse signals whose duration

is less than half the width of the window. The filter also flattens the top of the triangular function.

Action Analysis Capabilities median filter limited. It can be shown that the median of the product of a constant and a sequence is:

Besides,

However, the median of the sum of two arbitrary sequences and is not equal to the sum of their medians:

This inequality can be verified using the sequences 80, 90, 100, 110, 120 and 80, 90, 100, 90, 80 as an example.

Various strategies for applying the median filter to suppress noise are possible. One of them recommends starting with a median filter whose window covers three image elements. If the signal attenuation is insignificant, the filter window is expanded to five elements. This is done until the median filtering begins to do more harm than good.

Another possibility is to implement cascaded median signal filtering using a fixed or variable width window. In general

For example, those areas that remain unchanged after a single filter treatment do not change after repeated processing. Areas where duration pulse signals is less than half the width of the window will be subject to change after each processing cycle.

The concept of a median filter can easily be generalized to two dimensions by applying a 2D window of desired shape, such as rectangular or close to circular. Obviously, a 2D median filter with a window of size provides more effective noise suppression than sequentially applied horizontal and vertical 1D median filters with a window of size . 2D processing, however, results in more significant signal attenuation.

Introduction

median filtering digital signal

Digital signal processing has found wide application in various fields of activity: television, radar, communications, meteorology, seismology, medicine, speech analysis and telephony, as well as in the processing of images and fields of various nature. In some areas of economic activity, such as banking, the processing of digital financial flows is of fundamental importance.

The development of computer and microprocessor technology leads to the creation of more and more reliable, high-speed, miniature, high-quality and inexpensive equipment. Digital technologies have become so massive that we use them in everyday life, without particularly noticing: cellular telephone, CD player, computer, etc.

In the course of this work, it is necessary to consider the advantages and disadvantages of median filtering. Familiarize yourself with the principles of work median filters. Using the MatLab712 R2011a program, show its operation using an example.

Theoretical part of DSP

median filter

Everything linear algorithms filtering leads to smoothing of sharp changes in the brightness of images that have been processed. This disadvantage, which is especially significant if the consumer of information is a person, cannot be excluded in principle within the framework of linear processing. The point is that linear procedures are optimal for a Gaussian distribution of signals, noise, and observed data. Real images, strictly speaking, do not obey this probability distribution. Moreover, one of the main reasons for this is the presence of various borders in images, brightness differences, transitions from one texture to another, etc. Yielding to a local Gaussian description within limited areas, many real images in this regard are poorly represented as globally Gaussian objects . This is the reason for the poor transfer of boundaries in linear filtering.

The second feature of linear filtering is its optimality, as just mentioned, with the Gaussian nature of the noise. Usually, this condition is met by noise interference in images, therefore, when suppressing them, linear algorithms have high performance. However, one often has to deal with images distorted by other types of noise. One of them is impulse noise. When exposed to it, white and (and) black dots are observed on the image, randomly scattered around the frame. The use of linear filtering in this case is inefficient - each of the input pulses (essentially a delta function) gives a response in the form of a filter impulse response, and their combination contributes to the propagation of noise over the entire frame area.

A successful solution to these problems is the use of median filtering, proposed by J. Tukey in 1971 for the analysis of economic processes. The most comprehensive study of median filtering as applied to image processing is presented in the collection. Note that median filtering is a heuristic processing method, its algorithm is not mathematical solution strictly formulated problem. Therefore, researchers pay great attention to the analysis of the efficiency of image processing based on it and comparison with other methods.

When applying the median filter (MF), each point of the frame is sequentially processed, resulting in a sequence of estimates. Conceptually, the processing at different points is independent (in this way, the MF is similar to a mask filter), but in order to speed it up, it is advisable to algorithmically use previously performed calculations at each step.

Median filtering uses a two-dimensional window (filter aperture), which usually has central symmetry, with its center located at the current filtering point. On fig. 1.1 shows two examples of the most commonly used window options in the form of a cross and in the form of a square. Aperture sizes are among the parameters that are optimized in the process of analyzing the effectiveness of the algorithm. The image samples that are within the window form the working sample of the current step.

Rice. 1.1.

The two-dimensional nature of the window allows for essentially two-dimensional filtering, since data from both current lines and column, and from neighboring ones. Denote the working sample as a one-dimensional array; the number of its elements is equal to the size of the window, and their arrangement is arbitrary. Usually, windows with an odd number of points are used (this is automatically ensured when the aperture is centrally symmetric and when the central point itself enters into its composition). If you sort the sequence in ascending order, then its median will be the sample element that occupies a central position in this ordered sequence. The number thus obtained is the filtering product for the current point of the frame. It is clear that the result of such processing does not really depend on the sequence in which image elements are presented in the working sample. Let us introduce the formal notation of the described procedure in the form:

x * =med(y 1 , y 2 ,…, y n) (1.1)

Consider an example. Suppose that the selection has the form: Y=(136,110,99,45,250,55,158,104,75), and the element 250, located in its center, corresponds to the current filtering point (i 1 , i 2) (Fig. 1.1). Great importance brightness at this point in the frame may be the result of impulse (dot) interference. The sample ordered in ascending order has the form (45,55,75,99,104,110,136,158,250), therefore, in accordance with the procedure (1.1), we obtain x * =med(y 1 , y 2 ,…, y 9)=104. We see that the influence of “neighbors” on the result of filtering at the current point led to the “ignoring” of the impulse burst of brightness, which should be considered as a filtering effect. If the impulse noise is not point, but covers some local area, then it can also be suppressed. This will happen if the size of this local area is less than half the size of the MF aperture. Therefore, to suppress impulse noise that affects local areas of the image, it is necessary to increase the size of the MF aperture.

From (1.1) it follows that the action of the MF consists in “ignoring” the extreme values ​​of the input sample, both positive and negative outliers. This principle of interference suppression can also be applied to reduce noise in the image. However, a study of noise suppression using median filtering shows that its effectiveness in solving this problem is lower than that of linear filtering.

The experimental results illustrating the operation of the MF are shown in Figs. 1.2. In the experiments, an MF was used, which has a square aperture with a side equal to 3. The left row shows images distorted by noise, and the right row shows the results of their median filtering. On fig. 1.2 a and fig. 1.2.c shows the original image, distorted impulse noise. When it was superimposed, a random number generator was used with a uniform distribution law over the interval, which generates independent random numbers at all points of the frame. The noise intensity was set by the probability p of its occurrence at each point. If for random number n i1i2 formed at the point (i 1 , i 2), the condition n i1i2

Rice. 1.2.

Rice. 1.2. e shows an image distorted by independent Gaussian noise at a signal-to-noise ratio q 2 =-5 dB, and fig. 1.2.e - the result of its filtering by the median filter. The conditions of this experiment make it possible to compare its results with the results of the linear filtering considered above. Table 1.1 provides data to enable such a comparison. For various filtering methods, this table gives the values ​​of the relative mean square errors q 2 and the noise attenuation coefficient r for the case when the signal-to-noise ratio at the filter input is -5 dB.

Table 1.1. Comparison of noise suppression efficiency in image filtering, q 2 =-5 dB.

The two-dimensional Wiener filter has the highest efficiency, reducing the mean square of errors by a factor of 17. The median filter has the lowest efficiency among all considered filters, it corresponds to r = 5.86. However, this number indicates that even with its help it is possible to significantly reduce the level of noise in the image.

However, as mentioned above, and as shown in Fig. 1.2.e, median filtering smoothes the edges of the image to a lesser extent than any linear filtering. The mechanism of this phenomenon is very simple and consists in the following. Let us assume that the filter aperture is located near the border separating the light and dark areas of the image, while its center is located in the area of ​​the dark area. Then, most likely, the working sample will contain a larger number of elements with low brightness values, and, therefore, the median will be among those elements of the working sample that correspond to this area of ​​the image. The situation is reversed if the center of the aperture is shifted to a region of higher brightness. But this means that the MF is sensitive to changes in brightness. There are a huge number of interpretations of the methods of MF work, let's consider another one, using it as an example when processing images of blood cells - granulocytes. Before measuring the size of a granulocyte, its image was subjected to smoothing with a median filter in order to eliminate granules that could affect the measurement result. Usually, in the process of median filtering, the signal values ​​in a certain neighborhood of the point where the filter response is calculated are sorted in ascending or descending order in a variational series. The filter response is defined as the median -- the signal value of the middle (center) of the variation series. In what follows, this neighborhood will be referred to as the filter window. In addition, for simplicity, we will consider a filter with a square window of size n×n .

Therefore, when calculating the median in the filter window, the number of data operations, such as the number of sort operations, is n 2 . When processing an image with a size of M?N dots (pixels), the number of data operations will be large and will be M?N?n 2 . Different operations require different execution times. By sequentially scanning an image, the most time-consuming sorting operations can be reduced. Thus, when passing from point o1 with window w1 to point o2 with window w2 in Fig. 1.3. it is possible to exclude the points of column 1 from the variation row of window w1, sort the points of column 6 and merge the two resulting variation rows into one. Such an algorithm works faster than independent sorting in each window, but the total number of data manipulations (albeit less laborious), for example, at least sorting through the data, remains the same, i.e., quite large. Therefore, in median filtering, images are usually limited to windows of 3×3 or 5×5 and rarely larger, which is quite sufficient, for example, to eliminate impulse noise.

Rice. 1.3. Scanning an Image with a Median Filter Window

The same restrictions are forcibly accepted for various non-linear operations of morphological processing performed in the geometric space of the image, and which, unlike linear operations, cannot be performed in Fourier space. However, there are a number of image processing problems that could be efficiently solved using a median filter, but they require a large window. One of these tasks will be discussed below. Therefore, a possible increase in the speed of median filtering promises great prospects in image processing problems.

Median filtering methods are quite diverse. They can be improved. One such upgrade is called adaptive median filtering.

Median filtering also has its disadvantages. In particular, it has been experimentally established that this method has a relatively low efficiency in filtering the so-called fluctuation noise. In addition, when the mask size is increased, the contours of the image are blurred and, as a result, the clarity of the image is reduced. These disadvantages of the method can be reduced to a minimum by using median filtering with a dynamic mask size (adaptive median filtering). The principle of calculating the central reference for local image processing by a sliding window remains the same. This median is from a set of ordered samples that fall into the window (mask), and the size of the sliding window (mask) is dynamic and depends on the brightness of neighboring pixels.

Let us introduce the threshold coefficient of brightness deviation S threshold = . The values ​​of the deviation of the brightness of neighboring pixels A(r, n, m), which fell into a window of size n?m, relative to the brightness of the central sample A(r) will be written in the form (1.2):

Then the criterion according to which it is necessary to increase the size of the mask with a central reading r will look like this:

Based on the described algorithm, a computer program was developed that confirmed in practice the advantages of adaptive median filtering.

If your engineering background is similar to mine, then you probably know a lot about the various types of linear filters, the main task of which is to pass a signal in one frequency range and delay signals in other ranges. These filters are, of course, indispensable for many types of noise. However, in the real world of embedded systems, it takes a little time to realize that classical linear filters are useless against impulse noise (burst noise, popcorn noise).

Impulse noise usually arises from pseudo random events. For example, a two-way radio may switch near your device, or some static discharge may occur. Whenever this happens, the input signal may be temporarily distorted.

For example, as a result of analog-to-digital conversion, we get the following series of values: 385, 389, 912, 388, 387. The value 912 is supposedly anomalous and should be rejected. If you try to use a classic linear filter, you will notice that the value 912 will have a significant impact on the output. The best solution in this case would be to use a median filter.

Despite the obviousness of this approach, my experience is that median filters are remarkably rare in embedded systems. Perhaps this is due to a lack of knowledge about their existence and difficulty with implementation. I hope my post to some extent remove these obstacles.

The idea behind the median filter is simple. It selects an average from a group of input values ​​and outputs it. And usually the group has an odd number of values, so there is no problem with the choice

Until recently, I distinguished three classes of median filters, differing in the number of values ​​used:

Filter using 3 values ​​(smallest possible filter),
- filter using 5, 7 or 9 values ​​(most used),
- filter using 11 or more values.

Now I stick to a simpler classification:

Filter using 3 values,
- filter using more than 3 values.

Median filter by 3

This is the smallest possible filter. It is easily implemented with few statements and hence has small and fast code.


uint16_t middle_of_3(uint16_t a, uint16_t b, uint16_t c)
{
uint16_t middle;

If ((a<= b) && (a <= c)){
middle = (b<= c) ? b: c;
}
else(
if ((b<= a) && (b <= c)){
middle = (a<= c) ? a: c;
}
else(
middle = (a<= b) ? a: b;
}
}

return middle;
}

Median filter > 3

For a filter size greater than 3, I suggest you use the algorithm described by Phil Ekstrom in the November 2000 issue of Embedded Systems Programming. Extrom uses a linked list. The good thing about this approach is that when the array is sorted, removing the old value and adding a new one doesn't make the array significantly cluttered. Therefore, this approach works well with large filters.

Keep in mind, there were some bugs in the original published code, which Ekstrom later fixed. Considering that it is difficult to find something on embedded.com now, I decided to publish my implementation of its code. The code was originally written in Dynamic C, but has been ported to standard C for this post. The code is supposedly working, but it's up to you to fully test it.


#define NULL 0
#define STOPPER 0 /* Smaller than any datum */
#define MEDIAN_FILTER_SIZE 5

uint16_t MedianFilter(uint16_t datum)
{

struct pair(
struct pair *point; /* Pointers forming list linked in sorted order */
uint16_tvalue; /* Values ​​to sort */
};

/* Buffer of nwidth pairs */
static struct pair buffer = (0);
/* Pointer into circular buffer of data */
static struct pair *datpoint = buffer;
/* chain stopper */
static struct pair small = (NULL, STOPPER);
/* Pointer to head (largest) of linked list.*/
static struct pair big = (&small, 0);

/* Pointer to successor of replaced data item */
struct pair *successor;
/* Pointer used to scan down the sorted list */
struct pair *scan;
/* Previous value of scan */
struct pair *scanold;
/* Pointer to median */
struct pair *median;
uint16_t i;

if (datum == STOPPER)(
datum = STOPPER + 1; /* No stoppers allowed. */
}

If ((++datpoint - buffer) >= MEDIAN_FILTER_SIZE)(
datapoint = buffer; /* Increment and wrap data in pointer.*/
}

datapoint->value = datum; /* Copy in new datum */
successor = datepoint->point; /* Save pointer to old value"s successor */
median = /* Median initially to first in chain */
scanold = NULL; /* Scanold initially null. */
scan = /* Points to pointer to first (largest) datum in chain */

/* Handle chain-out of first item in chain as special case */
if (scan->point == datapoint)(
scan->point = successor;
}


scan = scan->point ; /* step down chain */

/* Loop through the chain, normal loop exit via break. */
for (i = 0 ; i< MEDIAN_FILTER_SIZE; ++i){
/* Handle odd-numbered item in chain */
if (scan->point == datapoint)(
scan->point = successor; /* Chain out the old datum.*/
}

If (scan->value< datum){ /* If datum is larger than scanned value,*/
datpoint->point = scanold->point; /* Chain it in here. */
scanold->point = datepoint; /* Mark it chained in. */
datum = STOPPER;
};

/* Step median pointer down chain after doing odd-numbered element */
median = median->point; /* Step median pointer. */
if (scan == &small)(
break; /* Break at the end of the chain */
}
scanold=scan; /* Save this pointer and */
scan = scan->point; /* step down chain */

/* Handle even-numbered item in chain. */
if (scan->point == datapoint)(
scan->point = successor;
}

If (scan->value< datum){
datpoint->point = scanold->point;
scanold->point = datepoint;
datum = STOPPER;
}

If (scan == &small)(
break;
}

scanold=scan;
scan = scan->point;
}

return median->value;
}

To use this filter, simply call the function each time you receive a new input value. The function will return the average value of the last accepted values, the number of which is determined by the MEDIAN_FILTER_SIZE constant.

This algorithm can use a fair amount of RAM (depending on the size of the filter, of course) because it saves input values ​​and structure pointers. However, if this is not a problem, then the algorithm is really good to use because it is significantly faster than sort-based algorithms.

Median filtering based on sort

In an older version of this article, for median filters of size 5, 7, or 9, I supported the sorting algorithm approach. Now I have changed my mind. However, if you would like to use them, I provide you with the basic code:


if (ADC_Buffer_Full)(

Uint_fast16_t adc_copy;
uint_fast16_t filtered_cnts;

/* Copy the data */
memcpy(adc_copy, ADC_Counts, sizeof(adc_copy));

/* Sort it */
shell_sort(adc_copy, MEDIAN_FILTER_SIZE);

/* Take the middle value */
filtered_cnts = adc_copy[(MEDIAN_FILTER_SIZE - 1U) / 2U];

/* Convert to engineering units */
...

Conclusion

The use of median filters comes with a cost. It is obvious that median filters add a delay to stepwise changing values. Also, median filters can completely overwrite the frequency information in the signal. Of course, if you are only interested in constant values, then this is not a problem.

With these reservations in mind, I still strongly recommend that you use median filters in your designs.

The median filter implements a non-linear noise reduction procedure. The median filter is a window W sliding across the image field, covering an odd number of samples. The center count is replaced by the median of all image elements that fall within the window. The median of a discrete sequence x1, x2, ..., xL for odd L is its element such that there are (L ? 1)/2 elements less than or equal to it and (L ? 1)/2 elements greater than or equal in size. In other words, the median is the average member of the series resulting from the ordering of the original sequence.

For example, med(20, 10, 3, 7, 7) = 7.

A two-dimensional median filter with a window W is defined as follows:

The median filter is used to suppress additive and impulse noise in the image. A characteristic feature of the median filter is the preservation of brightness differences (contours). The median filter is especially effective in the case of impulse noise. The effect of the smoothing and median filters with a three-element window on the brightness gradient noisy with additive noise for a one-dimensional signal is shown in Fig.

As for impulse noise, the median filter with a 3 x 3 window completely suppresses single spikes on a uniform background, as well as groups of two, three and four impulse spikes. In general, to suppress a group of impulse noise, the window size should be at least twice the size of the group of noise.

Among the median filters with a 3x3 window, the following are the most common:

The coordinates of the presented masks mean how many times the corresponding pixel is included in the ordered sequence described above.

One of the effective ways to eliminate impulse noise in an image is to use a median filter.

For each pixel in some of its environment (window), the median value is searched and assigned to this pixel. Definition of the median value: if an array of pixels is sorted by their value, the median will be the middle element of this array. The window size must accordingly be odd for this middle element to exist.

The median can also be determined by the formula:

where W is the set of pixels among which the median is being sought, and fi are the brightness values ​​of these pixels.

For color images, a vector median filter (VMF) is used:

where Fi are pixel values ​​in 3D color space and d is an arbitrary metric (e.g. Euclidean).

However, in its pure form, the median filter blurs small details, the value of which is less than the size of the median search window, so it is practically not used in practice.

All linear filtering algorithms lead to smoothing of sharp changes in the brightness of images that have been processed. This disadvantage, which is especially significant if the consumer of information is a person, cannot be excluded in principle within the framework of linear processing. The point is that linear procedures are optimal for a Gaussian distribution of signals, noise, and observed data. Real images, strictly speaking, do not obey this probability distribution. Moreover, one of the main reasons for this is the presence of various borders in images, brightness differences, transitions from one texture to another, etc. Yielding to a local Gaussian description within limited areas, many real images in this regard are poorly represented as globally Gaussian objects . This is the reason for the poor transfer of boundaries in linear filtering.

The second feature of linear filtering is its optimality, as just mentioned, with the Gaussian nature of the noise. Usually, this condition is met by noise interference in images, therefore, when suppressing them, linear algorithms have high performance. However, one often has to deal with images distorted by other types of noise. One of them is impulse noise. When exposed to it, white and (and) black dots are observed on the image, randomly scattered around the frame. The use of linear filtering in this case is inefficient - each of the input pulses (essentially a delta function) gives a response in the form of a filter impulse response, and their combination contributes to the propagation of noise over the entire frame area.

A successful solution to these problems is the use of median filtering, proposed by J. Tukey in 1971 for the analysis of economic processes. The most comprehensive study of median filtering as applied to image processing is presented in the collection. Note that median filtering is a heuristic processing method; its algorithm is not a mathematical solution of a strictly formulated problem. Therefore, researchers pay great attention to the analysis of the efficiency of image processing based on it and comparison with other methods.

When applying the median filter (MF), each point of the frame is sequentially processed, resulting in a sequence of estimates. Conceptually, the processing at different points is independent (in this way, the MF is similar to a mask filter), but in order to speed it up, it is advisable to algorithmically use previously performed calculations at each step.

Median filtering uses a two-dimensional window (filter aperture), which usually has central symmetry, with its center located at the current filtering point. On fig. 3.10 shows two examples of the most commonly used window options in the form of a cross and in the form of a square. Aperture sizes are among the parameters that are optimized in the process of analyzing the effectiveness of the algorithm. The image samples that are within the window form the working sample of the current step.

Rice. 3.10. Examples of windows for median filtering

The two-dimensional nature of the window allows for essentially two-dimensional filtering, since data from both the current row and column, as well as from neighboring ones, are used to form an estimate. Denote the working sample as a one-dimensional array ; the number of its elements is equal to the size of the window, and their arrangement is arbitrary. Usually, windows with an odd number of points are used (this is automatically ensured when the aperture is centrally symmetric and when the central point itself enters into its composition). If you sort the sequence in ascending order, then its median will be the sample element that occupies a central position in this ordered sequence. The number thus obtained is the filtering product for the current point of the frame. It is clear that the result of such processing does not really depend on the sequence in which image elements are presented in the working sample. Let us introduce the formal notation of the described procedure in the form:

. (3.48)

Consider an example. Let's assume that the selection has the form: , and the element 250, located in its center, corresponds to the current filtering point (Fig. 3.10). A large brightness value at this point in the frame may be the result of impulse (dot) interference. In this case, the sample ordered in ascending order has the form (45,55,75,99,104,110,136,158,250), therefore, in accordance with the procedure (3.48), we obtain . We see that the influence of “neighbors” on the result of filtering at the current point led to the “ignoring” of the impulse burst of brightness, which should be considered as a filtering effect. If the impulse noise is not point, but covers some local area, then it can also be suppressed. This will happen if the size of this local area is less than half the size of the MF aperture. Therefore, to suppress impulse noise that affects local areas of the image, it is necessary to increase the size of the MF aperture.

From (3.48) it follows that the action of the MF consists in “ignoring” the extreme values ​​of the input sample - both positive and negative outliers. This principle of interference suppression can also be applied to reduce noise in the image. However, a study of noise suppression using median filtering shows that its effectiveness in solving this problem is lower than that of linear filtering.

The experimental results illustrating the operation of the MF are shown in Figs. 3.11. In the experiments, an MF was used, which has a square aperture with

side equal to 3. The left row shows the images distorted by noise, the right row shows the results of their median filtering. On fig. 3.11.a and fig. 3.11.c shows the original image distorted by impulse noise. When it was superimposed, a random number generator was used with a uniform distribution law over the interval, which generates independent random numbers at all points of the frame. The noise intensity was set by the probability of its occurrence at each point. If the condition was fulfilled for the random number formed at the point , then the brightness of the image at this point was replaced by the number 255 corresponding to the maximum brightness (white level). On fig. 3.11.a the action of impulse noise distorted 5% (=0.05), and in fig. 3.11.c - 10% of image elements. The results of processing indicate the almost complete suppression of interference in the first case and its significant attenuation in the second.

Rice. 3.11. Median Filtering Examples

Rice. 3.11.d shows an image distorted by independent Gaussian noise at a signal-to-noise ratio of dB, and fig. 3.11.e - the result of its filtering by the median filter. The conditions of this experiment make it possible to compare its results with the results of the linear filtering considered above. Table 3.1 provides data to enable such a comparison. For various filtering methods, this table gives the values ​​of the relative mean square errors and the noise reduction factor for the case when the signal-to-noise ratio at the filter input is -5 dB.

Table 3.1. Comparison of noise suppression efficiency in image filtering, dB

mask filter with optimal TO THEIR

mask filter with uniform TO THEIR

two-dimensional recurrent filter

2D Wiener filter

The two-dimensional Wiener filter has the highest efficiency, reducing the mean square of errors by a factor of 17. The median filter has the lowest efficiency among all considered filters, it corresponds to =5.86. However, this number indicates that even with its help it is possible to significantly reduce the level of noise in the image.

However, as mentioned above, and as shown in Fig. 3.11.e, median filtering smoothes the edges of the image to a lesser extent than any linear filtering. The mechanism of this phenomenon is very simple and consists in the following. Let us assume that the filter aperture is located near the border separating the light and dark areas of the image, while its center is located in the area of ​​the dark area. Then, most likely, the working sample will contain a larger number of elements with low brightness values, and, therefore, the median will be among those elements of the working sample that correspond to this area of ​​the image. The situation is reversed if the center of the aperture is shifted to a region of higher brightness. But this means that the MF is sensitive to changes in brightness.

Top Related Articles