Beruflich Dokumente
Kultur Dokumente
https://my.eurecom.fr/jcms/p0_2027226/en/improc
jean-luc.dugelay@eurecom.fr
jean-luc.dugelay@eurecom.fr
Typical Sequence
• Pre-processing
– Noise reduction: low-pass Filtering
• Processing
– Gradient maps + Threshold
– Gradient based descriptor
• Post-processing
– Edge thinning, closing
– Outlier removal
• Representation & Description
– Hough Transform
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 1
3
Spatial Masks
w1 w2 w3
( x −1, y −1) ( x −1, y) ( x −1, y +1) T [ f (x, y)] = w1 f ( x −1, y −1) + w2 f ( x −1, y)
w4 w5 w6 + w3 f ( x −1, y +1) + w4 f ( x, y −1)
( x, y −1) ( x, y) ( x, y + 1) + w5 f ( x, y) + w6 f ( x, y + 1) + w7 f ( x + 1, y −1)
w7 w8 w9 + w8 f ( x + 1, y) + w9 f ( x + 1, y +1)
( x + 1, y −1) ( x + 1, y) ( x + 1, y + 1)
jean-luc.dugelay@eurecom.fr
1 1
1 1 1
4 4 1
1 1 1 1 1
9
averaging 2x2 4 4 1 1 1 averaging 3x3
Image smoothing k − 1 k − 1
+ noise reduction ∑ ∑
p = 0 q = 0
h (p , q ) = 1
- edge smoothing
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 2
5
5x5 7x7
jean-luc.dugelay@eurecom.fr
Median Filtering
Algorithm
1. Classify S = { f ( xj , yj ), ( xj , yj ) ∈W }
2. f ' ( xi, yi ) = med ( S )
Non linear,
med (α .I1 + β .I 2 ) ≠ α .med ( I1 ) + β .med ( I 2 )
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 3
7
f ( x, y )
∂f
∇f ( x, y ) = ∂∂x
f
∂y
2
∂f ∂f
2
∇f ( x, y ) = +
∂x ∂y
∂ 2 f ( x, y ) ∂ 2 f ( x, y )
∇ 2 f ( x, y ) = +
∂x 2 ∂y 2
Image Sharpening
jean-luc.dugelay@eurecom.fr
Gradient Pattern
• Gradient 0 0 0 0 1 0
Gx 1 0 − 1 G y 0 0 0
0 0 0 0 − 1 0
1 0 − 1 1 0 − 1 if ∇f ( x, y ) > Threshold at ( x0 , y0 )
1 0 − 1 2 0 − 2 then ( x0 , y 0 ) is an edge point
else ( x0 , y0 ) is not an edge point
1 0 − 1 1 0 − 1
Prewitt Sobel
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 4
9
Gradient Pattern
10 10 10 10
10
10 10 10 10
10
0 0 0 0
0
10 10 10 10 10
−10 −10 −10 −10
−10
10
−10 10 10 6 2
−10 −10 −10 −10
8 4 0 −4 −8
10 10 10 10 0
0° −2 −6 −10 −10 −10 10 10 10 0 −10
−10 −10 −10 −10 −10
10 10 0 −10 −10
22.5°
10 0 −10 −10 −10
0 −10 −10 −10 −10
45°
jean-luc.dugelay@eurecom.fr
10
Questions
1 1 1 1 2 1
1
1
1 1 1 2 4 2
9 16
1 1 1 1 2 1
jld@eurecom.fr 5
11
p −1
LBP = ∑ s ( g p − g c ) 2 p
p =0
1 if x ≥ 0
s ( x) =
0, otherwise
χ 2 (S , M ) = ∑
n
(Si − M i )2
Widely used to compare two face images i Si + M i
12
Laplacian Pattern
• Laplacian
0 +1 0
+ 1 - 4 + 1
0 + 1 0
Edges: zero-crossing points
∂f f ( x + a, y ) − f ( x − b, y )
( x, y ) ≅
∂x a+b
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 6
13
jean-luc.dugelay@eurecom.fr
14
Hough Transform
Originally designed for Line detection
but can also be used for any analytical curve (circle, ellipse, etc.)
IMAGE J HOUGH H
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 7
15
jean-luc.dugelay@eurecom.fr
16
• From m to 1
Any “m-uplets” from the image space is associated to a parametric curve {ai} in the Hough space;
• From 1 to n
Any pixel (xi,yi) from the image space is associated to m parametric curves {ai} in the Hough space;
• From m to m’
Any “m-uplets” from the image space is associated to m’ parametric curves {ai} in the Hough space;
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 8
17
• m=2
Mi(xi,yi) and Mj(xj,yj)
x i y j − x j yi x j − xi
ρk = θl = − Arctg
( y j − yi )2 + (x j − x i )2 y j − yi
jean-luc.dugelay@eurecom.fr
18
Algo.
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 9
19
Quad tree
Bounding box
jean-luc.dugelay@eurecom.fr
20
Quad tree
root
A0,1,1
A0,0 A0,1 A0,2 A0,3
A0,0
A0,1,2,3
A0,1,1 A0,1,2
A0,3 A0,2
A0,1,2,3
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 10
21
• Split:
Split the picture into smaller and smaller areas until reaching
a given uniformity criterion;
• Merge:
Merge neighboring areas according to a similarity criterion
(mean, variance, etc.);
• Split & Merge:
Combination of both previous approaches
jean-luc.dugelay@eurecom.fr
22
1 1 1 1 1 1 1 1 Split
1 1 1 1 1 1 1 2
1 1 1 1 1 2 2 2
1 1 1 1 2 2 2 2
1 1 1 1 1 2 2 2
1 1 1 1 1 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
∑ (g ( x ) − m ( R l ) ) < Threshold
1 2
TEST : E ( R l ) = i _1
card [ R l ] xi∈ Rl
jld@eurecom.fr 11
23
2.0 2.0
∑ (g ( x ) − m ( R l ) ) < Threshold
1 2
TEST : E ( R l ) = i _1
card [ R l ] xi∈ Rl
24
0 0 0 0 0 0 .3 .3 Split
0 0 0 0 0 0 .3 .7
0 0 0 0 .8 .2 0 0
0 0 0 0 .2 .2 0 0
0 0 0 0 .9 .1 .1 .1
0 0 0 0 .9 .1 .1 .1
0 0 0 0 .1 .1 .1 .1
0 0 0 0 .1 .1 .1 .1
∑ (g ( x ) − m ( R l ) ) < Threshold
1 2
TEST : E ( R l ) = i _1
card [ R l ] xi∈ Rl
jld@eurecom.fr 12
25
Merge
Region adjacency graph
1.0 1.0 1.3 0.9
0.9
1.43
2.6 1.9
1.8 2.0 0.9
0
0.9 2.6
1.0 1.0 1.9 0 1.8
4.2
2 2
2.0 2.0
1.8
0
∑ (g(x ) − µ(R , R ))
2
E(R l , R k ) = i l k
x i ∈R l ∪ R k
1
µ(R l , R k ) = ∑ g(x i )
card{R l ∪ R k } x i ∈R l ∪R k
jean-luc.dugelay@eurecom.fr
26
Merge
Region adjacency graph
µ=1.0 1.3
0
2.6 1.9
1.8 2.0 0.9
0
0 2.6
1.0 1.0 1.9 0 1.8
4.2
2 2
2.0 2.0
1.8
0
∑ (g(x ) − µ(R , R ))
2
E(R l , R k ) = i l k
x i ∈R l ∪ R k
1
µ(R l , R k ) = ∑ g(x i )
card{R l ∪ R k } x i ∈R l ∪R k
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 13
27
L
SEQ(L) = ∑ ∑ (g(x ) − µ(R ))
2
> Threshold _ 2
l =1 x i ∈R l
i l
Merge
Region adjacency graph
µ=1..03
15.9
µ=1.91
∑ (g(x ) − µ(R , R ))
2
E(R l , R k ) = i l k
x i ∈R l ∪ R k
1
µ(R l , R k ) = ∑ g(x i )
card{R l ∪ R k } x i ∈R l ∪R k
jean-luc.dugelay@eurecom.fr
28
union
intersection
complementary
inclusion
difference
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 14
29
• Object A
• Structuring element Bp
• EROSION { }
er (A, Bp ) ≡ p B p ⊂ A
• DILATATION {
dil(A, Bp ) ≡ p B p ∩ A ≠ ∅ }
• OPENING dil(er(A,Bp),Bp)
• CLOSING er(dil(A,Bp),Bp)
jean-luc.dugelay@eurecom.fr
30
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 15
31
lake
gulf
jean-luc.dugelay@eurecom.fr
32
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 16
Erosion
Erosion
jld@eurecom.fr 17
Opening and Closing
OPENING: The
original image
eroded twice and
dilated twice
(opened). Most
noise is removed
CLOSING: The
original image
dilated and then
eroded. Most
holes are filled.
36
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 18
37
http://extra.cmis.csiro.au/IA/changs/motion/
jean-luc.dugelay@eurecom.fr
38
Apparent motion
Optical flow
between two consecutive image frames taken at t and t'(t +δt)
d x i ≡ x 'i − x i
d yi ≡ y'i − y i
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 19
39
{z _ f , pan x , pan y }:
STEP 2. Global Interpretation x' x pan x
∀i, i = z _ f . i +
y
i' y i pan y
jean-luc.dugelay@eurecom.fr
40
I ( x, y, t ) = I ( x + δx, y + δy, t + δt )
Assuming that δx and δy are smalls
I(x,y,t) with Taylor series can be developed to get:
∂I ∂I ∂I
I ( x + δx, y + δy, t + δt ) = I ( x, y, t ) + δx + δy + δt + H .O.T .
∂x ∂y ∂t
∂I ∂I ∂I ∂I ∂I ∂I
δx + δy + δt = 0 Vx + Vy = −
∂x ∂y ∂t ∂x ∂y ∂t
jld@eurecom.fr 20
d (i) = d (i−1) (p, t) − ε .sign {DFD (p, t, d (i−1) )}.sign {∇ I ( x − dx(i−1) , y − dy(i−1) , t − 1)}
41
Pixel #6 at time t (from which position at t-1 does this pixel come from ?)
Assumption: d(0) = 0
Gradients
Temporal I(6,t) - I(6,t-1) x x x x x x x x x x
t-1
position 1 2 3 4 5 6 7 8 9 10
Gain:ε = 1
Temporal > 0
Spatial > 0
jean-luc.dugelay@eurecom.fr
d (i) = d (i−1) (p, t) − ε .sign {DFD (p, t, d (i−1) )}.sign {∇ I ( x − dx(i−1) , y − dy(i−1) , t − 1)}
42
Pixel #6
d(1) = d(0) - 1 = -1
Gradients
Temporal I(6,t) - I(7,t-1) x x x x x x x x x x
t-1
position 1 2 3 4 5 6 7 8 9 10
jean-luc.dugelay@eurecom.fr
jld@eurecom.fr 21