0% found this document useful (0 votes)
15 views42 pages

Lecture 1.2.6-Image Noise and Restorations

Uploaded by

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

Lecture 1.2.6-Image Noise and Restorations

Uploaded by

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

University Institute of Engineering

DEPARTMENT OF COMPUTER SCIENCE


& ENGINEERING
Bachelor of Engineering (Computer Science & Engineering)
Subject Name : Computer Vision
Subject Code: 21CSH/ITH- 422
Topic: Lecture-1.3.4
Lecture-Image Noise and Restorations
By : Er. Abha Agrawal

DISCOVER . LEARN . EMPOWER


Syllabus
• UNIT-1: Introduction to Image Processing

• CHAPTER-1: Introduction to Image Processing:


• Digital Image representation, Sampling & Quantization, Steps in image Processing,
Image acquisition, colour image representation.

• CHAPTER-2: Image Transformation, Filtering & Restoration:


• Intensity transforms functions, histogram processing, Spatial filtering, fourier transforms
and its properties, frequency domain filters, Image Noise and Restorations.

2
Image Restoration and
Reconstruction
Things which we see are not by themselves what we
see…
It remains completely unknown to us what the objects
may be by themselves and apart from the receptivity of
our senses. We know nothing but our manner of
perceiving them.

Immanuel Kant
Contents
In this lecture we will look at image restoration techniques used
for noise removal
• What is image restoration?
• Noise and images
• Noise models
• Noise removal using spatial domain filtering
• Noise removal using frequency domain filtering
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
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 noise model we can figure out how to restore the image
Noise Models (cont...)
Images taken from Gonzalez & Woods, Digital Image Processing (2002) There are many different models
Gaussian Rayleigh
for the image
noise term η(x, y):
• Gaussian
• Most common model
Erlang Exponential
• Rayleigh
• Erlang (Gamma)
• 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
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

The following slides will show the result of


adding noise based on various models to this
image

Image

Histogram to go here

Histogram
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Gaussian
Rayleigh
Erlang
Noise Example (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Exponential
Uniform
Impulse
Noise Example (cont…)

Histogram to go here
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 )  as1the
This is implemented
simple smoothing filter  g
mn ( s ,t )S xy
( s , t )
It blurs the image.
1
/9 1
/9 1
/9
1
/9 1
/9 1
/9
1
/9 1
/9 1
/9
Other Means
There are different kinds of mean filters all of which exhibit slightly different
behaviour:
• Geometric Mean
• Harmonic Mean
• Contraharmonic Mean
Other Means (cont…)
Geometric Mean:
1
  mn
fˆ ( x, y )   g ( s, t )
 ( s ,t )S xy 
Achieves similar smoothing to the arithmetic mean, but tends to lose less image
detail.
Other Means (cont…)
Harmonic Mean:
mn
fˆ ( x, y ) 
1

( s ,t )S xy g ( s, t )
Works well for salt noise, but fails for pepper noise.
Also does well for other kinds of noise such as Gaussian noise.
Other Means (cont…)
Contraharmonic Mean:
 g ( s, t ) Q 1

ˆf ( x, y )  ( s ,t )S xy
 g ( s, t )
( s ,t )S xy
Q

Q is the order of the filter.


Positive values of Q eliminate pepper noise.
Negative values of Q eliminate salt noise.
It cannot eliminate both simultaneously.
Noise Removal Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image
Original image corrupted
by Gaussian
noise

3x3
Geometric
3x3 Mean Filter
Arithmetic (less blurring
Mean Filter than AMF, the
image is
sharper)
Noise Removal Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by
pepper noise at 0.1

Filtering with a 3x3


Contraharmonic Filter
with Q=1.5
Noise Removal Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by
salt noise at 0.1

Filtering with a 3x3


Contraharmonic Filter
with Q=-1.5
Contraharmonic Filter: Here Be Dragons
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Choosing the wrong value for Q when using the contraharmonic filter can have
drastic results

Pepper noise filtered by Salt noise filtered by a


a 3x3 CF with Q=-1.5 3x3 CF with Q=1.5
Order Statistics Filters
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Spatial filters based on ordering the pixel values that make up the neighbourhood
defined by the filter support.

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.


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 filter is good for salt noise.
Midpoint Filter
Midpoint Filter:

ˆf ( x, y )  1  max {g ( s, t )}  min {g ( s, t )}


2  ( s ,t )S xy ( s ,t )S xy 

Good for random Gaussian and uniform noise.


Alpha-Trimmed Mean Filter
Alpha-Trimmed Mean Filter:
1
fˆ ( x, y )   g ( s, t ) r
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.
Noise Removal Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Result of 1
corrupted pass with a
by Salt And 3x3 Median
Pepper noise Filter
at 0.2

