0% found this document useful (0 votes)
76 views37 pages

Lect 10

Digital image processing techniques can be used to restore degraded images. Image restoration aims to reconstruct the original undistorted image by modeling the degradation process and applying the inverse. Common sources of image degradation include noise introduced during acquisition or transmission. Different types of noise can be modeled, such as Gaussian, salt and pepper, or uniform noise. Filters like mean, median, and order statistic filters can be applied to the degraded image to remove noise and restore the original content. The choice of filter depends on the characteristics of the noise degradation.

Uploaded by

ravi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views37 pages

Lect 10

Digital image processing techniques can be used to restore degraded images. Image restoration aims to reconstruct the original undistorted image by modeling the degradation process and applying the inverse. Common sources of image degradation include noise introduced during acquisition or transmission. Different types of noise can be modeled, such as Gaussian, salt and pepper, or uniform noise. Filters like mean, median, and order statistic filters can be applied to the degraded image to remove noise and restore the original content. The choice of filter depends on the characteristics of the noise degradation.

Uploaded by

ravi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Digital Image Processing

Lecture # 10
Image Restoration

1
WHAT IS IMAGE RESTORATION?
• The purpose of image restoration is to restore a
degraded/distorted image to its original content and quality
• Restoration attempts to reconstruct or recover an image that
has been degraded by using a priori knowledge of the
degradation phenomenon
• Restoration techniques are oriented toward modeling the
degradation and applying the inverse process in order to
recover the original image
• Image enhancement is largely a subjective process, while
image restoration is for the most part an objective process

2
WHAT IS IMAGE RESTORATION?

• Image enhancement: “improve” an image subjectively


• Image restoration: remove distortion from image in order to
go back to the “original” -> objective process

3
WHAT IS IMAGE RESTORATION?
• Image restoration attempts to restore
images that have been degraded
– Identify the degradation process and attempt
to reverse it
– Similar to image enhancement, but more
objective

4
Noise and Images
The sources of noise in digital
images arise during image
acquisition (digitization) and
transmission
– Imaging sensors can be affected
by ambient conditions
– Interference can be added
to an image during transmission
Noise Model
We can consider a noisy image to be modelled as
follows:
g ( x, y)  f ( x, y )   ( x, y)
where f(x, y) is the original image pixel, η(x, y) is the
noise term and g(x, y) is the resulting noisy pixel
If we can estimate the model the noise in an image is
based on this will help us to figure out how to restore
the image
Noise Models
There are many different Gaussian Rayleigh
models for the image
noise term η(x, y):
– Gaussian
• Most common model Erlang Exponential

– Rayleigh
– Erlang
– Exponential
Uniform
– Uniform Impulse

– Impulse
• Salt and pepper noise
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 Image
various models to this image

Histogram to go here

Histogram
Noise Example (cont…)

Gaussian Rayleigh Erlang


Noise Example (cont…)

Histogram to go here

Exponential Uniform Impulse


Filtering to Remove Noise
We can use spatial filters of different kinds to
remove different kinds of noise
The arithmetic mean filter is a very simple one and
is calculated as follows:
ˆf ( x, y)  1
 g ( s, t )
mn ( s ,t )S xy
This is implemented as the
simple smoothing filter
1/ 1/ 1/
9 9 9 Blurs the image to remove
1/ 1/ 1/ noise
9 9 9
1/ 1/ 1/
9 9 9
Noise Removal Examples

Image
Original Corrupted
Image By Gaussian
Noise

After A 3*3 After A 3*3


Arithmetic Geometric
Mean Filter Mean Filter
Mean Filters
• Geometric mean filter:

 d (r, c)
1
N2
Geometric Mean =
( r ,c )w

– 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).
Mean Filters

Image with pepper noise Result of geometric filter


Probability = .04 Mask size = 3
Mean Filters

Image with salt noise Result of geometric filter


Probability=.04 Mask size = 3
Mean Filters
• Harmonic mean filter:

N2
Harmonic Mean = 1

( r ,c )w d ( r, c )

– Works with gaussian noise.


– Retains detail better than arithmetic mean filter.
– Works well with pepper noise.
Mean Filters

Image with pepper noise Result of harmonic filter


Probability = .04 Mask size = 3
Mean Filters

Image with salt noise Result of harmonic filter


Probability=.04 Mask size = 3
Mean Filters
• Contra-harmonic mean filter:
 d ( r
( r ,c )w
, c ) R 1

Contra-Harmonic Mean =
 d ( r , c)
