Loading in 2 Seconds...

Digital Image Processing Image Restoration Dr. Ziya Telatar Ankara University

Loading in 2 Seconds...

- 308 Views
- Uploaded on

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

**Digital Image Processing**Image Restoration Dr. Ziya Telatar Ankara University**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**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.**S**f(x,y) g(x,y) h(x,y) n(x,y) Degradation Model: g = h*f + n Degradation Model**Restoration Model**Degradation Model Restoration Filter f(x,y) f(x,y) Unconstrained Constrained • Inverse Filter • Pseudo-inverse Filter • Cepstrum • Wiener Filter**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)**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**Noise Models (cont.)**Exponential noise Uniform noise Impulse (salt & pepper) noise**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.**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**Image Degradation with Additive Noise**Degraded images Original image Histogram (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.**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.**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.**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.**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.**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:**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.**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.**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**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.**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**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.**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.**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.**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.**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**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**Max and Min Filter**• Max Filter: • Min Filter: • Max filter is good for pepper noise and min is good for salt noise**Midpoint Filter**• Midpoint Filter: • Good for random Gaussian and uniform noise**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**Order-Statistics Filters**Median filter Max filter Reduce “dark” noise (pepper noise) Min filter Reduce “bright” noise (salt noise) Midpoint filter**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.**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.**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.**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.**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.**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**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**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:**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:**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.**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**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**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.**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**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!**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.**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.**Estimation by Modeling: Motion Blurring**Assume that camera velocity is The blurred image is obtained by where T = exposure time.

Download Presentation

Connecting to Server..