0% found this document useful (0 votes)
17 views59 pages

Unit 3 Dip Adaptive

The document discusses adaptive filters, emphasizing their ability to adjust based on local statistical characteristics of images, such as local variance and mean, to enhance performance compared to traditional filters. It also covers various noise reduction techniques, including periodic noise reduction using band reject and notch filters, as well as the Wiener filter for image restoration. Additionally, it highlights the challenges of inverse filtering and the importance of estimating the degradation function for effective image restoration.

Uploaded by

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

Unit 3 Dip Adaptive

The document discusses adaptive filters, emphasizing their ability to adjust based on local statistical characteristics of images, such as local variance and mean, to enhance performance compared to traditional filters. It also covers various noise reduction techniques, including periodic noise reduction using band reject and notch filters, as well as the Wiener filter for image restoration. Additionally, it highlights the challenges of inverse filtering and the importance of estimating the degradation function for effective image restoration.

Uploaded by

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

21CSE251T-DIP

UNIT-III
Adaptive Filters

•The behavior of these filters change based on statistical


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

•These filters are superior in performance compared to other filters.


But they are more complex.
statistical characteristics of an adaptive filter:
1.Local Variance: to preserve or enhance these features.
2.Local Mean or Median: This helps the filter adapt to different levels of brightness or
contrast in different parts of the image.
3.Gradient Magnitude: to enhance or suppress edges based on their local characteristics.
4.Orientation and Directionality: to enhance or suppress features based on their
orientation.
5.Adaptive Neighborhood Size: Instead of using a fixed window size like traditional filters,
adaptive filters may adjust the size of the neighborhood based on the local
characteristics of the image. For example, in regions with high variance or detail, a
larger neighborhood might be used to capture more information, while in smoother
regions, a smaller neighborhood might be sufficient.
Adaptive local noise reduction filter

•The Mean & Variance are two simple statistical measures of a random variable

•These two are closely related to the appearance of an image

•The mean gives a measure of average gray level in the region over which the
mean is computed

•The variance gives a measure of average contrast in that region


•Let the selected local region be S
xy

•The response of the filter at any point (x,y) on which the region is

centered is based on:

A. g(x,y) the value of the noisy image at (x,y)

B. σ 2 the variance of the noise corrupting f(x,y) to form g(x,y)


η

C. mL the local mean of the pixels in Sxy

D. σ 2 the local variance of the pixels in S


L xy
Periodic Noise Reduction
• Arises due to electrical /Electromagnetic inferences.
• Gives rise to regular noise patterns in an image.
• Can be removed by Band pass, band reject and Notch filter.
Periodic Noise Reduction
Ideal Band Reject Filters

•Band reject filters remove or attenuate a band of frequencies about the origin of
the Fourier Transform.

•An ideal Band reject filter is given by the expression

0 if (D0 – W/2) < D(u,v) < (D0 + W/2)

• H(u,v) =

1 otherwise

• Where D(u,v) is the distance from the origin of the centered frequency
rectangle. W– width of the band.
• D0->radial center/cutoff freq
• Butterworth Band Reject Filters

•Butterworth Band reject filters of order is given by

• Gaussian Band Reject Filters


• Gaussian Band reject filters of order n is given by
•Band Reject Filtering is used for noise removal in the
applications, where the approx location of the noise in the
frequency domain is known.
•Even small details & textures are restored effectively

•It will not be possible to get similar results by a


direct spatial domain approach using convolution
masks
EECS490: Digital Image
Processing
Bandreject Filters

Ideal Butterwort Gaussia


h n


1 D u, v  D0  W 
  2 2
1  D2 u,v D2 0 
 
   1 H u, v  1  e
H u, v  0  D0 
Du,vW
H u, v 
2 
W  D u, v  D W  
  2  0
2  D u, vW 
2n

   1   D 2 u, v  D 2 
W   0 
1 D u, v  D0
 2

D0 is center of stopband; W is
© 2002 R. C.
full width of stopband
Gonzalez & R. E.
Woods
Band Pass Filters

