1-Image Imagerestoration-S
1-Image Imagerestoration-S
Processing
Image Restoration:
Noise Removal
3
Recap
Image enhancement
Smoothing filters
Sharpening filters
4
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
5
Image enhancement vs image restoration
(Cont.)
Restoration involves modeling of degradation
and applying the inverse process in order to
recover the original image.
Although the restore image is not the original
image, its approximation of actual image.
6
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
7
Noise Model
We can consider a noisy image to be
modelled as follows:
g ( x, y ) f ( x, y ) ( x, y )
8
Noise Corruption Example
Uniform
Impulse 10
Histogram to go here
11
Noise Example (cont…)
12
Noise Example (cont…)
13
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
1 as follows:1/ 1
/ 1
/9
ˆ f ( x, y ) g ( s, t )
mn ( s ,t )S xy
9 9
/9
1
/9
1
/9
1
image.
Noise Removal Example
Original Image x Filtered Image x
154 152 157 155 156 152 151
15
Other Means
There are different kinds of mean filters all
of which exhibit slightly different behavior:
Geometric Mean
Harmonic Mean
Contra harmonic Mean
16
Other Means (cont…)
There are other variants on the mean which
can give different performance
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.
This usually results in similar as the arithmetic
mean filter,
With possibly less loss of image detail.
17
Noise Removal Example
Original Image x Filtered Image x
54 52 57 55 56 52 51
50 49 51 50 52 53 58
51 204 5 16 22 57 60
48 50 6 3 18 59 63
49 51 12 3 15 64 67
12 3 1
Mean Filters (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.
19
Noise Corruption Example
Original Image x Filtered Image x
154 152 157 155 156 152 151
20
Mean Filters (cont…)
Contraharmonic Mean:
g ( s, t ) Q 1
ˆf ( x, y ) ( s ,t )S xy
g ( s, t )
( s ,t )S xy
Q
22
Noise Removal Examples
Original Image
Image Corrupted
By Gaussian
Noise
After A 3*3 After A 3*3
Arithmetic Geometric
Mean Filter Mean Filter
23
Noise Removal Examples (cont…)
Image
Corrupted
By Pepper
Noise
Result of
Filtering Above
With 3*3
Contraharmonic
Q=1.5
24
Noise Removal Examples (cont…)
Image
Corrupted
By Salt
Noise
Result of
Filtering Above
With 3*3
Contraharmonic
Q=-1.5
25
Contraharmonic Filter: Here Be Dragons
Choosing the wrong value for Q when using
the contraharmonic filter can have drastic
results
26
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
27
Median Filter
Median Filter:
fˆ ( x, y ) median{g ( s, t )}
( s ,t )S xy
30
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 is
used to find the bright spots in an image.
Min is good for salt noise and is used to
find the dark spots in an image.
Usually, the max and min filters are used in
conjunction. 31
Noise Corruption Example
Original Image x Filtered Image x
154 152 157 155 156 152 151
32
Midpoint Filter
Midpoint Filter:
33
Noise Corruption Example
Original Image x Filtered Image x
154 152 157 155 156 152 151
34
Alpha-Trimmed Mean Filter
Alpha-Trimmed Mean Filter:
1
fˆ ( x, y ) g ( s, t ) r
mn d ( s ,t )S xy
36
Noise Corruption Example
Original Image x
Filtered Image x
154 152 157 155 156 152 151
37
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
38
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
39
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
40
Codes Description
Description: The blurring effect can be
controlled by “a” and ‘b’ components of the
model.
Then random noise is added in the image
via Matlab programming.
Many methods can restore the noisy and
motion blurred image; particularly in this
lecture, we follows the Inverse filtering,
Wiener filtering, Lucy-Richardson, Blind
DeConvolution, and Regularized Method
for the purpose of image restoration.
41
Codes
42
Inverse filter, Wiener filter &
Lucy-Richardson filters based
restoration
43
Inverse filter, Wiener filter &
Lucy-Richardson filters based
restoration (Cont.)
44
Inverse filter, Wiener filter &
Lucy-Richardson filters based
restoration (Cont.)
45
Blind DeConvolution based Restoration
46
Blind DeConvolution based Restoration
(Cont.)
47
Lucky Richardson Method
48
Lucky Richardson Method (Cont.)
49
Regularized Method
50
Regularized Method (Cont.)
51
Task
52
Summary
Image restoration techniques used for noise
removal
What is image restoration?
Image enhancement vs image restoration
Noise and images
Noise models
Noise removal using spatial domain filtering
Order Statistics Filters
53
Next Lecture
Histograms
54
THANK YOU
55