0% found this document useful (0 votes)
4 views29 pages

Ch-4 Restortion

Uploaded by

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

Ch-4 Restortion

Uploaded by

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

Kotebe University of

Education

Digital Image Processing


and CV
Mulugeta A.(PhD)

1
Chapter Three

Image Restortion

2
Image Restoration
 Noise in images is the vital factor which degrades the
quality of the images.
 Reducing noise from the satellite images, medical images
etc., is a challenge for the researchers in digital image
processing.
 Several approaches are there for noise reduction.
What is image restoration?
 Image restoration is the process of recovering the
original image that has been degraded by noise using
a prior knowledge of the degradation phenomenon.
 Goal of image restoration
 Improve the quality and naturalness of an image in some
predefined sense
 Features
 A Prior knowledge:
 A prior knowledge of the degradation phenomenon is
considered
 Objective process:
 Modeling the degradation and apply the inverse process to
recover the original image
Noise in an image
 Noise is a random variation of image density,
which is pixel level variations in digital images.
 It is a key image quality factor; nearly as important as
sharpness.

 Images may suffer from the following


degradations:
 Poor contrast due to poor illumination or finite sensitivity of the
imaging device
 Electronic sensor noise or atmospheric disturbances leading to
broad band noise
 Finite aperture effects or motion leading to spatial
Noise in an image
 Noise in image is any degradation in an image signal,
caused by external disturbances during image
digitalization and/or image transmission.
 Source of noise
 Image acquisition: sensor heat while capturing an image
 e.g., light levels, sensor temperature, etc.

 Image digitization: involves sampling, quantization and


compression
 e.g. Aliasing effects due to inadequate sampling

 Image transmission: Error occurs in image signal while an image


is being sent electronically from one place to another via Satellite,
Wireless, and Network cable.
 e.g., lightning or other atmospheric disturbance in
wireless network
 Model the degradation and applying the inverse
process in order to recover the original image.
An Image Degradation Model
 The degradation process can be modelled by a
degradation function h(x,y), an additive noise
term, (x,y), as g(x,y)=h(x,y)*f(x,y)+ (x,y)

 f(x,y) is the (input) image free from any degradation


 g(x,y) is the degraded image
 * is the convolution operator

 The goal is to obtain an estimate of f(x,y)


according to the knowledge about the
degradation function h and the additive noise 
Modeling image degradation & restoration
process

 g(x,y)=h(f(x,y))+h(x,y)f(x,y)=h-1(g(x,y))-h(x,i)
Types of Image Noise
 Salt and pepper noise
 Its also known as impulse noise. this
noise can be caused by sharp & sudden
disturbances in the image signal.
 Its appearance is randomly scattered
white or black (or both)
 An effective noise reduction method for
this type of noise is a median filter or a
morphological filter.

 Gaussian noise
 Gaussian noise is statistical noise having
a probability density function (PDF)
equal to that of the normal distribution
 Gaussian noise is caused by random
fluctuations in the signal.
 its modeled by random values added to
an image.
Types of Image Noise
 Speckle noise
 It is a granular 'noise' that inherently exists
in and degrades the quality of the image
 It is caused by coherent processing of
backscattered signals from multiple
distributed targets.
 Speckle noise can be modeled by random
values multiplied by pixel values of an
image.
 Periodic noise
 Periodic noise is appearance when signal is
subject to a periodic, rather than a random
disturbance.
 Periodic noise in an image arises typically
from electrical or electromechanical
interference during image acquisition.
 Periodic noise can be reduced significantly
via frequency domain filtering
Properties of image noise
 Spatial properties of noise (e.g. additive noise)
 Statistical behavior of the gray-level values of pixels
 Noise parameters, correlation with the image
 Apply spatial domain image restoration techniques

 Frequency properties of noise (e.g. image blur)


 A random signal having equal intensity at different frequencies
may happen
 This is called white noise (a constant Fourier spectrum)
 Apply frequency domain image restoration techniques
Filtering in spatial domain

 Filtering is a technique for modifying or enhancing an image.


 Spatial filtering encompasses a set of digital processing