•A Band Pass Filter performs the opposite operation of a Band reject filter.
•A bandpass filter is a type of electronic filter that allows signals within a
certain frequency range to pass through while attenuating or rejecting
signals outside of that range. This filter is commonly used in various
applications such as audio processing, telecommunications, and signal
processing.

•The transfer function of a band pass filter is given as Hbp(u,v) = 1 - Hbr(u,v)


Notch filter

o Notch filter is the spatial form of band reject filter.


o Instead of removing the entire range of frequencies, it removes only selective
components
o It is useful in removing a periodic signal of a clearly define frequency
like the interference pattern caused by
electrical distribution.
o A notch filter rejects (or passes) frequencies in a predefined neighborhood
of the frequency rectangle.
o Notch filters are commonly used to remove unwanted
interference or noise from a signal

Purpose
Image restoration : Image having added with noise and degraded is
to be restored with its original shape
Optimum Notch Filter

When several interference components are


present a simply notch filter may remove
too much image information.
One solution is to use an optimum filter
which minimizes local variances of the
restored
estimate.
Optimum Notch Filter

1. Manually place a notch pass filter HNP at each


noise spike in the frequency domain. The
Fourier transform of the interference noise
pattern is
N u, v  H N P u, vG u, v

NP u, vG u,


2. Determine
the
x, ynoise
 F 1 pattern in the spatial
domain H
3. Conventional thinking would be to simply eliminate
v
noise by subtracting the periodic noise from the
noisy image
fˆ x, y  g x, y  x, y
Optimum Notch Filter

4. To construct an optimal filter consider


fˆ x, y  g x, y  w x, yx, y

where w(x,y) is a weighting function.


5. We use the weighting function w(x,y) to
the variance 2(x,y) of fˆ x, ywith respect to w(x,y)
minimize

gx, yx, y  g x, yx, y


w x, y
2 x, y   2 x, y

We only need to compute this for one point in each
nonoverlapping neighborhood.
Optimum Notch Filter

gx, yx, y  g x, yx, y


w x, y
2 x, y   2 x, y

x, y Mean noise output from the notch filter


2 x, y Mean squared noise output from the notch
filter
 2 x, y Squared mean noise output from the notch
filter
gx, y Mean noisy image
Inverse Filtering
• If degraded image is given by degradation + noise
G u, v  H u, vF u, v  N u, v

• Estimate the image by dividing by the degradation function


H(u,v)
G u, v H u, vF u, v  N u, v N u, v
F˜ u, v    F u, v 
H u, v H u, v H u, v

We can never recover F(u,v) exactly:


1. N(u,v) is not known since (x,y) is a r.v. — estimated
2. If H(u,v) ->0 then noise term will dominate. Helped by
restricting analysis to (u,v) near origin.
Modeling of
Degradation
480x480
No radial H(u,v) cut off
limiting of at R=40
H(u,v)

H(u,v) cut off H(u,v) cut off


at R=70 at R=85

N u,
 2 2
 k  u      v    
M N
˜
F u, v  F u, v where H u, v    2
6
  2 

v 
 H u, e
v
Wiener Filter

Minimiz Assuming: 1. f and n are uncorrelated


e2
 f 
2. f and/or n is zero mean
e E 3. gray levels in f are a linear function
the gray levels in
of
f

The best estimate Fˆ u, v is then given


by  
2
 fˆ
H * u, vSf u, v  
H * u, v

Fˆ u, v   G u, v   G u, v
 S u, v 
2
 S f u, v H u, v  S u, v 
2

  H u, v 
   S f u, 

  v
  H(u,v) = degradation function
H u, v
2
1 H*(u,v) = complex conjugate
Fˆ u, v   G u, v
 H u, v 2 S u, v  of H
  H u,   |H(u,v)|= H*(u,v) H(u,v)
 S f u,  S(u,v)=|N(u,v)|2=power spectrum of
v
v noise (estimated)
Sf(u,v)=|F(u,v)|2=power spectrum of
original image (not known)
EECS490: Digital Image
Processing
Modeling of
Degradation

Inverse Radially limit Wiener


filtering filtering
o at D =75
N u, 2
 1 H u, v

v ˆ
F u, v  
 G u,
H u,    H u, v H u, v
2
 Kv 
