Download as pdf or txt
Download as pdf or txt
You are on page 1of 49

CoSc 4082: Computer Vision and Image Processing

Hawassa University, Bensa Daye Campus

Chapter Five:

Image Restoration and Reconstruction


Kassawmar Mandefro
Department of Computer Science
April, 2024

Compiled By: Kassawmar Mandefro


Outline

 Degradation model

 Noise model

 Noise Probability Density Functions

 Spatial domain filtering

 Frequency domain Filtering

2
Image restoration
• Image restoration means tries to reconstruct or recover an image
which was degraded using a priori knowledge of degradation.
• Here we have model degradation and apply the inverse process to
recover the original image.
• The main aim of restoration is to improve an image in some
predefined way.
• Image restoration attempts to restore images that have been degraded:
o Identify the degradation process and attempt to reverse it
o Similar to image enhancement, but more objective

• Techniques can be formulated in spatial domain or in frequency domain.

3
Degradation: Example

4
Model of Image Degradation

⚫ In this model, we assume that there is an additive noise term, operating


on an input image f(x,y) to produce a degraded image g(x,y).

⚫ Given g(x,y) and some information about degradation function H,


and knowledge about noise term η(x,y).

⚫ The aim of restoration is to get an estimate f(x,y) of original image.

⚫ The more we know about H and term η, we get better results.

5
Model of Image D egradation

Fig: A model of the image degradation/restoration process

6
Model of Image Degradation

• Then the degraded image is given in the spatial domain by:


g (x, y)  h( x, y) f ( x, y) ( x, y)
• T h e model of the degraded image is given in the
frequency domain by:

G (u , v )  H (u , v ) F (u , v )  N (u , v )

7
Noise Sources
• The principal sources of noise in digital images arise during image
acquisition and/or transmission.

o Image acquisition
e.g., light levels, sensor temperature, etc.

o Transmission
e.g., lightning or other atmospheric disturbance in
wireless network

8
Noise type
 Noise in images can be defined as unwanted variation of brightness or color
information.
 Noise type describes the nature or characteristics of the noise present in the
image, such as its distribution, spatial or temporal properties, and how it
affects pixel values

◦ Impulse Noise (Salt and Pepper Noise): Impulse noise also referred as data drop-
out-noise, intensity spikes or salt and pepper noise.
o Impulse noise affects individual pixels by randomly changing their intensity
values to either the maximum (1) or minimum (0) intensity levels.
oThis type of noise basically occurs during transmission.

◦ Gaussian Noise: It can also be referred as Normal Noise or Amplifier Noise.


Gaussian noise follows probability distribution function like normal distribution
function.
9
Cont…
oGaussian noise is additive and has a constant mean and standard deviation.
oIt is caused by electronic noise in imaging sensors or environmental factors during
image acquisition.

◦ Uniform Noise: It can also be referred as Quantization noise. Uniform noise is


caused by quantizing the pixels of a sensed image to a number of discrete levels.

◦ Poisson Noise: It can also be referred as Shot Photon Noise.


 This noise arises from the inherent randomness in the photon-counting process
during image acquisition, particularly in low-light conditions.

◦ Speckle Noise: Speckle Noise is generally found in synthetic aperture radar


images, medical images and satellite images.

10
Noise Model
 A noise model is a mathematical representation or approximation of a specific
type of noise.
 Noise models allow researchers and engineers to analyze the properties of
noise, develop algorithms for noise reduction or removal in digital images.
◦ Gaussian/additive white Gaussian noise (AWGN) model: Electronic circuit
noise, sensor noise due to poor illumination.
◦ Rayleigh noise model: Often seen in range imaging applications, such as radar
or sonar.
◦ Gamma(Erlang) and Exponential Noise Models: Found in laser (highly focused)
imaging systems, like laser scanning microscopy.
◦ Impulse(salt-and-pepper) noise model: can occur due to various factors,
including faulty switches, sensor glitches, or electrical interference.
◦ Uniform noise model: Least commonly used, lacks a specific application.
11
Noise Probability Density Functions
 Noise probability density functions (PDFs) describe the statistical
distribution of noise values in digital images.
 Different types of noise exhibit unique PDFs, which help characterize
their properties and behavior.
 Noise cannot be predicted but can be approximately described in
statistical -- using the probability density function (PDF)
◦ Gaussian noise
 Electronic circuit noise and sensor noise
 Used frequently in practice
 Tractable or handle both in the spatial and frequency domains
1  ( z   ) 2 / 2 2
p( z )  e
2 
12
Noise Probability Density Functions
 Rayleigh noise

Quite useful for


approximating skewed
histograms
• a is the scale parameter, representing the location parameter or the mode of the
distribution.
• b is the scale parameter, controlling the spread or variability of the noise values.
13
Noise Probability Density Functions
 Erlang (gamma) noise:

