Topic4 Linear+Filters
Topic4 Linear+Filters
bad good
Linear filters, smoothing & edge detection 3
Poor illumination
bad good
bad good
bad good
bad good
As is Histogram Equalized
zk − z1
z'= ( z − a) + z1
b−a
zk − z1 z1b − zk a
z' = z+
b−a b−a
1 ⎛ (x 2 + y 2)⎞
Gσ (x, y) = exp⎜⎜− ⎟
⎟
2πσ ⎝ 2 σ 2
⎠
Standard deviation
(pixels)
H ij =
1 ⎜
exp −
( (
⎛ i − k −1 2 + j − k −1 2
) ( ) ) ⎞
⎟
2πσ ⎜ 2σ 2 ⎟
⎝ ⎠
Linear filters, smoothing & edge detection 15
Effect of varying σ
Degree of added noise
Degree of smoothing
Linear filters, smoothing & edge detection 16
Linear, Space-Invariant
(LSI) systems
Input Output
Linear system
δ(x,y) g(x,y)
h [i, j ] = f [i, j ] * g [ k, l ]
n m
= ∑∑ f [k, l ] g [i − k, j − l ]
k=1 l=1
h[i, j ] = Ap1 + Bp2 + Cp3 + Dp4 + Ep5 + Fp6 + Gp7 + Hp8 + Ip9
EXPLANATION NEXT…
y( t ) + y( t ) + y( t ) = f ( t )
output input
⎛ ⎞
⎜ ⎟
⎜ 1 −0.5t ⎛ 3 ⎟⎞
h(t ) = e sin ⎜ t ⎟⎟ , t > 0
⎜
⎜ 3 4 ⎠⎟
⎜ ⎝ ⎟
⎝ 4 ⎠
• Next, we assume
superposition holds and that
the response of a system to a
string of impulses is just the
sum of response to the
individual impulses.
f (iΔt )
• The area of the impulse at time i.Δt is:
f (iΔt )Δt
• Therefore, the delayed and shifted response is:
+∞
y (t ) = ∫ f (τ )h(t − τ )dτ
0
+∞ +∞
∫
0
f (τ )h(t − τ )dτ = ∫ h(τ ) f (t − τ )dτ
0
>>Added noise
Chapter 5 (F&P)
∂I
= K(∂ /∂ x) ∗∗I
∂x
⎛∂ S ⎞
( ) ( )
K(∂ /∂ x ) ∗∗( S ∗∗I ) = K(∂ /∂ x) ∗∗S ∗∗I = ⎜ ⎟ ∗∗I
⎝∂ x ⎠
Gσ 1 ∗∗Gσ 2 = G
σ 12 +σ 22
(∇ f )( x, y ) = ∂x 2 + ∂y 2
2 ⎢1 -4 1 ⎥
⎢ ⎥
⎢⎣ 0 1 0 ⎥⎦
Laplacian of a Gaussian
LoG filter
Laplacian filter
Retina LoG
A B
LoG Kernel
Sharpened:
A+B
Problem: T1:
Solution: T1:
T2:
• Roberts
• Sobel
• Prewitt
• Kirsch
• Robinson
• Laplace
Read an image
Apply blur (gaussian or similar)
Product of
Eigenvalues
cos(2π ( ux + vy )) + isin(2π ( ux + vy ))
MECH 642 Linear filters, smoothing & edge detection Slide 108
Sampling
• The number of samples
that are taken when
converting from a
continuous signal to a
discrete one refers to as
sampling.
• During sampling some
information is lost:
sample2D(F(x,y)) = F
⎧⎪ ∞ ∞ ⎫⎪
= f (x, y)⎨ ∑ ∑δ (x − i, y − j)⎬
⎪⎩ i= −∞ j=−∞ ⎪⎭
⎛⎧⎪ ∞ ∞ ⎫⎪⎞
= F ( f (x, y)) ∗ F ⎜⎜⎨ ∑ ∑δ (x − i, y − j)⎬⎟⎟
⎝⎪⎩ i= −∞ j=−∞ ⎪⎭⎠
⎛⎧ ∞ ∞ ⎫⎞
= F ( f (x, y)) ∗ F ⎜⎜⎨ ∑ ∑δ (x − nTi , y − nT j )⎬⎟⎟
⎝⎩ n=−∞ n=−∞ ⎭⎠
∞
k k
= ∑ F ∗ δ (u − ,v − )
k=−∞
Ti Tj
∞
F ( sample2D ( f ( x, y ))) = ∑ F(u − k ⋅ freq , v − k ⋅ freq )
i j
k =-∞
Original image
sub-sampled
Magnitude of
Fourier transform