# rank filtering from noise image rank filtering mask (7 x 7 ) rank 4

Post on 18-Dec-2015

213 views

Category:

## Documents

1 download

Tags:

• #### maximum filtering

Embed Size (px)

TRANSCRIPT

• Slide 1
• Rank filtering From noise image Rank filtering mask (7 x 7 ) rank 4
• Slide 2
• Median filtering In order to perform median filtering in a neghborhod of a pixel [i.j]: 1.Sort the pixels into ascending order by gray level. 2.Select the value of the middle pixel as the new value for pixel [i.j] Mean Filter size =7 x 7 Median Filter size =7 x 7 This filters are excellent for impulse type of noise
• Slide 3
• Median filtering Figure 1 Calculating the median value of a pixel neighborhood. As can be seen, the central pixel value of 150 is rather unrepresentative of the surrounding pixels and is replaced with the median value: 124. A 33 square neighborhood is used here --- larger neighborhoods will produce more severe smoothing.
• Slide 4
• Advantages of median filter By calculating the median value of a neighborhood rather than the mean filter, the median filter has two main advantages over the mean filter: 1.The median is a more robust average than the mean and so a single very unrepresentative pixel in a neighborhood will not affect the median value significantly. 2. Since the median value must actually be the value of one of the pixels in the neighborhood, the median filter does not create new unrealistic pixel values when the filter straddles a edge. For this reason the median filter is much better at preserving sharp edges than the mean filter. 1. One of the major problems with the median filter is that it is relatively expensive and complex to compute. To find the median it is necessary to sort all the values in the neighborhood into numerical order and this is relatively slow, even with fast sorting algorithms such as quick sort. Disadvantages of median filter 2. Any structure that occupies less than half of the filters neighborhood will tend to be eliminated
• Slide 5
• Median filtering - Applications The image has been corrupted with higher levels (i.e. p=5% that a bit is flipped) of salt and pepper noise
• Slide 6
• Median filtering - Applications After smoothing with a 33 filter, most of the noise has been eliminated If we smooth the noisy image with a larger median filter, e.g. 77, all the noisy pixels disappear, as shown in this image
• Slide 7
• Median filtering - Applications Note that the image is beginning to look a bit `blotchy', as graylevel regions are mapped together. Alternatively, we can pass a 33 median filter over the image three times in order to remove all the noise with less loss of detail
• Slide 8
• The maximum filter selects the largest value within of pixel values, whereas the minimum filter selects the smallest value. Minimum filtering ( mask size =3 x 3) Minimum filtering causes the darker regions of an image to swell in size and dominate the lighter regions ( mask size =7 x 7)
• Slide 9
• Result from Maximum filtering with mask (3 x 3) Result from Maximum filtering with mask (7 x 7)
• Slide 10
• Conservative smoothing - How It Works Like most noise filters, conservative smoothing operates on the assumption that noise has a high spatial frequency and, therefore, can be attenuated by a local operation which makes each pixel's intensity roughly consistent with those of its nearest neighbors. However, whereas mean filtering accomplishes this by averaging local intensities and median filtering by a non-linear rank selection technique, conservative smoothing simply ensures that each pixel's intensity is bounded within the range of intensities defined by its neighbors. This is accomplished by a procedure which first finds the minimum and maximum intensity values of all the pixels within a windowed region around the pixel in question.
• Slide 11
• Conservative smoothing - How It Works If the intensity of the central pixel lies within the intensity range spread of its neighbors, it is passed on to the output image unchanged. However, if the central pixel intensity is greater than the maximum value, it is set equal to the maximum value; if the central pixel intensity is less than the minimum value, it is set equal to the minimum value. Figure illustrates this idea. Figure :Conservatively smoothing a local pixel neighborhood. The central pixel of this figure contains an intensity spike (intensity value 150). In this case, conservative smoothing replaces it with the maximum intensity value (127) selected amongst those of its 8 nearest neighbors.
• Slide 12
• Conservative smoothing - How It Works If we compare the result of conservative smoothing on the image segment of Figure 1 with the result obtained by mean filtering and median filtering, we see that it produces a more subtle effect than both the former (whose central pixel value would become 125) and the latter (124). Furthermore, conservative smoothing is less corrupting at image edges than either of these noise suppression filters.
• Slide 13
• Conservative smoothing - Applications The real utility of conservative smoothing (and median filtering) is in suppressing salt and pepper, or impulse, noise. A linear filter cannot totally eliminate impulse noise, as a single pixel which acts as an intensity spike can contribute significantly to the weighted average of the filter. Non-linear filters can be robust to this type of noise because single outlier pixel intensities can be eliminated entirely. Conservative smoothing works well for low levels of salt and pepper noise. However, when the image has been corrupted such that more than 1 pixel in the local neighborhood has been effected, conservative smoothing is less successful. For example, smoothing the image which has been corrupted by 1% salt and pepper noise (i.e. bits have been flipped with probability 1%).
• Slide 14
• Conservative smoothing - Applications After mean filtering, the image is still noisy, as shown in (a) After median filtering, all noise is suppressed, as shown in (b) Conservative smoothing produces an image which still contains some noise in places where the pixel neighborhoods were contaminated by more than one intensity spike.
• Slide 15
• Conservative smoothing - Applications However, no image detail has been lost; e.g. notice how conservative smoothing is the only operator which preserved the reflection in the subject's eye.
• Slide 16
• They are hybrid because they rely on ordering the pixel values, but they are then calculated by an averaging process. The midpoint filter is the average of the maximum and minimum within the window, as follows: Hybrid filters Ordered set Midpoint = The midpoint filter is most useful for gaussian and uniform noise. The alpha trimmed mean filter is the average of the pixel values within the window, but with some of the endpoint ranked values excluded. Ordered set Alpha trimmed mean = Where is the number of pixel values removed from each end of the list, and can range from 0 to (N 2 -1)/2. When =0, no values are removed from the list and the filter behaves as a mean filter. If =(N 2 -1)/2, the equation becomes a median filter.
• Slide 17
• Adaptive Filter where 2 n is an estimate of noise variance, 2 (x,y) is the grey level variance computed for the neighborhood centered on x,y and f_(x,y) is the mean grey level in the neighborhood. In homogeneus regions of an image, noise will be the sole cause of variations in grey level ( 2 n = 2 (x,y)) and g(x,y) = f_(x,y) This filter compute local grey level statistics within the neighborhood of a pixel and base their behavior on this information. For example:
• Slide 18
• Average and Variance Value The most common method is the average or mean. To obtain an average value, add up all your data values and divide by the number of data items. If X 01 is the length of your first maple leave, X 02 the length of your second maple leave, etc., then the average maple leaf length is: (X 01 +X 02 +X 03 + X 04 +X 05 +X 06 + X 07 +X 08 +X 09 + X 10 )/10 = X avg The most common way to describe the range of variation is standard deviation (usually denoted by the Greek letter sigma: ). The standard deviation is simply the square root of the variance The result is the variance; take its square root to get the standard deviation. variance = ( (X 01 -X avg ) 2 + (X 02 -X avg ) 2 + (X 03 -X avg ) 2 + + (X 10 - X avg ) 2 )/9
• Slide 19
• Line Detection The line detection operator consists of a convolution kernel tuned to detect the presence of lines of a particular width n, at a particular orientation . Figure shows a collection of four such kernels, which each respond to lines of single pixel width at the particular orientation shown Figure :Four line detection kernels which respond maximally to horizontal, vertical and oblique (+45 and - 45 degree) single pixel wide lines. If Ri denotes the response of kernel i, we can apply each of these kernels across an image, and for any particular point, if Ri>Rj for all j i that point is more likely to contain a line whose orientation (and width) corresponds to that of kernel i.
• Slide 20
• Line Detection- Guidelines for Use The result of applying the line detection operator, using the horizontal convolution kernel shown in Figure 1.a, is There are two points of interest to note here 1.Notice that, because of way that the oblique lines (and some `vertical' ends of the horizontal bars) are represented on a square pixel grid, e.g.
• Slide 21
• Line Detection- Guidelines for Use 2. On an image such as this one, where

Recommended