1 / 48

Chapter 3: Image Restoration

Chapter 3: Image Restoration. Noise Removal Using Spatial Filters. Overview. Spatial filters can be used to remove various types of noise in digital images. These spatial filters typically operate on small neighborhood, between 3x3 to 11x11.

amory
Download Presentation

Chapter 3: Image Restoration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3: Image Restoration Noise Removal Using Spatial Filters

  2. Overview • Spatial filters can be used to remove various types of noise in digital images. • These spatial filters typically operate on small neighborhood, between 3x3 to 11x11. • We will use the degradation model defined before, but we assume that h(r,c) causes no degradation.

  3. Overview • Therefore, corruption on the image is only caused by additive noise, n(r,c). • d(r,c) = I(r,c) + n(r,c) • There are two primary categories of spatial filters for noise removal. • Order filters: arrange the pixels from smallest to largest and select the “correct” value. • Mean filters: calculate the average value.

  4. Overview • The mean filters work best with gaussian or uniform noise. • The order filters work best with salt-and-pepper, negative exponential, or Rayleigh noise. • The mean filters are essentially low pass filters: • They tend to blur the edges or details.

  5. Overview • The order filters are nonlinear filters: • The results are sometimes unpredictable. • In general, there is a tradeoff between preservation of image detail and noise elimination. • In practical applications, a good approach is to use an adaptive filter (a filter that can adapt itself to the underlying pixel values).

  6. Order Filters • Order filters are based on a specific type of image statistics called order statistics. • Order statistics is a technique that arranges all the pixels in sequential order, based on gray-level value. • The placement of the value within this ordered set is referred to as the rank.

  7. Order Filters • Given an NxN window, the pixel values can be ordered from smallest to largest as follows: • I1 I2 I3..... IN2 • Where {I1,I2,I3,.....,IN2} are the gray-level values of the subset of pixels in the image, that are in the NxN window. • Different types of order filters select different values from the ordered pixel list.

  8. Order Filters • Median filter: • Select the middle pixel value from the ordered set. • Used to remove salt-and-pepper noise. • Maximum filter: • Select the highest pixel value from the ordered set. • Remove pepper-type noise.

  9. Order Filters • Minimum filter: • Select the lowest pixel value from the ordered set. • Remove salt-type noise. • As the size of the window gets bigger, the more information loss occurs. • With windows larger than about 5x5, the image acquires an artificial, “painted”, effect.

  10. Order Filters Minimum Filter Image with salt noise Probability = .04 Result of minimum filtering Mask 3 x 3

  11. Order Filters Minimum filtering Mask 5 x 5 Minimum filtering Mask 9 x 9

  12. Order Filters Maximum Filter Maximum filtering Mask 3 x 3 Image with pepper noise Probability = .04

  13. Order Filters Maximum filtering Mask 9 x 9 Maximum filtering Mask 5 x 5

  14. Order Filters • Order filters can also be defined to select a specific pixel rank within the ordered set. • For example, we may find the second highest value is the better choice than the maximum value for certain pepper noise. • This type of ordered selection is application specific. • Minimum filter tend to darken the image and maximum filter tend to brighten the image.

  15. Midpoint = Order Filters • Midpoint filter: • Average of the maximum and minimum within the window. • Useful for removing gaussian and uniform noise.

  16. Order Filters Image with gaussian noise. Variance = 300, mean = 0 Result of midpoint filter Mask size = 3

  17. Order Filters Result of midpoint filter Mask size = 3 Image with uniform noise. Variance = 300, mean = 0

  18. Alpha-trimmed mean = Order Filters • Alpha-trimmed mean filter: • The average of the pixel values within the window, but with some endpoint-ranked values excluded. • T is the number of pixels excluded at each end of the ordered set

  19. Order Filters • The alpha-trimmed mean filter ranges from a mean to median filter, depending on the value selected for the T parameter. • If T = 0,  mean filter. • If T = (N2 – 1) / 2,  median filter. • The alpha-trimmed mean filter is useful for images containing multiple types of noise. • Example: Gaussian + salt-and-pepper.

  20. Order Filters Image with gaussian noise Variance = 200, mean = 0. Salt-and-pepper noise probability = 0.02 Result of alpha-trimmed mean filter Mask size = 3 Trim size = 0

  21. Order Filters Result of alpha-trimmed mean filter Mask size = 3 Trim size = 1 Result of alpha-trimmed mean filter Mask size = 3 Trim size = 4

  22. Mean Filters • The mean filters function by finding some form of an average within the NxN window. • The most basic of these filters is the arithmetic mean filter. • This filter mitigates the noise effect, but at the same time tend to blur the image. • The blurring effect is not desirable, and therefore other mean filters are designed to minimize this loss of detail information.

  23. Arithmetic Mean = Mean Filters • Arithmetic mean filter: • Find the arithmetic average of the pixel values in the window. • Smooth out local variations in an image. • Tend to blur the image. • Works best with gaussian and uniform noise.

  24. Mean Filters Image with gaussian noise Variance=300, mean = 0 Result of arithmetic mean filter Mask size = 3

  25. Mean Filters Result of arithmetic mean filter Mask size = 5 Result of arithmetic mean filter Mask size = 9

  26. Mean Filters Image with gamma noise Variance=300, mean = 0 Result of arithmetic mean filter Mask size = 3

  27. Mean Filters Result of arithmetic mean filter Mask size = 5 Result of arithmetic mean filter Mask size = 9

  28. Contra-Harmonic Mean = Mean Filters • Contra-harmonic mean filter: • Works for salt OR pepper noise, depending on the filter order R. • Negative R  Eliminate salt-type noise. • Positive R  Eliminate pepper-type noise.

  29. Mean Filters Image with salt noise Probability = .04 Result of contra-harmonic filter Mask size = 3; order = 0

  30. Mean Filters Result of contra-harmonic filter Mask size = 3; order = -1 Result of contra-harmonic filter Mask size = 3; order = -5

  31. Mean Filters Image with pepper noise Probability = .04 Result of contra-harmonic filter Mask size = 3; order = 0

  32. Mean Filters Result of contra harmonic filter Mask size = 3; order = +5 Result of contra harmonic filter Mask size = 3; order = +1

  33. Geometric Mean = Mean Filters • Geometric mean filter: • Works best with gaussian noise. • Retains detail better than arithmetic mean filter. • Ineffective in the presence of pepper noise (if very low values present in the window, the equation will return a very small number).

  34. Mean Filters Image with gaussian noise Variance = 300, mean = 0 Result of geometric filter Mask size = 3

  35. Mean Filters Image with pepper noise Probability = .04 Result of geometric filter Mask size = 3

  36. Mean Filters Image with salt noise Probability=.04 Result of geometric filter Mask size = 3

  37. Harmonic Mean = Mean Filters • Harmonic mean filter: • Works with gaussian noise. • Retains detail better than arithmetic mean filter. • Works well with pepper noise.

  38. Mean Filters Image with pepper noise Probability = .04 Result of harmonic filter Mask size = 3

  39. Mean Filters Image with salt noise Probability=.04 Result of harmonic filter Mask size = 3

  40. Yp Mean = Mean Filters • Yp mean filter: • Remove salt noise for negative values of P. • Remove pepper noise for positive values of P.

  41. Adaptive Filters • An adaptive filter alters its basic behavior as the image is processed. • It may act like a mean filter on some parts of the image and a median filter on other parts of the image. • The typical character used to determine the filter behavior are the local image characteristics. • Measured by local gray-level statistics.

  42. MMSE = Adaptive Filters • The minimum mean-square error (MMSE) filter is a good example of an adaptive filter. • σn2 = noise variance. • σl2 = local variance (in the window). • ml = local mean (average in the window).

  43. Adaptive Filters • MMSE filter exhibits varying behavior based on local image statistics: • No noise  variance = 0  equation returns original image. • Regions with fairly constant value (no edge/details)  noise variance == local variance  equation reduces to mean filter. • Regions with high details (edges)  local variance >> noise variance  equation returns values close to original image.

  44. Adaptive Filters • In general, MMSE filter modifies the image based on the noise to local variance ratio. • High ratio implies the existence of noise in the window, and therefore the filter returns primarily the local average to reduce the noise. • Low ratio implies high local detail, therefore the filter returns more of the original unfiltered image to preserve the detail.

  45. Adaptive Filters • By being able to adapt itself to the local image statistics, the MMSE filter can preserve the details while at the same time remove the noise. • MMSE filter works best with gaussian or uniform noise, and can perform better compared to the other filters discussed before.

  46. Adaptive Filters Image with gaussian noise Variance=300, mean = 0 Original Image

  47. Adaptive Filters Result of MMSE Mask size = 5 Result of MMSE Mask size = 3

  48. Adaptive Filters Result of MMSE Mask size = 9 Result of MMSE Mask size = 7

More Related