Professional Documents
Culture Documents
Digital Image Processing Image Filtering
Digital Image Processing Image Filtering
O. Le Meur
olemeur@irisa.fr
Univ. of Rennes 1
http://www.irisa.fr/temics/staff/lemeur/
January 2, 2011
1
Table of Content
1 Introduction
2 Point-to-point transformation
5 Conclusion
2
Introduction
Point-to-point transformation
Linear ltering (neighborhood operator)
Non Linear ltering
Conclusion
Introduction
1 Introduction
2 Point-to-point transformation
5 Conclusion
3
Introduction
Point-to-point transformation
Linear ltering (neighborhood operator)
Non Linear ltering
Conclusion
Introduction: image transformation
Note that the complexity increases with the size of the considered neighborhood...
4
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Point-to-point transformation
1 Introduction
2 Point-to-point transformation
Spatial coordinates-based
transformations
Pixel values-based transformations
3 Linear ltering (neighborhood
operator)
5 Conclusion
5
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Spatial coordinates-based transformations
Remark:
This section is composed of several pictures extracted from
http://eeweb.poly.edu/~onur/lectures/lectures.html.
Let im[x , y ] be an input image of size N × N .
A spatial coordinates-based transformation, also called warping, aims at providing an
image IM [k , l ] from the input image im[x , y ]:
IM [k , l ] = im[x (k , l ), y (k , l )]
x (k , l ) and y (k , l ) are the transformations or the pixel warping functions. These functions
just modify the spatial coordinates of a pixel not its value;
6
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Transpose
7
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Vertical Flip
The vertical ip tansformation is given by
x (k , l ) = N −k
y (k , l ) = l
8
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Translation
The translation tansformation is given by
x (k , l ) = k + Tk
y (k , l ) = l + Tl
where Tk and Tl are the transalation values for the x-axis and the y-axis respectively.
In the example below, we have (Tl = −50)
IM [k , l ] = im[x (k , l ), y (k , l )]
IM [k , l ] = im[k , l + Tl ]
where [x0 , y0 ] is the spatial coordinates of the center of the rotation and θ the angle.
10
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Wave
x (k , l ) = k x (k , l ) = k + α × sin(β × k )
y (k , l ) = l + α × sin(β × l ) y (k , l ) = l
11
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Warp and swirl
d (k − x0 )2 + (l − y0 )2
q
=
π
θ = r
512
If r −→ 0, θ is small...
12
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Glass eect
A glass eect is obtained by adding a small and random displacement to each pixel:
x (k , l ) = k + (RAND (1, 1) − 1/2) × 10
y (k , l ) = l + (RAND (1, 1) − 1/2) × 10
13
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Summary
All 2D linear transformations:
x a b k
y =
c d l
Scale, rotation, mirror...
Properties:
Origin maps to origin;
Lines map to lines;
Ratios are preserved...
Ane transformations (linear transf. + translation):
x a b c k
y = d e f l
w 0 0 1 w
Properties:
Origin does not necessarily map to origin;
Lines map to lines;
Ratios are preserved...
14
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Summary
15
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Pixel values-based transformations
16
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Histogram
An image histogram is a graphical representation of the tonal distribution in a digital
image. It plots the number of pixels for each tonal value.
Histogram gives information about the global distribution of an image.
Histogram plots the number of pixels in the image (vertical axis) with a particular
brightness value (horizontal axis).
17
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Histogram
18
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Histogram
19
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Histogram equalization
The goal is to increase the global contrast of images, especially when the usable data
of the image is represented by close contrast values.
Consider a discrete grayscale image {x } and let ni be the number of occurrences of
gray level i .
The probability of an occurrence of a pixel of level i in the image is
px (i ) = p(x = i ) = nni , 0 ≤ i < L, L being the total number of gray levels in the
image, n being the total number of pixels in the image.
Let us also dene the cumulative distribution function: cdfx (i ) = ij =0 px (j ).
P
20
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Negative image
The negative image is obtained by f (p ) = 255 − p (pixel values are coded on 8 bits).
IM [k , l ] = f (im[k , l ])
IM [k , l ] = 255 − im[k , l ]
21
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Piece continuous transformation
α1 × p 0 ≤ p < a1
α2 × (p − a1 ) a 1 ≤ p < a2
..
f (p ) = .
αi (p − ai −1 ) + i −1 α (α − α ai − 1 ≤ p < ai
P
1 j j j −1
j
=
..
.
Obviously, we have:
αi < 1, compression;
αi > 1, stretching.
22
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Piece continuous transformation
f (p) = α2 (p − a1 ) + α1 a1 , a1 ≤ p < a2
α3 (p − a2 ) + (α2 (a2 − a1 ) + α1 a1 ), a2 ≤ p ≤ 255
23
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Piece continuous transformation
Example of contrast stretching:
Let imaging that α1 and α2 are null. The ltered image contains only grey level
belonging to [a1 , a2 ]. We just keep a slice of the image.
24
Introduction
Point-to-point transformation Spatial coordinates-based transformations
Linear ltering (neighborhood operator) Pixel values-based transformations
Non Linear ltering
Conclusion
Piece continuous transformation
Binary thresholding:
0 im[x,y]<T
IM [x , y ] = 255 otherwise
Gamma correction:
IM [x , y ] = im[x , y ]γ
25
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Linear ltering with neighborhoods operator
1 Introduction
2 Point-to-point transformation
5 Conclusion
26
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Denition
Two examples:
27
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Denition
with h is the 2D impulse response called also the Point Spread Function (PSF) or the
kernel of the transform. It is composed of the lter coecients (nite length).
The gain of the lter is equal to
g= h(i , j )
X X
k ∈V (x ,y ) l ∈V (x ,y )
28
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Denition
IM [x , y ] = h(k , l ) im[x − k , y − l ]
X X
k ∈V (x ,y ) l ∈V (x ,y )
| {z } | {z } | {z }
Output Filter coe. Input
29
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Denition
k =−N l =−N
30
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Average lter
The most simple low-pass lter is the local averaging operation. The main eect of a
low-pass lter is a blurring. The size of the kernel is (2N + 1) × (2N + 1):
1 −N ≤ k , l ≤ − N
(
h (k , l ) = (2N +1)2
0 Otherwise
For N = 1, the convolution kernel is given by:
1 1 1
H = 1 1 1 1
9 1 1 1
31
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Average lter
Three examples of averaging for dierent sizes of kernel. From the left-hand side to
the right-side, N = {1, 3, 8}:
The amount of blur increases with the size of the kernel (the number of operation too
O(N 2 )). In order to lter pixels located near the edges of the image, edge pixel values
are replicated to give sucient data (this is not the case here).
32
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian lter
The kernel h is given by the following function
h(x , y ) = 1 2 exp x2 + y2
−
2πσ 2σ2
Each pixel's new value is set to a weighted average of that pixel's neighborhood. The
original pixel's value receives the heaviest weight (having the highest Gaussian value)
and neighboring pixels receive smaller weights as their distance to the original pixel
increases. This results in a blur that preserves boundaries and edges better than other,
more uniform blurring lters.
Note that the lter support is truncated...
33
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian lter
h(x , y ) = 1 2 exp x2 + y2
−
2πσ 2σ2
Example of kernel:
σ = 0.84089642, N = 3:
Note that the center element (at [4, 4]) has the largest value, decreasing
symmetrically as distance from the center increases.
0.00000067 0.00002292 0.00019117 0.00038771 0.00019117 0.00002292 0.00000067
0.00002292 0.00078633 0.00655965 0.01330373 0.00655965 0.00078633 0.00002292
0.00019117 0.00655965 0.05472157 0.11098164 0.05472157 0.00655965 0.00019117
H = 0.00038771 0.01330373 0.11098164 0.22508352 0.11098164 0.01330373 0.00038771
0.00019117 0.00655965 0.05472157 0.11098164 0.05472157 0.00655965 0.00019117
0.00002292 0.00078633 0.00655965 0.01330373 0.00655965 0.00078633 0.00002292
Note that 0.22508352 (the central one) is 1177 times larger than 0.00019117
which is just outside 3σ.
34
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian lter
h(x , y ) = 1 2 exp x2 + y2
−
2πσ 2σ2
Example of kernel:
σ = 0.6, N = 1:
1 2 1
H = 1 2 4 2
16 1 2 1
σ = 1, N = 2:
1
9 18 9 1
1 9 81 162 81 9
H= 18
162 324 162 18
1444 9 81 162 81 9
1 9 18 9 1
35
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian lter
36
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian lter
37
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Other low pass lters
2D Pyramidal lter:
1 2 3 2 1
2 4 6 4 2
H= 1 3
6 9 6 3
81 2 4 6 4 2
1 2 3 2 1
Conic lter:
0 0 1 0 0
0 2 2 2 0
H= 1 1
2 5 2 1
25 0 2 2 2 0
0 0 1 0 0
38
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
High-pass lter
The high-pass ltered image can be thought of as the original image minus the low
pass ltered image.
N N
IM [x , y ] = im[x , y ] − h(k , l )im[x − k , y − l ]
X X
k =−N l =−N
N N
IM [x , y ] = h(k , l )im[x − k , y − l ]
X X
k =−N l =−N
with h the convolution kernel.
0 −1 0 −1 −1 −1 1 −2 1
39
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
High-pass lter
Three examples of high-pass ltering for dierent sizes of kernel. From the left-hand
side to the right-side, N = {1, 3, 8}:
When the kernel's size increases, the ltering is more important and then the result is
less noisy.
40
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
f 0 (x ) = ∆lim f (x + ∆x ) − f (x )
x →0 ∆x
Local variations of intensity are an important source of information in image
processing. These local variations are gradient (it measures the rate of change of the
function):
∂ im ∂ im
∇im[k , l ] = [k , l ], [k , l ]
∂x ∂y
In the illustration below: GX = ∂ im
∂x
[ k , l ] and GY y [k , l ].
= ∂∂im
41
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
GX x [k , l ]:
= ∂∂im Kernel = hx = −1 1
∂ im
[k , l ] ≈ im[k + 1, l ] − im[k , l ]
∂x
GY y [k , l ]
= ∂∂im Kernel = hy = −1 1 T
∂ im
[k , l ] ≈ im[k , l + 1] − im[k , l ]
∂y
However, most of the time, we use the following kernel −1 0
1 and
T
−1 0 1 (phase =zero). Below, from the left-hand side to the right: original,
−1 1 , −1 0 1 .
42
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
However, these lters are very sensitive to the noise. In order to enhance the
robustness, these lters are combined with a blurring lter:
−1 0 1
hx = −2 0 2
−1 0 1
−1 −2 −1
hy = 0 0 0
1 2 1
43
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
IMy [k ,l ]
Its orientation: arg (∇IM [k , l ]) = arctan
IMx [k ,l ]
From left-hand side to the right: IMx , IMy and the norm.
44
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
The Laplacian of a picture is the second derivative:
∂ 2 im
[k , l ] ≈ im[k + 1, l ] + im[k − 1, l ] − 2 × im[k , l ]
∂2x
∂ 2 im
[k , l ] ≈ im[k , l + 1] + im[k , l − 1] − 2 × im[k , l ]
∂2y
∂ 2 im ∂ 2 im
∇2 im[k , l ] = [k , l ] + 2 [k , l ]
∂ x2 ∂ y
∇2 im[k , l ]
≈ im[k + 1, l ] + im[k − 1, l ] + im[k , l + 1] + im[k , l − 1] − 4 × im[k , l ]
For a 4-neighborhood, the kernel is given by
0 1 0
h = 1 −4 1
0 1 0
We can extent this kernel to compute the laplacian in all directions (8-neighborhood):
1 1 1
h = 1 −8 1
1 1 1
45
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Dierentiation lter
The second order derivatives have a stronger response to ne details (e.g. thin lines)
than the rst order derivatives.
46
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Frequency domain ltering
IM [x , y ] = (im ∗ h)[x , y ]
im1 [x , y ] ∗ im2 [x , y ] →
F
IM1 [u, v ] × IM2 [u, v ]
im1 [x , y ] × im2 [x , y ] →
F
IM1 [u, v ] ∗ IM2 [u, v ]
When the size of the kernel is large, it is better to apply the lter in the frequency domain.
47
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Frequency domain ltering
We can spatially lter an image by Fourier transforming and applying a frequency
lter:
IM [x , y ] = im[x , y ] ∗ h[x , y ]
IM
˜ [u , v ] = IM [u, v ] × H [u, v ]
48
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Ideal low pass lter
From the left-hand side to the right: Ideal low pass lter transfert function, lter
displayed as an image, lter radial cross section.
1 D (u, v ) ≤ D0
H (u, v ) =
0 D (u, v ) > D0
With D the euclidean distance from the spectrum center ( N2 , N2 ).
49
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Ideal low pass lter
50
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Butterworth low pass lter
1
H (u , v ) =
D (u ,v ) 2n
1+
D0
51
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Butterworth low pass lter
52
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Gaussian low pass lter
D 2 (u, v )
H (u, v ) = exp −
2D02
with D0 = σ. Gaussian low pass ltering:
Butterworth
Gaussian
54
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
High pass ltering in the frequency domain
55
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
High pass ltering in the frequency domain
Ideal high-pass lters enhance edges but suer from ringing artefacts, just like
Ideal LPF;
smoother results with the two others.
56
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Frequency domain ltering
57
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Laplacian in the frequency domain
We remind (see previous lecture):
∂ 2 im ∂ 2 im
∇2 im[k , l ] = [k , l ] + 2 [k , l ]
∂2x ∂ y
d n x (t ) F
dt n −→ (j 2π f ) X (f ).
n
58
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
Laplacian in the frequency domain
59
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
The cortex transform
The cortex transform is rst described by A. Watson as the modeling of the neural
response of retinal cells to visual stimuli.
The cortex lter in the frequency domain is
cortex[bi ,θi ] (ρ, θ) = dombi × fanθi (θ)
Where,
bi and θi represent the frequency band and the index of orientation, respectively;
(ρ, θ) are polar coordinates.
The cortex transform decomposes the input image im[x , y ] into a set of subband
images B[bi ,θi ] [k , l ]:
B[bi ,θi ] [k , l ] F −1 cortex[bi ,θi ] (ρ, θ) × F {im[x , y ]}
=
60
Introduction Denition
Point-to-point transformation Low-pass lters in spatial domain
Linear ltering (neighborhood operator) High-pass lters in spatial domain
Non Linear ltering Dierentiation lter in spatial domain
Conclusion Frequency domain ltering
The cortex transform
Frequency responses of several cortex lters (brightness represents gain for the given
spatial frequency).
61
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Introduction
1 Introduction
2 Point-to-point transformation
5 Conclusion
62
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Denition
The most important drawback of the linear ltering is that all pixels in the image are
modied by the ltering process.
To overcome this problem, non linear ltering is used. It aims, for instance, to protect
some parts of the picture having particular features (edges...) or to remove data
without blurring the whole image (impluse noise).
63
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Rank ltering
64
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Special case of a generalized rank lter
If all weights of the linear lter are null, except one in the median position. This lter
is called a median lter.
IM [x , y ] = MED (im[xi , yi ]|[xi , yi ] ∈ V [x , y ])
V [x , y ] is the neighborhood (a set of N samples).
if the size of the neighborhood is odd, the output value is the median value;
if the size is even, the output value is the average of the two middles values.
The median lter is very ecient in ltering signals corrupted by impulsive noise but it
is not very ecient in gaussian noise environment.
65
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Special case of a generalized rank lter
However, when the number of the samples is large, the ordering procedure becomes
cumbersome.
Idea: the median lter is taken over the outputs of several FIR substructures and the
number of the substructures is much smaller than the number of the data samples
inside the lter window.
IM [x , y ] = MED (y (1), . . . , y (m))
where, m is linear FIR lters.
66
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Homomorphic ltering
Homomorphic ltering is a generalized technique for signal and image processing, in-
volving a nonlinear mapping to a dierent domain in which linear lter techniques are
applied, followed by mapping back to the original domain.
In many case, we want to remove shading eects from an image. The objective is then
to enhance high frequencies;
to attenuate low frequencies (but ne details have to be preserved).
Consider the following model of image formation:
im[x , y ] = i (x , y ) × r (x , y )
| {z } | {z }
illumination reection
The illumination component varies slowly and then aects low frequencies mostly;
The reection component varies faster and then aects the high frequencies
mostly.
67
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Homomorphic ltering
im[x , y ] = i [x , y ] × r [x , y ]
Fourier transform
IM [u, v ] = I [u , v ] ∗ R [u , v ]
68
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Homomorphic ltering
What is the solution to separate LF and HF? We can take the log !
im[x , y ] = i [x , y ] × r [x , y ]
log (im[x , y ]) = log (i [x , y ] × r [x , y ])
log (im[x , y ]) = log (i [x , y ]) + log (r [x , y ])
1 Take the log and apply the Fourier tansform to the new signal:
log (im[x , y ]) = log (i [x , y ]) + log (r [x , y ])
F (log (im[x , y ])) = F (log (i [x , y ])) + F (log (r [x , y ]))
Z [u , v ] = Ilog [u, v ] + Rlog [u, v ]
2 Filtering in the frequency domain: H [u , v ]
Z [u , v ] × H [u , v ] = Ilog [u, v ] × H [u, v ] + Rlog [u, v ] × H [u, v ]
3 Take the inverse Fourier transform and apply the exponential function:
69
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Homomorphic ltering
γH
H [u , v ] = γL + 2n
1 + √ D20
u +v 2
with,
γL a parameter that aects low frequencies;
γH a parameter that aects high frequencies;
70
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Adaptive ltering
71
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Conditional mean
IM [x , y ] h(k , l ) im[x − k , y − l ]
X X
=
k ∈V (x ,y ) l ∈V (x ,y )
| {z } | {z } | {z }
Output Filter coe. Input
Principle: pixels in a neighbourhood are averaged only if they dier from the central
pixel by less than a given threshold.
1 if |IM [x − k , y − k ] − IM [k , l ]| < TH
h(k , l ) =
0 Otherwise.
Example with a neighbourhood equal (2 × 3 + 1)(2 × 3 + 1),TH = 32:
72
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Anisotropic Kuwahara ltering
73
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Anisotropic Kuwahara ltering
74
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Bilateral ltering
The idea is to use a weighted ltering but with an outlier rejection.
Pixels that are very dierent in intensity from the central pixel are weighted less even
though they may be in close proximity to the central pixel.
This is applied as two Gaussian lters at a localized pixel neighborhood:
1
IM [x , y ] im[k , l ] c[x ,y ] [k , l ]s[x ,y ] [k , l ]
X
=
k ,l c[x ,y ] [k , l ]s[x ,y ] [k , l ]
P
k ,l | {z }
h[k ,l ]
75
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Bilateral ltering
76
Introduction Denition
Point-to-point transformation Rank ltering
Linear ltering (neighborhood operator) Homomorphic ltering
Non Linear ltering Adaptive ltering
Conclusion
Bilateral ltering
Low contrast texture has been removed and edges are well preserved.
77
Introduction
Point-to-point transformation
Linear ltering (neighborhood operator)
Non Linear ltering
Conclusion
Conclusion
1 Introduction
2 Point-to-point transformation
5 Conclusion
78
Introduction
Point-to-point transformation
Linear ltering (neighborhood operator)
Non Linear ltering
Conclusion
Conclusion
79