2 Where a > 0 and b is


 ( z  a )e ( z  a ) 2 / b
for z  a positive
p( z )   b
0 for z  a

– The mean and variance of this density are given by

b(4   )
  a  b / 4 and   2

– a and b can be obtained through mean and variance

14
Noise Probability Density Functions
 Exponential noise
ae az for z  0 Where a > 0
p( z )  
0 for z  0
– The mean and variance of this density are given by:

1
  1 / a and   2
2

Special case of Erlang PDF with b=1

15
Noise Probability Density Functions
 Uniform Noise

• Less practical, used for random number generator


 1
 if a  z  b
p( z )   b  a

 0 otherwise

ab

2
(b  a ) 2
2 
12
16
Noise Probability Density Functions
 Impulse (salt-and-pepper) noise
- Quick transients, such as faulty switching during imaging.
 Pa for z  a

p ( z )   Pb for z  b
0 otherwise

- Where,
• a: Represents one of the intensity levels corresponding to "salt" noise, where
pixels are typically set to a high intensity value.
• b: Represents the other intensity level corresponding to "pepper" noise, where
pixels are typically set to a low intensity value.
• Pa: Represents the probability density associated with intensity level a, which is
the probability of occurrence of "salt" noise.
• Pb: Represents the probability density associated with intensity level b, which is
the probability of occurrence of "pepper" noise.
17
Noise Probability Density Functions

- If either Pa or Pb is zero– called unipolar


- Otherwise– called bipolar
- If neither probability is zero or approximately equal impulse noise values
resemble salt-and-pepper granules.
- The term impulse and slat-and-pepper used interchangeable.
- Noise impulse can be negative or positive.

18
Noise Probability Density Functions

Fig: Some important probability density functions


19
Noise Probability Density Functions example

g ( x, y )  f ( x, y )   ( x, y )
Degraded images
Original image

Histogram

20
Noise Probability Density Functions example
Degraded images

Histogram

21
Periodic Noise
 Arises typically from electrical or electromechanical interference
during image acquisition.
 It can be observed by visual inspection both in the spatial domain and
frequency domain
 Can be reduced significantly via frequency domain filtering

Fig: (a) Image corrupted by sinusoidal noise.


(b) Spectrum (each pair of conjugate impulses
corresponds to one sine wave). (orginal image
courtesy of NASA ).

Periodic noise looks


like dots in the
frequency domain
22
Spatial Filtering
 The method of choice in situations when only additive random noise is
present.
◦ Mean Filter: Arithmetic mean filter, Geometric mean filter, Harmonic
mean filter, Contra-harmonic mean filter.

◦ Order-Statistics: Median filter, Max and min filters, Mid-point filter, Alpha-
trimmed filters.

◦ Adaptive Filters: Adaptive local noise reduction filter, Adaptive median


filter

23
Mean Filter
 Let Sxy represent the set of coordinates in a rectangular subimage
window of size m*n, centered at point (x,y).
 The arithmetic mean filtering process computes the average value of
the corrupted image g(x,y) in the area defined by Sxy.
 The value of the restored image f at any point (x,y) is simply the
arithmetic mean computed using the pixels in the region defined by Sxy.
In other words:
ˆf ( x, y )  1
 g ( s, t )
mn ( s ,t )S xy
 Is the simplest of the mean filters mn = size of moving window
 Smooths local variations in an image
 Noise is reduced as a result of blurring

24
Mean Filter
Degradation model: g ( x, y )  f ( x, y )  h ( x, y )   ( x, y )

Geometric mean filter

Where,
• The symbol ∏ like ∑, but instead of summing up terms, it multiplies them together.
• 𝑓(𝑥+𝑖,𝑦+𝑗) represents the intensity value of the pixel at position (𝑥+𝑖,𝑦+𝑗) in the
original image, where 𝑖 and j range over the dimensions of the filter kernel
(typically M×N).
• MN is the total number of pixels within the filter kernel

- Achieves smoothing as compared to arithmetic mean filter


- it tends to lose less image detail in the process
25
Mean Filter

Image
Original
corrupted
image
by AWGN

Image Image
obtained obtained
using a 3x3 using a 3x3
arithmetic geometric
mean filter mean filter

26
Mean Filter
Harmonic mean filter
mn
fˆ ( x , y )  Works well for salt noise
1

( s ,t )S xy g ( s, t )
but fails for pepper noise
mn = size of moving window
Contraharmonic mean filter
 g ( s , t ) Q 1
Positive Q is suitable for
eliminating pepper noise.
fˆ ( x , y ) 
( s ,t )S xy

 g ( s, t )
( s ,t )S xy
Q Negative Q is suitable for
eliminating salt noise.

Q = the filter order


For Q = 0, the filter reduces to an arithmetic mean filter.
For Q = -1, the filter reduces to a harmonic mean filter.