( r ,c )w
R

– Works for salt OR pepper noise, depending on the


filter order R.
– Negative R  Eliminate salt-type noise.
– Positive R  Eliminate pepper-type noise.
Mean Filters

Image with salt noise Result of contra-harmonic filter


Probability = .04 Mask size = 3; order = 0
Mean Filters

Result of contra-harmonic filter Result of contra-harmonic filter


Mask size = 3; order = -1 Mask size = 3; order = -5
Order Statistics Filters
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
Median Filter
Median Filter:
fˆ ( x, y)  median{g (s, t )}
( s ,t )S xy

Excellent at noise removal, without the


smoothing effects that can occur with other
smoothing filters
Particularly good when salt and pepper noise is
present
Examples
• A 4x4 grayscale image is given by
5 6 7 8 impulse?
0 6 7 8
5 6 15 8
impulse?
5 6 7 8

1) Filter the image with a 3x3 median filter, after zero-


padding at the image borders
0 0 0 0 0 0
5 6 7 8 0 5 6 7 8 0 median 0 5 6 0
0 6 7 8 zero-padding 0 0 6 7 8 0 filtering 5 6 7 7
5 6 15 8 0 5 6 15 8 0 5 6 7 7
5 6 7 8 0 5 6 7 8 0 0 5 6 0
0 0 0 0 0 0
Examples
2) Filter the image with a 3x3 median filter, after replicate-
padding at the image borders

5 5 6 7 8 8
5 6 7 8 replicate 5 5 6 7 8 8 median 5 6 7 8
0 6 7 8 -padding 0 0 6 7 8 8 filtering 5 6 7 8
5 6 15 8 5 5 6 15 8 8 5 6 7 8
5 6 7 8 5 5 6 7 8 8 5 6 7 8
5 5 6 7 8 8

impulse cleaned!
Median Filtering

26
Noise Removal Examples

Image Result of 1
Corrupted Pass With A
By Salt And 3*3 Median
Pepper Noise Filter

Result of 2 Result of 3
Passes With Passes With
A 3*3 Median A 3*3 Median
Filter Filter
Max and Min Filter
Max Filter:
fˆ ( x, y)  max {g (s, t )}
( s ,t )S xy

Min Filter:
fˆ ( x, y)  min {g ( s, t )}
( s ,t )S xy

Max filter is good for pepper noise and min is


good for salt noise
Noise Removal Examples (cont…)

Image Image
Corrupted Corrupted
By Pepper By Salt
Noise Noise

Result Of Result Of
Filtering Filtering
Above Above
With A 3*3 With A 3*3
Max Filter Min Filter
Alpha-Trimmed Mean Filter
Alpha-Trimmed Mean Filter:
1
fˆ ( x, y)   g r ( s, t )
mn  d ( s ,t )S xy
Alpha-Trimmed Mean Filter
• Alpha-Trimmed Mean Filter:
1
fˆ ( x, y)   g r ( s, t )
mn  d ( s ,t )S xy
• We can delete the d/2 lowest and d/2 highest grey levels
• So gr(s, t) represents the remaining mn – d pixels
• If d =0, the filter is reduced to arithmetic mean
• If d= mn – 1, the filter become median filter
• For other values, the filter is useful in situation involving
multiple types of noise
– Combination of salt-and-pepper and Gaussian noise
Noise Removal Examples (cont…)
Image Image Further
Corrupted Corrupted
By Uniform By Salt and
Noise Pepper Noise

Filtered By Filtered By
5*5 Arithmetic 5*5 Geometric
Mean Filter Mean Filter

Filtered By Filtered By
5*5 Median 5*5 Alpha-Trimmed
Filter Mean Filter
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.
Order Filters
• Midpoint filter:
– Average of the maximum and minimum within the
window.
– Useful for removing gaussian and uniform noise.

I1  I N 2
Midpoint =
2
Order Filters

Image with gaussian noise. Result of midpoint filter


Variance = 300, mean = 0 Mask size = 3
Readings from Book (3rd Edn.)

• Image Restoration (Chapter-5)

• Reading Assignment
• Adaptive Filters
• Adaptive Median Filtering
Acknowledgements
 Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2002
 Peters, Richard Alan, II, Lectures on Image Processing, Vanderbilt University, Nashville, TN, April
Material in these slides has been taken from, the following resources

2008
 Brian Mac Namee, Digitial Image Processing, School of Computing, Dublin Institute of Technology
 Computer Vision for Computer Graphics, Mark Borg

37

You might also like