SlideShare a Scribd company logo
1 of 38
Download to read offline
CSC447: Digital Image
Processing
Chapter 5: Image Restoration
Prof. Dr. Mostafa Gadal-Haqq M. Mostafa
Computer Science Department
College of Computer & Information Sciences
AIN SHAMS UNIVERSITY
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
 Periodic noise
 Noise removal using frequency domain
filtering
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 2
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 3
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 4
Noise Model
We can consider a noisy image to be modelled
as follows:
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 of the noise in an
image, this will help us to figure out how to
restore the image.
),(),(),( yxyxfyxg 
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 5
Noise Models
Gaussian Rayleigh
Erlang Exponential
Uniform
Impulse
There are many different
models for the image
noise term η(x, y):
 Gaussian
 Most common model
 Rayleigh
 Erlang
 Exponential
 Uniform
 Impulse
 Salt and pepper noise
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 6
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 7
Noise Example (cont…)
Gaussian Rayleigh Erlang
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 8
Noise Example (cont…)
Exponential Uniform Impulse
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 9
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:
This is implemented as the
simple smoothing filter
Blurs the image to remove
noise


xySts
tsg
mn
yxf
),(
),(
1
),(ˆ
1/9
1/9
1/9
1/9
1/9
1/9
1/9
1/9
1/9
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 10
Other Means
There are different kinds of mean filters all of
which exhibit slightly different behaviour:
 Geometric Mean
 Harmonic Mean
 Contra-harmonic Mean
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 11
Other Means (cont…)
There are other variants on the mean which can
give different performance
Geometric Mean:
 Achieves similar smoothing to the arithmetic
mean, but tends to lose less image detail
mn
Sts xy
tsgyxf
1
),(
),(),(ˆ








 
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 12
Other Means (cont…)
Harmonic Mean:
 Works well for salt noise, but fails for pepper
noise.
 Also does well for other kinds of noise such
as Gaussian noise


xySts tsg
mn
yxf
),( ),(
1
),(ˆ
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 13
Other Means (cont…)
Contra-harmonic Mean:
 Q is the order of the filter and adjusting its
value changes the filter’s behaviour
 Positive values of Q eliminate pepper noise
 Negative values of Q eliminate salt noise






xy
xy
Sts
Q
Sts
Q
tsg
tsg
yxf
),(
),(
1
),(
),(
),(ˆ
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 14
Noise Removal Examples
Original
Image
Image
Corrupted
By Gaussian
Noise
After A 3*3
Geometric
Mean Filter
After A 3*3
Arithmetic
Mean Filter
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 15
Noise Removal Examples
(cont…)
Image
Corrupted
By Pepper
Noise
Result of
Filtering Above
With 3*3
Contraharmonic
Q=1.5
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 16
Noise Removal Examples
(cont…)
Image
Corrupted
By Salt
Noise
Result of
Filtering Above
With 3*3
Contraharmonic
Q=-1.5
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 17
Contra-harmonic Filter
Choosing the wrong value for Q when using the
contra-harmonic filter can have drastic results
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 18
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 19
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
)},({),(ˆ
),(
tsgmedianyxf
xySts 

CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 20
Max and Min Filter
Max Filter:
Min Filter:
Max filter is good for pepper noise and Min is
good for salt noise
)},({max),(ˆ
),(
tsgyxf
xySts 

)},({min),(ˆ
),(
tsgyxf
xySts 

CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 21
Midpoint Filter
Midpoint Filter:
Good for random Gaussian and uniform noise



 

)},({min)},({max
2
1
),(ˆ
),(),(
tsgtsgyxf
xyxy StsSts
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 22
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


xySts
r tsg
dmn
yxf
),(
),(
1
),(ˆ
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 23
Noise Removal Examples
Image
Corrupted
By Salt And
Pepper Noise
Result of 1
Pass With A
3*3 Median
Filter
Result of 2
Passes With
A 3*3 Median
Filter
Result of 3
Passes With
A 3*3 Median
Filter
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 24
Noise Removal Examples
(cont…)
Image
Corrupted
By Pepper
Noise
Image
Corrupted
By Salt
Noise
Result Of
Filtering
Above
With A 3*3
Min Filter
Result Of
Filtering
Above
With A 3*3
Max Filter
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 25
Noise Removal Examples
(cont…)
Image
Corrupted
By Uniform
Noise
Image Further
Corrupted
By Salt and
Pepper Noise
Filtered By
5*5 Arithmetic
Mean Filter
Filtered By
5*5 Median
Filter
Filtered By
5*5 Geometric
Mean Filter
Filtered By
5*5 Alpha-Trimmed
Mean Filter
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 26
Periodic Noise
 Typically arises due to
electrical or electromagnetic
interference
 Gives rise to regular noise
patterns in an image
 Frequency domain
techniques in the Fourier
domain are most effective at
removing periodic noise
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 27
Band Reject Filters
 Removing periodic noise form an image involves
removing a particular range of frequencies from
that image
 An ideal band reject filter is given as follows:












2
),(1
2
),(
2
0
2
),(1
),(
0
00
0
W
DvuDif
W
DvuD
W
Dif
W
DvuDif
vuH
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 28
Band Reject Filters (cont…)
The ideal band reject filter is shown below,
along with Butterworth and Gaussian versions
of the filter
Ideal Band
Reject Filter
Butterworth
Band Reject
Filter (of order 1)
Gaussian
Band Reject
Filter
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 29
Band Reject Filter Example
Image corrupted by
sinusoidal noise
Fourier spectrum of
corrupted image
Butterworth band
reject filter
Filtered image
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 30
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 31
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
 The key element in the adaptive median filter
is that the filter size changes depending on
the characteristics of the image
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 32
Adaptive Median Filtering (cont…)
Remember that filtering looks at each original pixel
image in turn and generates a new filtered pixel
First examine the following notation:
 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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 33
Adaptive Median Filtering (cont…)
Level A: A1 = zmed – zmin
A2 = zmed – zmax
If A1 > 0 and A2 < 0, Go to level B
Else increase the window size
If window size ≤ Smax repeat level A
Else output zmed
Level B: B1 = zxy – zmin
B2 = zxy – zmax
If B1 > 0 and B2 < 0, output zxy
Else output zmed
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 34
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
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 35
Adaptive Filtering Example
Image corrupted by salt
and pepper noise with
probabilities
Pa = Pb=0.25
Result of filtering with
a 7 * 7 median filter
Result of adaptive
median filtering with
i = 7
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 36
Summary
 In this lecture we studied image restoration for
noise removal
 Restoration is slightly more objective than
enhancement
 Spatial domain techniques are particularly useful
for removing random noise
 Frequency domain techniques are particularly
useful for removing periodic noise
 Behaviour of adaptive filters changes depending
on the characteristics of the image inside the filter
region
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 37
HW 4
 Solve problems 5.1 to 5.12.
CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 38

More Related Content

What's hot

Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compressionasodariyabhavesh
 
Color image processing Presentation
Color image processing PresentationColor image processing Presentation
Color image processing PresentationRevanth Chimmani
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: BasicsA B Shinde
 
Image Restoration
Image RestorationImage Restoration
Image RestorationPoonam Seth
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniquessakshij91
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And ReconstructionAmnaakhaan
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIPbabak danyal
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 

What's hot (20)

Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
 
Color image processing Presentation
Color image processing PresentationColor image processing Presentation
Color image processing Presentation
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: Basics
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Image Restoration
Image RestorationImage Restoration
Image Restoration
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Image compression .
Image compression .Image compression .
Image compression .
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Image segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
Image segmentation using wvlt trnsfrmtn and fuzzy logic. pptImage segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
Image segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIP
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 

Similar to Digital Image Processing: Image Restoration

Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...IRJET Journal
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptxwdwd10
 
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...IJEACS
 
Digital Image Processing: Image Enhancement in the Spatial Domain
Digital Image Processing: Image Enhancement in the Spatial DomainDigital Image Processing: Image Enhancement in the Spatial Domain
Digital Image Processing: Image Enhancement in the Spatial DomainMostafa G. M. Mostafa
 
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...iosrjce
 
Fundamentals of Image processing.ppt
Fundamentals of Image processing.pptFundamentals of Image processing.ppt
Fundamentals of Image processing.pptssuser9a00df
 
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...Md. Shohel Rana
 
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAIN
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAINIMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAIN
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAINijma
 
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...iosrjce
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Kalyan Acharjya
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIPbabak danyal
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainMostafa G. M. Mostafa
 
Advance in Image and Audio Restoration and their Assessments: A Review
Advance in Image and Audio Restoration and their Assessments: A ReviewAdvance in Image and Audio Restoration and their Assessments: A Review
Advance in Image and Audio Restoration and their Assessments: A ReviewIJCSES Journal
 

Similar to Digital Image Processing: Image Restoration (20)

Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
 
DIP - Image Restoration
DIP - Image RestorationDIP - Image Restoration
DIP - Image Restoration
 
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...
Performance Assessment of Several Filters for Removing Salt and Pepper Noise,...
 
Digital Image Processing: Image Enhancement in the Spatial Domain
Digital Image Processing: Image Enhancement in the Spatial DomainDigital Image Processing: Image Enhancement in the Spatial Domain
Digital Image Processing: Image Enhancement in the Spatial Domain
 
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...
A Novel Adaptive Denoising Method for Removal of Impulse Noise in Images usin...
 
R01725115118
R01725115118R01725115118
R01725115118
 
Fundamentals of Image processing.ppt
Fundamentals of Image processing.pptFundamentals of Image processing.ppt
Fundamentals of Image processing.ppt
 
rmsip98.ppt
rmsip98.pptrmsip98.ppt
rmsip98.ppt
 
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...
Speckle Noise Reduction in Ultrasound Images using Adaptive and Anisotropic D...
 
Df4201720724
Df4201720724Df4201720724
Df4201720724
 
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAIN
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAINIMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAIN
IMAGE DENOISING BY MEDIAN FILTER IN WAVELET DOMAIN
 
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...
Edge Detection with Detail Preservation for RVIN Using Adaptive Threshold Fil...
 
K010615562
K010615562K010615562
K010615562
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency Domain
 
Advance in Image and Audio Restoration and their Assessments: A Review
Advance in Image and Audio Restoration and their Assessments: A ReviewAdvance in Image and Audio Restoration and their Assessments: A Review
Advance in Image and Audio Restoration and their Assessments: A Review
 
M.sc. m hassan
M.sc. m hassanM.sc. m hassan
M.sc. m hassan
 
D122733
D122733D122733
D122733
 

More from Mostafa G. M. Mostafa

Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsMostafa G. M. Mostafa
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An IntroductionMostafa G. M. Mostafa
 
Neural Networks: Least Mean Square (LSM) Algorithm
Neural Networks: Least Mean Square (LSM) AlgorithmNeural Networks: Least Mean Square (LSM) Algorithm
Neural Networks: Least Mean Square (LSM) AlgorithmMostafa G. M. Mostafa
 
Neural Networks: Support Vector machines
Neural Networks: Support Vector machinesNeural Networks: Support Vector machines
Neural Networks: Support Vector machinesMostafa G. M. Mostafa
 
Neural Networks: Rosenblatt's Perceptron
Neural Networks: Rosenblatt's PerceptronNeural Networks: Rosenblatt's Perceptron
Neural Networks: Rosenblatt's PerceptronMostafa G. M. Mostafa
 
Neural Networks: Model Building Through Linear Regression
Neural Networks: Model Building Through Linear RegressionNeural Networks: Model Building Through Linear Regression
Neural Networks: Model Building Through Linear RegressionMostafa G. M. Mostafa
 
Neural Networks: Multilayer Perceptron
Neural Networks: Multilayer PerceptronNeural Networks: Multilayer Perceptron
Neural Networks: Multilayer PerceptronMostafa G. M. Mostafa
 
Neural Networks: Radial Bases Functions (RBF)
Neural Networks: Radial Bases Functions (RBF)Neural Networks: Radial Bases Functions (RBF)
Neural Networks: Radial Bases Functions (RBF)Mostafa G. M. Mostafa
 
Neural Networks: Self-Organizing Maps (SOM)
Neural Networks:  Self-Organizing Maps (SOM)Neural Networks:  Self-Organizing Maps (SOM)
Neural Networks: Self-Organizing Maps (SOM)Mostafa G. M. Mostafa
 

More from Mostafa G. M. Mostafa (20)

Csc446: Pattern Recognition
Csc446: Pattern Recognition Csc446: Pattern Recognition
Csc446: Pattern Recognition
 
CSC446: Pattern Recognition (LN8)
CSC446: Pattern Recognition (LN8)CSC446: Pattern Recognition (LN8)
CSC446: Pattern Recognition (LN8)
 
CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)
 
CSC446: Pattern Recognition (LN6)
CSC446: Pattern Recognition (LN6)CSC446: Pattern Recognition (LN6)
CSC446: Pattern Recognition (LN6)
 
CSC446: Pattern Recognition (LN5)
CSC446: Pattern Recognition (LN5)CSC446: Pattern Recognition (LN5)
CSC446: Pattern Recognition (LN5)
 
CSC446: Pattern Recognition (LN4)
CSC446: Pattern Recognition (LN4)CSC446: Pattern Recognition (LN4)
CSC446: Pattern Recognition (LN4)
 
CSC446: Pattern Recognition (LN3)
CSC446: Pattern Recognition (LN3)CSC446: Pattern Recognition (LN3)
CSC446: Pattern Recognition (LN3)
 
Csc446: Pattren Recognition (LN2)
Csc446: Pattren Recognition (LN2)Csc446: Pattren Recognition (LN2)
Csc446: Pattren Recognition (LN2)
 
Csc446: Pattren Recognition
Csc446: Pattren RecognitionCsc446: Pattren Recognition
Csc446: Pattren Recognition
 
Csc446: Pattren Recognition (LN1)
Csc446: Pattren Recognition (LN1)Csc446: Pattren Recognition (LN1)
Csc446: Pattren Recognition (LN1)
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image Fundamentals
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An Introduction
 
Neural Networks: Introducton
Neural Networks: IntroductonNeural Networks: Introducton
Neural Networks: Introducton
 
Neural Networks: Least Mean Square (LSM) Algorithm
Neural Networks: Least Mean Square (LSM) AlgorithmNeural Networks: Least Mean Square (LSM) Algorithm
Neural Networks: Least Mean Square (LSM) Algorithm
 
Neural Networks: Support Vector machines
Neural Networks: Support Vector machinesNeural Networks: Support Vector machines
Neural Networks: Support Vector machines
 
Neural Networks: Rosenblatt's Perceptron
Neural Networks: Rosenblatt's PerceptronNeural Networks: Rosenblatt's Perceptron
Neural Networks: Rosenblatt's Perceptron
 
Neural Networks: Model Building Through Linear Regression
Neural Networks: Model Building Through Linear RegressionNeural Networks: Model Building Through Linear Regression
Neural Networks: Model Building Through Linear Regression
 
Neural Networks: Multilayer Perceptron
Neural Networks: Multilayer PerceptronNeural Networks: Multilayer Perceptron
Neural Networks: Multilayer Perceptron
 
Neural Networks: Radial Bases Functions (RBF)
Neural Networks: Radial Bases Functions (RBF)Neural Networks: Radial Bases Functions (RBF)
Neural Networks: Radial Bases Functions (RBF)
 
Neural Networks: Self-Organizing Maps (SOM)
Neural Networks:  Self-Organizing Maps (SOM)Neural Networks:  Self-Organizing Maps (SOM)
Neural Networks: Self-Organizing Maps (SOM)
 

Recently uploaded

Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

Digital Image Processing: Image Restoration

  • 1. CSC447: Digital Image Processing Chapter 5: Image Restoration Prof. Dr. Mostafa Gadal-Haqq M. Mostafa Computer Science Department College of Computer & Information Sciences AIN SHAMS UNIVERSITY
  • 2. 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  Periodic noise  Noise removal using frequency domain filtering CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 2
  • 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 3
  • 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 4
  • 5. Noise Model We can consider a noisy image to be modelled as follows: 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 of the noise in an image, this will help us to figure out how to restore the image. ),(),(),( yxyxfyxg  CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 5
  • 6. Noise Models Gaussian Rayleigh Erlang Exponential Uniform Impulse There are many different models for the image noise term η(x, y):  Gaussian  Most common model  Rayleigh  Erlang  Exponential  Uniform  Impulse  Salt and pepper noise CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 6
  • 7. 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 7
  • 8. Noise Example (cont…) Gaussian Rayleigh Erlang CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 8
  • 9. Noise Example (cont…) Exponential Uniform Impulse CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 9
  • 10. 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: This is implemented as the simple smoothing filter Blurs the image to remove noise   xySts tsg mn yxf ),( ),( 1 ),(ˆ 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 10
  • 11. Other Means There are different kinds of mean filters all of which exhibit slightly different behaviour:  Geometric Mean  Harmonic Mean  Contra-harmonic Mean CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 11
  • 12. Other Means (cont…) There are other variants on the mean which can give different performance Geometric Mean:  Achieves similar smoothing to the arithmetic mean, but tends to lose less image detail mn Sts xy tsgyxf 1 ),( ),(),(ˆ           CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 12
  • 13. Other Means (cont…) Harmonic Mean:  Works well for salt noise, but fails for pepper noise.  Also does well for other kinds of noise such as Gaussian noise   xySts tsg mn yxf ),( ),( 1 ),(ˆ CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 13
  • 14. Other Means (cont…) Contra-harmonic Mean:  Q is the order of the filter and adjusting its value changes the filter’s behaviour  Positive values of Q eliminate pepper noise  Negative values of Q eliminate salt noise       xy xy Sts Q Sts Q tsg tsg yxf ),( ),( 1 ),( ),( ),(ˆ CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 14
  • 15. Noise Removal Examples Original Image Image Corrupted By Gaussian Noise After A 3*3 Geometric Mean Filter After A 3*3 Arithmetic Mean Filter CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 15
  • 16. Noise Removal Examples (cont…) Image Corrupted By Pepper Noise Result of Filtering Above With 3*3 Contraharmonic Q=1.5 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 16
  • 17. Noise Removal Examples (cont…) Image Corrupted By Salt Noise Result of Filtering Above With 3*3 Contraharmonic Q=-1.5 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 17
  • 18. Contra-harmonic Filter Choosing the wrong value for Q when using the contra-harmonic filter can have drastic results CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 18
  • 19. 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 19
  • 20. 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 )},({),(ˆ ),( tsgmedianyxf xySts   CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 20
  • 21. Max and Min Filter Max Filter: Min Filter: Max filter is good for pepper noise and Min is good for salt noise )},({max),(ˆ ),( tsgyxf xySts   )},({min),(ˆ ),( tsgyxf xySts   CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 21
  • 22. Midpoint Filter Midpoint Filter: Good for random Gaussian and uniform noise       )},({min)},({max 2 1 ),(ˆ ),(),( tsgtsgyxf xyxy StsSts CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 22
  • 23. 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   xySts r tsg dmn yxf ),( ),( 1 ),(ˆ CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 23
  • 24. Noise Removal Examples Image Corrupted By Salt And Pepper Noise Result of 1 Pass With A 3*3 Median Filter Result of 2 Passes With A 3*3 Median Filter Result of 3 Passes With A 3*3 Median Filter CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 24
  • 25. Noise Removal Examples (cont…) Image Corrupted By Pepper Noise Image Corrupted By Salt Noise Result Of Filtering Above With A 3*3 Min Filter Result Of Filtering Above With A 3*3 Max Filter CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 25
  • 26. Noise Removal Examples (cont…) Image Corrupted By Uniform Noise Image Further Corrupted By Salt and Pepper Noise Filtered By 5*5 Arithmetic Mean Filter Filtered By 5*5 Median Filter Filtered By 5*5 Geometric Mean Filter Filtered By 5*5 Alpha-Trimmed Mean Filter CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 26
  • 27. Periodic Noise  Typically arises due to electrical or electromagnetic interference  Gives rise to regular noise patterns in an image  Frequency domain techniques in the Fourier domain are most effective at removing periodic noise CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 27
  • 28. Band Reject Filters  Removing periodic noise form an image involves removing a particular range of frequencies from that image  An ideal band reject filter is given as follows:             2 ),(1 2 ),( 2 0 2 ),(1 ),( 0 00 0 W DvuDif W DvuD W Dif W DvuDif vuH CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 28
  • 29. Band Reject Filters (cont…) The ideal band reject filter is shown below, along with Butterworth and Gaussian versions of the filter Ideal Band Reject Filter Butterworth Band Reject Filter (of order 1) Gaussian Band Reject Filter CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 29
  • 30. Band Reject Filter Example Image corrupted by sinusoidal noise Fourier spectrum of corrupted image Butterworth band reject filter Filtered image CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 30
  • 31. 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 31
  • 32. 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  The key element in the adaptive median filter is that the filter size changes depending on the characteristics of the image CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 32
  • 33. Adaptive Median Filtering (cont…) Remember that filtering looks at each original pixel image in turn and generates a new filtered pixel First examine the following notation:  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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 33
  • 34. Adaptive Median Filtering (cont…) Level A: A1 = zmed – zmin A2 = zmed – zmax If A1 > 0 and A2 < 0, Go to level B Else increase the window size If window size ≤ Smax repeat level A Else output zmed Level B: B1 = zxy – zmin B2 = zxy – zmax If B1 > 0 and B2 < 0, output zxy Else output zmed CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 34
  • 35. 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 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 35
  • 36. Adaptive Filtering Example Image corrupted by salt and pepper noise with probabilities Pa = Pb=0.25 Result of filtering with a 7 * 7 median filter Result of adaptive median filtering with i = 7 CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 36
  • 37. Summary  In this lecture we studied image restoration for noise removal  Restoration is slightly more objective than enhancement  Spatial domain techniques are particularly useful for removing random noise  Frequency domain techniques are particularly useful for removing periodic noise  Behaviour of adaptive filters changes depending on the characteristics of the image inside the filter region CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 37
  • 38. HW 4  Solve problems 5.1 to 5.12. CS447: Introduction to Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 38