functions which are used to enhance the appearance of an
image.
 Spatial filters are designed to highlight or suppress specific features
in an image based on their spatial frequency.
 Spatial frequency refers to the frequency of the variations in
quality that appear in an image.
 "Rough" textured areas of an image, where the changes in quality are quick

over a small area, have high spatial frequencies,


 while "smooth" areas with little variation in quality over several pixels, have

low spatial frequencies.


Spatial filtering
 A common filtering procedure involves moving a 'window' of
a few pixels in dimension (e.g. 3x3, 5x5, etc.) over each pixel in
the image, applying a mathematical calculation using the pixel
values under that window, and replacing the central pixel with
the new value.
 The window is moved along in both the row and column dimensions

one pixel at a time and the calculation is repeated until the entire
image has been filtered and a "new" image has been generated.
 By varying the calculation performed and the weightings of the

individual pixels in the filter window, filters can be designed to


enhance or suppress different types of features.
Spatial filtering: Neighbors of a Pixel
 Filtering is a neighborhood operation, in which the value of
any given pixel in the output image is determined by applying
some algorithm to the values of the pixels in the
neighborhood of the corresponding input pixel.
 A pixel's neighborhood is some set of pixels, defined by their
locations relative to that pixel. A pixel p at coordinates (x,y)
has four horizontal and vertical neighbors whose coordinates
are given by: (x+1,y), (x-1, y), (x, y+1), (x,y-1)

(x, y-1)
(x-1, y) P (x,y) (x+1, y)
(x, y+1)

 This set of pixels, called the 4-neighbors of p, is denoted by


N4(p). Each pixel is one unit distance from (x,y) and some of
the neighbors of p lie outside the digital image if (x,y) is on
the border of the image.
Spatial filtering: Neighbors of a Pixel
 The four diagonal neighbors of p have coordinates:
(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
(x-1, y-1) (x+1, y-1)
P (x,y)
(x-1, y+1) (x+1, y+1)

and are denoted by ND (p).


 These points, together with the 4-neighbors, are
called the 8-neighbors of p, denoted by N8 (p).
(x-1, y-1) (x, y-1) (x+1, y-1)
(x-1, y) P (x,y) (x+1, y)
(x-1, y+1) (x, y+1) (x+1, y+1)

 As before, some of the points in ND (p) and N8 (p) fall


outside the image if (x,y) is on the border of the
image.
Low-pass vs High-pass Spatial Filtering
 A low-pass filter is designed to emphasize larger,
homogeneous areas of similar tone and reduce the
smaller detail in an image.
 Thus, low-pass filters generally serve to smooth
the appearance of an image.
 Average and median filters are examples of low-
pass filters.
 High-pass filters do the opposite and serve to
sharpen the appearance of fine detail in an image.
 One implementation of a high-pass filter first
applies a low-pass filter to an image and then
subtracts the result from the original, leaving
behind only the high spatial frequency
information.
Spatial Noise filtering techniques
 Minimum filtering: current pixel will be replaced
by minimum pixel value of its neighboring pixels
Min filter
f ( x, y )  min  g ( s, t )
( s ,t )S xy

 Maximum filtering: current pixel will be replaced


by maximum pixel value of its neighboring pixels

Max filter
f ( x, y )  max  g ( s, t )
( s ,t )S xy
Spatial Noise filtering techniques
 Mean filtering: current pixel will be replaced by
average of its neighboring pixel values
 Median filtering: current pixel will be replaced by
median or middle pixel value of its neighboring
pixels
 New generated filtering: current pixel will be
replaced by arithmetic mean of mid-1, mid, mid+1
of its neighboring pixels
Midpoint filter
f ( x, y )  1  max  g ( s, t )  min  g ( s, t ) 
2  ( s ,t )S xy ( s ,t )S xy 
Spatial Filtering: Mean Filtering

• Average (or mean) filtering is a method of


'smoothing‘ images by reducing the amount of
intensity variation between neighboring pixels.
• The average filter works by moving through the
image pixel by pixel, replacing each value with the
average value of neighboring pixels, including itself.
• Let Sx,y represent the set of coordinates in a
rectangle sub-image of size mxn, centered at (x,y),
Mean filtering works:

19
Mean filtering Example
• What is the new image obtained after applying
mean filtering using a 3x3 window
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 10 20 30 30 30 20 10
0 0 90 0 0 0 0 0 0 0
0 20 40 60 60 60 40 20
0 0 0 0 0 0 0 0 0 0
0 30 60 90 90 90 60 30
0 30 50 80 80 90 60 30
0 30 50 80 80 90 60 30
0 20 30 50 50 60 40 20
10 20 30 30 30 30 20 10
10 10 10 0 0 0 0 0
Spatial filtering: Median Filtering
• Median filtering is very widely used in digital image
processing because it preserves edges while removing
noise.
• The median filter is a sliding-window spatial filter.
 It replaces the value of the center pixel with the
median of the intensity values in the neighborhood
of that pixel.
 Median filtering is a nonlinear operation often used
in image processing to reduce "salt and pepper"
noise because of its appearance as white and black
dots overlaid on an image.
 A median filter is more effective than convolution
when the goal is to simultaneously reduce noise and
preserve edges.
• For every pixel, a 3x3 neighborhood with the pixel as
center is considered. In median filtering, the value of
the pixel is replaced by the median of the pixel values
in the 3x3 neighborhood.
Example: The resulting image after applying
median filtering
Exercise 1

What is the new value of the central pixel with value 8
(in the below 3x3 image) after applying median
filtering?

Answers: a) 7 b) 1 c) 3 d)9
Exercise 2
 What are the values of the