v In practice we  don’t know the power
spectrum Sf(u,v)=|F(u,v)|2 of the
© 2002 R. C.
original image
Gonzalez & R. E.so we replace the S/Sf
term with
Woods a constant K which we vary
Degradation Model

f(x,y h(x,y) Σ g(x,y)


)
n(x,y)

Degradation Model: g = h*f


+n
Restoration Model

Degradati Restoratio
f(x,y f(x,y
on n
) )
Model Filter

• Inverse Filter • Wiener


• Pseudo-inverse Filter
Filter
f(x,y
) Approach
Build
g = h*f
degradation
+n
model

Analyze using g = Hf +
algebraic n
techniques W -1 g = DW -1
f+W -

1
n
Formulate
restoration f=H -1

algorithms g

Implement
using Fourier F(u,v) =
transforms G(u,v)/H(u,v)

f(x,y
)
Estimating the degradation function

•There are three ways to estimate the degradation function, for use in image restoration

• Observation

• Experimentation

• Mathematical modeling
Inverse Filtering
•The simple method to restoration is direct inverse filtering

•The estimate F^(u,v) of the transform of the original image is obtained by


dividing the transform of the degraded image G(u,v), by the degradation
function
•since

• i.e. even if we know the degradation function, we cannot recover the un-degraded
image exactly as N(u,v) is a random function whose Fourier transform is not known
•At (u,v), H(u,v) ≈ 0
•Hence the second term becomes large
•Thus the noise N(u,v) is amplified
•One method to find the zero or small value problem is to limit the filter frequencies
to values near the origin.
•H(0,0) is equal to the average value of h(x,y)

•It is usually the highest value of H(u,v) in the frequency domain


•Thus by limiting the analysis to frequencies near the origin, there is less possibility of
facing zero values
Inverse Filtering Examples

• The Inverse Filter works fine if there is no noise

• H(u,v) is usually low-pass function.

• N(u,v) is uniform over whole spectrum.

• But, High-frequency Noise also will get


amplified 0.4x

0.2x
Inverse Filtering
Wiener Filtering
•It is also called as Minimum Mean Square Error filtering

•Here images & noise are taken as random processes

•The aim is to find an estimate f^ of the uncorrupted image


f such that the mean square error between them is
minimum

•This error is given as

Where E{.} is the expected value of the


argument
Wiener Estimator

x(t) h(t
s(t) ) y(t)

n(t)

Mean Square Error =


•Given the degraded image g, the Wiener filter is an optimal filter h
such
win
2
that E{|| f – hwing|| } is minimized.

•Assume that f and η are uncorrelated zero mean stationary 2D random


sequences with known power spectrum Sf and Sn. Thus,
•It is assumed that the noise & the image are uncorrelated
and that they have zero mean

•The gray levels in the estimate are linear function of the


levels in the degraded image

•Then the minimum error function in the frequency domain


is given as
• where

the degradation function

the complex conjugate of H(u,v)

the power spectrum of the noise

the power spectrum of the


Un-degraded image
•This result is known as Weiner Filter

•It is also referred to as or Least Square Error Filter

•The Weiner Filter does not have the same problem as the inverse filter with zeroes in the
degradation function, unless both H(u,v) & S(u,v) are zero for the same values of u & v

•The restored image in the spatial domain is given by the Inverse Fourier transform of the
frequency domain estimate F^(u,v)
Weiner Generalization

f(x,y) Degradation gx,y) Restoration f^(x,y)


s(t)
Function H Filter

η(x,y)

Degradation Restoration
Weiner Filt e r C h a r a
D r.V .An ga yar ka nn i
•If the noise is zero, then the noise power spectrum
vanishes & it becomes the Inverse Filter

•For spectral white noise, the noise power spectrum is


constant

•But, the power spectrum of the undegraded image is rarely


known

•In such cases an approximation is done as shown

Where K is a specified constant


Original f Degraded g

Inverse Filter Wiener Filter, K = 2


Wiener Filtering vs. Inverse Filtering

Full inverse filtering Limited inverse filtering Weiner filtering


Corrupted by Image Inverse Filtering WinerFiltering

Filtering - comparison

Noise variance magnitude less by 1

Noise variance magnitude less by 5

You might also like