27
Mean Filter

Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1

Image Image
obtained obtained
using a 3x3 using a 3x3
contra- contra-
harmonic harmonic
mean filter mean filter
With Q = With Q=-
1.5 1.5
28
Order-Statistic Filters
subimage

Statistic parameters
Original image Mean, Median, Mode,
Min, Max, Etc.

Moving
window

Output image
29
Order-Statistic Filters
Median filter

fˆ ( x , y )  median g ( s, t )
( s ,t )S xy

Max filter

fˆ ( x , y )  max g ( s, t ) Reduce “dark” noise


( s ,t )S xy
(pepper noise)

Min filter

fˆ ( x , y )  min g ( s, t ) Reduce “bright” noise


( s ,t )S xy
(salt noise)

1 
Midpoint filter fˆ ( x, y )   max g ( s, t ) min g ( s, t )
2  ( s ,t )S xy ( s ,t )S xy 
30
Median Filter
A median filter is good for removing impulse, isolated noise
Pepper noise
Median

Sorted
Degraded image Moving array
window
Salt noise Filter output

Pepper noise Normally, impulse noise has high magnitude


and is isolated. When we sort pixels in the
moving window, noise pixels are usually
at the ends of the array.

31
Median Filter Example
1 2
Image
corrupted
by salt-and-
pepper
noise with
pa=pb= 0.1

3 4

Images obtained using a 3x3 median filter 32


Min-Max Filter
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1

Image Image
obtained obtained
using a 3x3 using a 3x3
max filter min filter

33
Adaptive Filter
• An adaptive filter is a type of digital filter that adjusts its parameters
based on the input signal and the desired output signal.
• Unlike traditional fixed filters with predefined coefficients, adaptive
filters dynamically modify their coefficients or parameters to adapt to
changes in the input signal or the environment.
• Thus far the filtration techniques are applied to an image without
regard for how image characteristics vary from one point to another.

• Adaptive filters behavior however changes based on statistical


characteristics of the image inside the filter region defined by the m*n
rectangular window Sxy.

34
Adaptive, Local Noise Reduction Filter

Mean– measure of average intensity


Variance– measures the contrast 35
Adaptive, Local Noise Reduction Filter

36
Adaptive, Local Noise Reduction Filter

Fig: (a) Image corrupted by additive Gaussian noise of zero mean and variance 1000.
(b) Result of arithmetic mean filtering.
(c) Result of geometric mean filtering.
(d) Result of adaptive noise reduction filtering. All filters were of size 7X7. 37
Adaptive Median Filter
 Median filter performs well if the spatial density of the impulse noise is
not large, i.e., (Pa and Pb less than 0.2)

 Adaptive median filtering can handle impulse noise with probability


larger than these.

 It seeks or attempts to perfectly detail while smoothing non-impulse


noise.

38
Adaptive Median Filter
 Remove salt-and-pepper noise
 Providing smoothing of other noise.
 Remove distortion (excessive thickening and thinning of object
boundary

Fig: (a) Image corrupted by salt-and-pepper noise with probabilities Pa=Pb=0.25.


(b) Result of filtering with a 7X7 median filter.
(c) Result of adaptive median filtering with Smax=7
39
Periodic Noise Reduction by Frequency Domain
 Periodic noise can be analyzed and filtered quite effectively using
frequency domain techniques.
 Periodic noise appears as concentrated bursts of energy in the
Fourier Transform– corresponding to the frequencies of the
periodic interference.
 Three types of selective filters:
◦ Bandreject
◦ Bandpass
◦ Notch

40
Bandreject

41
Cont…

42
Bandreject Example

Fig: (a) Image corrupted by sinusoidal noise.


(b) Spectrum of (a).
(c) Butterworth bandreject filter(white represents 1).
(d) Result of filtering.(Orginal image courtesy of NASA) 43
Bandpass
 Performs the opposite operation of bandreject filter

44
Notch Filter
 A notch filter rejects ( or passes) frequencies in predefined
neighborhoods about a center frequency.

45
Notch Filter

46
Notch Filtering

Fig: (a) Satellite image of Florida and the Gulf of Mexico (note horizontat sensor scan lines).
(b) Spectrum of (a). (c) Notch pass filter shown superimposed on (b).
(d) inverse Fourier transform of filtered image , showing noise pattern in spatial domain.
(e) result of notch reject filtering. 47
Estimation of Image Degradation
Degradation model:

g ( x, y )  f ( x, y )  h ( x, y )   ( x, y )
or
G ( u, v )  F ( u, v ) H ( u, v )  N ( u, v )

If we know exactly h(x,y), regardless of noise, we can do


deconvolution to get f(x,y) back from g(x,y).
Methods to quantify the degradation levels:
1. Estimation by Image Observation

2. Estimation by Experiment Reading Assignment


3. Estimation by Modeling 48
49

You might also like