shaded boxes with yellow colour
after applying median filtering?
 Answers:
c)
a) b)
Assignment for next week

 Filter or Smooth noise in 0 0 0 0 0 0 0 0 0 0


0 0 0 0 0 0 0 0 0 0
the following image
0 0 0 100 130 110 120 110 0 0
using: 0 0 0 110 90 100 90 100 0 0
 Median filtering
0 0 0 130 100 90 130 110 0 0
 Mean or average
0 0 0 120 100 130 110 120 0 0
filtering
0 0 0 90 110 80 120 100 0 0
 Include in your report 0 0 0 0 0 0 0 0 0 0
 Overview of the two
0 0 0 0 0 0 0 0 0 0
techniques
 Show the algorithm to 0 0 0 0 0 0 0 0 0 0
explain how they
work
 Depict the resulting
image
 Concluding remarks
 Reference
Linear Spatial filtering: Correlation
 In correlation, the value of an output pixel is also computed as a weighted sum

of neighboring pixels.
 The following figure shows how to compute the (4,2) output pixel of the

correlation of A, assuming h is a correlation kernel using the following steps:


 Slide the center element of the correlation kernel so that lies on top of the (4,2)
element of A.
 Multiply each weight in the correlation kernel by the pixel of A underneath.
 Sum the individual products.

 The (4,2) output pixel from the correlation is


Linear Spatial filtering: Convolution

 In image processing, convolution is used for sharpening, embossing, edge


detection, and more.
 This is accomplished by doing a convolution between a

kernel, convolution matrix or mask (which is a small matrix) and


an image.
 Convolution is a neighborhood operation in which each output pixel is the
weighted sum of neighboring input pixels. The matrix of weights is called
the convolution kernel, also known as the filter. A convolution kernel is a
correlation kernel that has been rotated 180 degrees.
 For example, suppose the image is:

 and the correlation kernel is


Spatial filtering using convolution
 The following steps will be used to
compute the output pixel at position
(4,2):
 Rotate the correlation kernel 180 degrees

about its center element to create a


convolution kernel.
 Slide the center element of the
convolution kernel so that it lies on top of
the (2,4) element of A.
 Multiply each weight in the rotated
convolution kernel by the pixel of A
underneath.
 Sum the individual products from step 3.

 Hence the (4,2) output pixel is


Thank you !!!!

33

You might also like