Sie sind auf Seite 1von 10

4/5/2020

Concept of Image Restoration

Image restoration is to restore a degraded image back to


the original image while image enhancement is to
manipulate the image so that it is suitable for a specific
application.

IMAGE RESTORATION

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

where h(x,y) is a system that causes image distortion and


(x,y) is noise. (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.

Noise Models Noise Models (cont.)


Noise cannot be predicted but can be approximately described in Exponential noise
statistical way using the probability density function (PDF)
p( z )  ae az
Gaussian noise:
1 Uniform noise
p( z )  e ( z   ) /2
2 2

2  1
 for a  z  b
Rayleigh noise p( z )   b - a
 2 
 0 otherwise
( z  a )e ( z  a ) / b for z  a
2

p( z )   b
 0 for z  a
Impulse (salt & pepper) noise
Erlang (Gamma) noise
 Pa for z  a
 a b z b1 
 ( z  a )e az for z  0 p( z )   Pb for z  b
p( z )   (b  1)!
 0 0
for z  0  otherwise

1
4/5/2020

PDF: Statistical Way to Describe Noise


Impulse Noise Example PDF tells how much
each z value occurs.

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

Image Degradation with Additive Noise Image Degradation with Additive Noise (cont.)

g ( x, y )  f ( x, y )   ( x, y ) g ( x, y )  f ( x, y )   ( x, y )

Degraded images Degraded images

Original image Original image

Histogram Histogram

(Images from Rafael C. Gonzalez and Richard E. (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition. Wood, Digital Image Processing, 2nd Edition.

2
4/5/2020

Estimation of Noise Parameters

• Periodic noise
– Parameters can be estimated by inspection of the
spectrum
• Noise PDFs
– From sensor specifications
– If imaging sensors are available, capture a set of images
of plain environments
– If only noisy images are available, parameters of the
PDF involved can be estimated from small patches of
constant regions of the noisy images

Estimation of Noise

Noise Removal Restoration Method


We cannot use the image
histogram to estimate
noise PDF. • Mean filters • Adaptive filters
– Arithmetic mean filter – Adaptive local noise
– Geometric mean filter reduction filter
– Harmonic mean filter – Adaptive median filter
– Contra-harmonic mean
filter
• Order statistics filters
It is better to use the
– Median filter
histogram of one area
– Max and min filters
of an image that has – Mid-point filter
constant intensity to – alpha-trimmed filters
estimate noise PDF.

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

3
4/5/2020

Mean Filters Geometric Mean Filter: Example


Degradation model:

g ( x, y )  f ( x, y )  h ( x, y )   ( x, y ) Image
Original
image corrupted
To remove this part by AWGN

Arithmetic mean filter or moving average filter


1
fˆ ( x, y )   g ( s, t )
Arithmetic mean filter replaces the current
pixel with a uniform weighted average of the
mn ( s ,t )S xy neighborhood
Image Image
obtained obtained
Geometric mean filter mn = size of moving window using a 3x3
using a 3x3
1 arithmetic geometric
  mn
mean filter mean filter
fˆ ( x, y )    g ( s, t ) 
 Tends to preserve more details
 ( s ,t )S 
 xy 
AWGN: Additive White Gaussian Noise (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.

Results of Harmonic mean filter


Harmonic mean filter
mn
fˆ ( x, y ) 
1

( s ,t )S xy g ( s, t )
mn = size of moving window

Works well for salt noise but fails for pepper noise

4
4/5/2020

Contra-harmonic mean Filter Contraharmonic Filters: Example

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

 g ( s, t ) Q by pepper by salt
noise with noise with
( s ,t )S xy prob. = 0.1 prob. = 0.1
Works well for images containing salt OR pepper type noise.
Image Image
Positive Q is suitable for eliminating pepper noise. obtained obtained
Negative Q is suitable for eliminating salt noise. using a 3x3 using a 3x3
contra- contra-
For Q = 0, the filter reduces to an arithmetic mean filter. harmonic harmonic
For Q = -1, the filter reduces to a harmonic mean filter. mean filter mean filter
With Q = 1.5 With Q=-1.5

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

Contraharmonic Filters: Incorrect Use Example Order-Statistic Filters: Revisit


Original image
Image Image
corrupted subimage
corrupted
by pepper by salt
noise with noise with Statistic parameters
prob. = 0.1 prob. = 0.1 Mean, Median, Mode,
Min, Max, Etc.

Image Image Moving


obtained obtained window
using a 3x3 using a 3x3
contra- contra-
harmonic harmonic
mean filter mean filter
With Q=-1.5 With Q=1.5

(Images from Rafael C. Gonzalez and Richard E. Output image


Wood, Digital Image Processing, 2nd Edition.

5
4/5/2020

Order-Statistics Filters Median Filter : How it works


Median filter A median filter is good for removing impulse, isolated noise

fˆ ( x, y )  median g ( s, t ) Pepper noise


Salt noise
( s ,t )S xy
Median
Max filter

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


( s ,t )S xy Moving
(pepper noise) Degraded image array
Min filter window
Salt noise Filter output
fˆ ( x, y )  min g ( s, t ) Reduce “bright” noise Pepper noise
( s ,t )S xy (salt noise) Normally, impulse noise has high magnitude
and is isolated. When we sort pixels in the
Midpoint filter moving window, noise pixels are usually
1  at the ends of the array.
fˆ ( x, y )   max g ( s, t ) min g ( s, t )
2  ( s ,t )S xy ( s ,t )S xy  Therefore, it’s rare that the noise pixel will be a median value.

Median Filter : Example Max and Min Filters: Example


1 2
Image Image Image
corrupted corrupted corrupted
by salt- by pepper by salt
and-pepper noise with noise with
noise with prob. = 0.1 prob. = 0.1
pa=pb= 0.1

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

Images obtained using a 3x3 median (Images


filter from Rafael C. Gonzalez and Richard E. (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition. Wood, Digital Image Processing, 2nd Edition.

6
4/5/2020

Alpha-trimmed Mean Filter


Alpha-trimmed mean filter Formula:
N 2 T
1
• Let Sxy be a neighborhood of size M x N, Alpha  trimmed mean 
N  2T
2 I
i T 1
i
of a point (x,y) in the image I.
• Given a number d, delete d/2 largest and T is the number of pixel values excluded at each end of the
d/2 smallest gray-level values in Sxy. Let ordered set, and can range from 0 to (N2-1)/2
the remaining gray-level values be Ranges from mean to median filter, depending on the value
denoted as Id . selected for the T parameters.
T=0 ?
• Take the arithmetic mean of rest of the T= (N2-1)/2?
gray-level values:
This filter is useful in situations involving multiple types
– of noise such as a combination of salt-and-pepper and
Gaussian noise.

Alpha-Trimmed Mean Filter (De-Noising) De-Noising


• Alpha-trimmed mean filter takes the mean value of the pixels
enclosed by an m x n mask after deleting the pixels with the d/2 Added salt
lowest and the d/2 highest gray-level values & pepper
Corrupted by
additive noise
1
 g r ( s, t )
Uniform noise
fˆ ( x, y) 
mn  d ( s ,t )S xy
5x5 Mean
5x5 Geo-
– gr(s,t) represent the remaining mn-d pixels Filtering
Mean
– It is useful in situations involving multiple types of noise Filtering
like a combination of salt-and-pepper and Gaussian
5x5 5x5 Alpha-
Median trimmed
Filtering Mean
H.R. Pourreza Filtering

7
4/5/2020

Alpha-trimmed Mean Filter: Example Alpha-trimmed Mean Filter: Example (cont.)


1 2 1 2
Image Image
additionally additionally
Image corrupted Image corrupted
corrupted by additive corrupted by additive
by additive salt-and- by additive salt-and-
uniform pepper uniform pepper
noise noise noise noise

Image 2
Image 2 Image 2 Image 2 obtained
obtained obtained obtained using a 5x5
using a 5x5 using a 5x5 using a 5x5 alpha-
arithmetic geometric median filter trimmed
mean filter mean filter mean filter
with d = 5

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

Alpha-trimmed Mean Filter: Example (cont.) Adaptive Filter


General concept:
Image Image
obtained obtained -Filter behavior depends on statistical characteristics of local areas
using a 5x5 using a 5x5 inside mxn moving window
arithmetic geometric
- More complex but superior performance compared with “fixed”
mean filter mean filter
filters
Statistical characteristics:
Local mean:
Image Noise variance:  2
obtained 1
 g ( s, t )
Image
obtained using a 5x5 mL  • Assume the variance of the noise is either known
alpha- mn ( s ,t )S xy or can be estimated satisfactorily
using a 5x5
trimmed • Filtering operation changes at different regions
median filter Local variance: of an image according to local variance
mean filter calculated within an m×n region
1
with d = 5
 L2   ( g ( s, t )  mL )2
mn ( s ,t )S xy

8
4/5/2020

Adaptive, Local Noise Reduction Filter Adaptive Noise Reduction Filter: Example
Purpose: want to preserve edges Image Image
corrupted obtained
Concept: by additive using a 7x7
1. If 2 is zero,  No noise Gaussian arithmetic
the filter should return g(x,y) because g(x,y) = f(x,y) noise with mean filter
zero mean
2. If L2 is high relative to 2,  Edges (should be preserved), and 2=1000
the filter should return the value close to g(x,y) Image
Image obtained
3. If L2 = 2,  Areas inside objects obtained using a 7x7
the filter should return the arithmetic mean value mL using a 7x7 adaptive
geometric noise
Formula:
mean filter reduction
2

fˆ ( x, y )  g ( x, y )  2 g ( x, y )  mL 
filter
L (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.

Adaptive Median Filter


Purpose: want to remove impulse noise while preserving edges
Algorithm:Level A: A1= zmedian – zmin
A2= zmedian – zmax
If A1 > 0 and A2 < 0, goto level B
Else increase window size
If window size <= Smax repeat level A
Else return zxy
Level B: B1= zxy – zmin
B2= zxy – zmax
If B1 > 0 and B2 < 0, return zxy
Else return zmedian
where zmin = minimum gray level value in Sxy
zmax = maximum gray level value in Sxy
zmedian = median of gray levels in Sxy
zxy = gray level value at pixel (x,y)
Smax = maximum allowed size of Sxy

9
4/5/2020

Adaptive Median Filter: How it works Adaptive Median Filter: Example


Level A: A1= zmedian – zmin Determine
A2= zmedian – zmax whether zmedian
If A1 > 0 and A2 < 0, goto level B is an impulse or not
Else  Window is not big enough
increase window size
If window size <= Smax repeat level A
Else return zxy
Level B:  zmedian is not an impulse Image corrupted Image obtained Image obtained
Determine by salt-and-pepper using a 7x7 using an adaptive
B1= zxy – zmin whether zxy noise with median filter median filter with
B2= zxy – zmax is an impulse or not pa=pb= 0.25 Smax = 7
If B1 > 0 and B2 < 0,  zxy is not an impulse
return zxy  to preserve original details More small details are preserved
Else
return zmedian  to remove impulse (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.

Estimation of Degradation Model


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 )

Purpose: to estimate h(x,y) or H(u,v)


Why? 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:
1. Estimation by Image Observation

2. Estimation by Experiment

3. Estimation by Modeling (Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

10

Das könnte Ihnen auch gefallen