1 / 72

Digital Image Processing Image Restoration Dr. Ziya Telatar Ankara University

Digital Image Processing Image Restoration Dr. Ziya Telatar Ankara University. D igital I mage P rocessing : Details. Image Preprocessing. Restoration. Enhancement. Inverse filtering Blind Deconvolution Wiener filtering Cepstrum Least Squares Regularization Tech. ............

evangelia
Download Presentation

Digital Image Processing Image Restoration Dr. Ziya Telatar Ankara University

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. Digital Image Processing Image Restoration Dr. Ziya Telatar Ankara University

  2. Digital Image Processing: Details

  3. Image Preprocessing Restoration Enhancement • Inverse filtering • Blind Deconvolution • Wiener filtering • Cepstrum • Least Squares • Regularization Tech. • ............ • ............ Spectral Domain Spatial Domain • Filtering • >>fft2/ifft2 • >>fftshift • Point Processing • >>imadjust • >>histeq • Spatial filtering • >>filter2

  4. Concept of Image Restoration Image restoration is to restore a degraded image back to the original image whileimage enhancement is to manipulate the image so that it is suitable for a specific application. Degradation model: whereh(x,y)is a system thatcauses image distortion and h(x,y) is noise.

  5. S f(x,y) g(x,y) h(x,y) n(x,y) Degradation Model: g = h*f + n Degradation Model

  6. Restoration Model Degradation Model Restoration Filter f(x,y) f(x,y) Unconstrained Constrained • Inverse Filter • Pseudo-inverse Filter • Cepstrum • Wiener Filter

  7. f(x,y) Build degradation model f(x,y) Analyze using algebraic techniques Formulate restoration algorithms Implement using Fourier transforms Approach g = h*f + n g = Hf + n W -1g = DW -1f + W -1n f = H -1g F(u,v) = G(u,v)/H(u,v)

  8. Noise Models Noise cannot be predicted but can be approximately described in statistical way using the probability density function (PDF) Gaussian noise: Rayleigh noise Erlang (Gamma) noise

  9. Noise Models (cont.) Exponential noise Uniform noise Impulse (salt & pepper) noise

  10. PDF: Statistical Way to Describe Noise PDF tells how much each z value occurs. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  11. Histogram to go here Noise Example • The test pattern to the right is ideal for demonstrating the addition of noise • The following slides will show the result of adding noise based on various models to this image Image Histogram

  12. Image Degradation with Additive Noise Degraded images Original image Histogram (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  13. Image Degradation with Additive Noise (cont.) Degraded images Original image Histogram (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  14. Periodic Noise Periodic noise looks like dots In the frequency domain (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  15. Estimation of Noise We cannot use the image histogram to estimate noise PDF. It is better to use the histogram of one area of an image that has constant intensity to estimate noise PDF. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  16. Periodic Noise Reduction by Freq. Domain Filtering Degraded image DFT Periodic noise can be reduced by setting frequency components corresponding to noise to zero. Band reject filter Restored image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  17. Band Reject Filters • Removing periodic noise form an image involves removing a particular range of frequencies from that image • Band reject filters can be used for this purpose • An ideal band reject filter is given as follows:

  18. Band Reject Filters Use to eliminate frequency components in some bands Periodic noise from the previous slide that is Filtered out. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  19. Notch Reject Filters A notch reject filter is used to eliminate some frequency components. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  20. Notch Reject Filter: Notch filter (freq. Domain) Degraded image DFT (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition. Noise Restored image

  21. Example: Image Degraded by Periodic Noise Degraded image DFT (no shift) DFT of noise Noise Restored image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  22. Mean Filters Degradation model: To remove this part Arithmetic mean filter or moving average filter (from Chapter 3) Geometric mean filter mn = size of moving window

  23. Geometric Mean Filter: Example Image corrupted by AWGN Original image Image obtained using a 3x3 geometric mean filter Image obtained using a 3x3 arithmetic mean filter AWGN: Additive White Gaussian Noise (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  24. Harmonic and Contraharmonic Filters Harmonic mean filter Works well for salt noise but fails for pepper noise Contraharmonic mean filter mn = size of moving window Positive Q is suitable for eliminating pepper noise. Negative Q is suitable for eliminating salt noise. Q = the filter order For Q = 0, the filter reduces to an arithmetic mean filter. For Q = -1, the filter reduces to a harmonic mean filter.

  25. Contraharmonic Filters: Example Image corrupted by pepper noise with prob. = 0.1 Image corrupted by salt noise with prob. = 0.1 Image obtained using a 3x3 contra- harmonic mean filter With Q = 1.5 Image obtained using a 3x3 contra- harmonic mean filter With Q=-1.5 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  26. Contraharmonic Filters: Incorrect Use Example Image corrupted by pepper noise with prob. = 0.1 Image corrupted by salt noise with prob. = 0.1 Image obtained using a 3x3 contra- harmonic mean filter With Q=-1.5 Image obtained using a 3x3 contra- harmonic mean filter With Q=1.5 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  27. Order-Statistic Filters: Revisit Original image subimage Statistic parameters Mean, Median, Mode, Min, Max, Etc. Moving window • Spatial filters that are based on ordering the pixel values that make up the neighbourhood operated on by the filter • Useful spatial filters include • Median filter • Max and min filter • Midpoint filter • Alpha trimmed mean filter Output image

  28. Median Filter • Median Filter: • Excellent at noise removal, without the smoothing effects that can occur with other smoothing filters • Particularly good when salt and pepper noise is present

  29. Max and Min Filter • Max Filter: • Min Filter: • Max filter is good for pepper noise and min is good for salt noise

  30. Midpoint Filter • Midpoint Filter: • Good for random Gaussian and uniform noise

  31. Alpha-Trimmed Mean Filter • Alpha-Trimmed Mean Filter: • We can delete the d/2 lowest and d/2 highest grey levels • So gr(s, t) represents the remaining mn – d pixels

  32. Order-Statistics Filters Median filter Max filter Reduce “dark” noise (pepper noise) Min filter Reduce “bright” noise (salt noise) Midpoint filter

  33. Median Filter : How it works A median filter is good for removing impulse, isolated noise Salt noise Pepper noise Median Sorted array Moving window Degraded image Salt noise Filter output Pepper noise Normally, impulse noise has high magnitude and is isolated. When we sort pixels in the moving window, noise pixels are usually at the ends of the array. Therefore, it’s rare that the noise pixel will be a median value.

  34. Median Filter : Example 1 2 Image corrupted by salt-and-pepper noise with pa=pb= 0.1 3 4 Images obtained using a 3x3 median filter (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  35. Max and Min Filters: Example Image corrupted by pepper noise with prob. = 0.1 Image corrupted by salt noise with prob. = 0.1 Image obtained using a 3x3 max filter Image obtained using a 3x3 min filter (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  36. Alpha-trimmed Mean Filter Formula: where gr(s,t) represent the remaining mn-d pixels after removing the d/2 highest and d/2 lowest values of g(s,t). This filter is useful in situations involving multiple types of noise such as a combination of salt-and-pepper and Gaussian noise.

  37. Alpha-trimmed Mean Filter: Example 1 2 Image additionally corrupted by additive salt-and- pepper noise Image corrupted by additive uniform noise Image obtained using a 5x5 geometric mean filter 2 Image obtained using a 5x5 arithmetic mean filter 2 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  38. Alpha-trimmed Mean Filter: Example (cont.) 1 2 Image additionally corrupted by additive salt-and- pepper noise Image corrupted by additive uniform noise Image obtained using a 5x5 alpha- trimmed mean filter with d = 5 2 Image obtained using a 5x5 median filter 2

  39. Alpha-trimmed Mean Filter: Example (cont.) Image obtained using a 5x5 arithmetic mean filter Image obtained using a 5x5 geometric mean filter Image obtained using a 5x5 alpha- trimmed mean filter with d = 5 Image obtained using a 5x5 median filter

  40. Adaptive Filter General concept: • Filter behavior depends on statistical characteristics of local areas • inside mxn moving window • More complex but superior performance compared with “fixed” • filters Statistical characteristics: Noise variance: Local mean: Local variance:

  41. Adaptive, Local Noise Reduction Filter Purpose:want to preserve edges Concept: • 1. If sh2 is zero,  No noise • the filter should return g(x,y) because g(x,y) = f(x,y) • 2. If sL2 is high relative to sh2,  Edges (should be preserved), • the filter should return the value close to g(x,y) • 3. If sL2 = sh2,  Areas inside objects • the filter should return the arithmetic mean value mL Formula:

  42. Adaptive Noise Reduction Filter: Example Image corrupted by additive Gaussian noise with zero mean and s2=1000 Image obtained using a 7x7 arithmetic mean filter Image obtained using a 7x7 adaptive noise reduction filter Image obtained using a 7x7 geometric mean filter (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  43. Adaptive Median Filter Purpose:want to remove impulse noise while preserving edges Algorithm: Level A: A1= zmedian – zmin A2= zmedian – zmax If A1 > 0 and A2 < 0, goto level B Else increase window size If window size <= Smax repeat level A Else return zxy Level B: B1= zxy – zmin B2= zxy – zmax If B1 > 0 and B2 < 0, return zxy Else return zmedian where zmin = minimum gray level value in Sxy zmax = maximum gray level value in Sxy zmedian = median of gray levels in Sxy zxy= gray level value at pixel (x,y) Smax = maximum allowed size of Sxy

  44. Adaptive Median Filter: How it works Level A: A1= zmedian – zmin A2= zmedian – zmax Else  Window is not big enough increase window size If window size <= Smax repeat level A Else return zxy  zmedian is not an impulse B1= zxy – zmin B2= zxy – zmax If B1 > 0 and B2 < 0,  zxy is not an impulse return zxy to preserve original details Else return zmedian  to remove impulse Determine whether zmedian is an impulse or not If A1 > 0 and A2 < 0, goto level B Level B: Determine whether zxy is an impulse or not

  45. Adaptive Median Filter: Example Image corrupted by salt-and-pepper noise with pa=pb= 0.25 Image obtained using a 7x7 median filter Image obtained using an adaptive median filter with Smax = 7 More small details are preserved (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  46. Estimation of Degradation Model Degradation model: or Purpose: to estimateh(x,y)orH(u,v) Why? If we know exactly h(x,y), regardless of noise, we can do deconvolution to get f(x,y) back from g(x,y). Methods: 1. Estimation by Image Observation 2. Estimation by Experiment 3. Estimation by Modeling

  47. Estimation by Image Observation Original image (unknown) Degraded image f(x,y) f(x,y)*h(x,y) g(x,y) Observation Subimage DFT Estimated Transfer function Restoration process by estimation DFT Reconstructed Subimage This case is used when we know only g(x,y) and cannot repeat the experiment!

  48. Estimation by Experiment Used when we have the same equipment set up and can repeat the experiment. Response image from the system Input impulse image System H( ) DFT DFT (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  49. Estimation by Modeling Used when we know physical mechanism underlying the image formation process that can be expressed mathematically. Example: Original image Severe turbulence Atmospheric Turbulence model k = 0.0025 Mild turbulence Low turbulence k = 0.001 k = 0.00025 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  50. Estimation by Modeling: Motion Blurring Assume that camera velocity is The blurred image is obtained by where T = exposure time.

More Related