Result of 2 Result of 3
passes with passes with
a 3x3 Median a 3*3 Median
Filter Filter

Repeated passes remove the noise better but also blur the image
Noise Removal Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Image
corrupted corrupted
by Pepper by Salt
noise noise

Filtering Filtering
above above
with a 3x3 with a 3x3
Max Filter Min Filter
Noise Removal Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002) Image Image further
corrupted corrupted
by uniform by Salt and
noise Pepper noise

Filtering by a Filtering by a
5x5 Arithmetic 5x5 Geometric
Mean Filter Mean Filter

Filtering by a Filtering by a
5x5 Median 5x5 Alpha-Trimmed
Filter Mean Filter (d=5)
Adaptive Filters
The filters discussed so far are applied to an entire image without any regard for
how image characteristics vary from one point to another.
The behaviour of adaptive filters changes depending on the characteristics of the
image inside the filter region.
We will take a look at the adaptive median filter.
Adaptive Median Filtering
The median filter performs relatively well on impulse noise as long as the spatial
density of the impulse noise is not large.

The adaptive median filter can handle much more spatially dense impulse noise, and
also performs some smoothing for non-impulse noise.
Adaptive Median Filtering (cont…)
The key to understanding the algorithm is to remember that the adaptive median
filter has three purposes:
• Remove impulse noise
• Provide smoothing of other noise
• Reduce distortion (excessive thinning or thickenning of object boundaries).
Adaptive Median Filtering (cont…)
In the adaptive median filter, the filter size changes
depending on the characteristics of the image.
Notation:
• Sxy = the support of the filter centerd at (x, y)
• zmin = minimum grey level in Sxy
• zmax = maximum grey level in Sxy
• zmed = median of grey levels in Sxy
• zxy = grey level at coordinates (x, y)
• Smax =maximum allowed size of Sxy
Adaptive Median Filtering (cont…)
Stage A: A1 = zmed – zmin
A2 = zmed – zmax
If A1 > 0 and A2 < 0, Go to stage B
Else increase the window size
If window size ≤ Smax repeat stage A
Else output zmed

Stage B: B1 = zxy – zmin


B2 = zxy – zmax
If B1 > 0 and B2 < 0, output zxy
Else output zmed
Adaptive Median Filtering (cont…)
Stage A: A1 = zmed – zmin
A2 = zmed – zmax
If A1 > 0 and A2 < 0, Go to stage B
Else increase the window size
If window size ≤ Smax repeat stage A
Else output zmed
Stage A determines if the output of the median filter zmed is an impulse or not (black or white).
If it is not an impulse, we go to stage B.
If it is an impulse the window size is increased until it reaches Smax or zmed is not an impulse.
Note that there is no guarantee that zmed will not be an impulse. The smaller the the density of the
noise is, and, the larger the support Smax, we expect not to have an impulse.
Adaptive Median Filtering (cont…)
Stage B: B1 = zxy – zmin
B2 = zxy – zmax
If B1 > 0 and B2 < 0, output zxy
Else output zmed

Stage B determines if the pixel value at (x, y), that is zxy, is an impulse or not
(black or white).
If it is not an impulse, the algorithm outputs the unchanged pixel value zxy .
If it is an impulse the algorithm outputs the median zmed .
Adaptive Filtering Example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by salt Result of filtering with a Result of adaptive


and pepper noise with 7x7 median filter median filtering with
probabilities Pa = Pb=0.25 Smax = 7

AMF preserves sharpness and details, e.g. the connector fingers.


Periodic Noise
Typically arises due to
electrical or electromagnetic
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

interference.
Gives rise to regular noise
patterns in an image.
Frequency domain techniques in the
Fourier domain are most effective at
removing periodic noise.
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:

 W
1 if D(u , v)  D0  2
 W W
H (u , v) 0 if D0  D(u , v) D0 
 2 2
1 if D(u , v)  D0  W
 2
Band Reject Filters (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

The ideal band reject filter is shown below, along with Butterworth and Gaussian
versions of the filter

Ideal Band Butterworth Gaussian


Reject Filter Band Reject Band Reject
Filter (of order 1) Filter
Band Reject Filter Example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image corrupted by Fourier spectrum of
sinusoidal noise corrupted image

Butterworth band Filtered image


reject filter
References
• Books and Journals
• Gonzalez and Woods: Digital Image Processing ISDN 0-201-600- 781, Addison Wesley 1992.
• Forsyth and Ponce: Computer Vision A Modern Approach Pearson Education Latest Edition.

• Video Link-
• https://www.youtube.com/watch?v=5qxrzD6ODHc

• Web Link-
• https://www.geeksforgeeks.org/types-of-restoration-filters/

41
THANK YOU

You might also like