Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
An Introduction to
Computer Vision
Computer Vision
Binary Images
Luke Fletcher
Luke Fletcher
Easy to analyse
2
An Introduction to
Moments of Objects
Luke Fletcher
x=
xI( x, y )
I(x , y )
Axis of
orientation
I( x, y)
(U
xx
U xy =
A = I ( x, y)
U yy =
x y
n m
i i
= x n ymI ( x, y )
x
(x x )(y y )I( x, y)
S x = xi
S y y = y i2
(y y ) I( x, y)
S y = yi
S x y = x i yi
U yy = S yy
S 2x
S
S y2
Sx Sy
U xy = S xy
S
Sx
S
Sy
U xx = S xx
y=
S x x = xi2
x =
S = 1
Luke Fletcher
2
U yy ) + (2.U xy )2
Computer Vision
(x x )2 I(x , y)
x
y I( x , y )
= atan2 2U
. , U xx U yy +
xy
Background
Centroid
Object
y=
An Introduction to
Calculating Moments
Computer Vision
An Introduction to
Central Moments
An Introduction to
Normalised moments
Computer Vision
Luke Fletcher
( x)
x
Luke Fletcher
( y) n I( x, y )
Computer Vision
N mn =
(x x )
x
( y y) n I( x, y )
( I ( x, y) )
x
m+ n+2
2
U mn = (x x) m ( y y) nI ( x, y )
x
An Introduction to
Hu invariant moments
An Introduction to
Computer Vision
Computer Vision
Connectedness
Luke Fletcher
H 1u= n2 0+n0 2
H 2u= (n2 0+ n0 2) 2 +4n21 1
H 3u= (n3 0+ 3n1 )2 2 + (3n2 1 n0 3)2
Luke Fletcher
x
x p x
x
x x x
x p x
x x x
4-connected
8-connected
Solutions:
0 1 0
1 0 1
0 1 0
In Matlab bwfill uses 8connectedness for the forground and 4connectedness for the background, or
vice versa .
6-connectedness: e.g. right-skewed 6connected neighbourhood
x x
x p x
x x 0
x x
x p x
x x
Labelling Connected
Components
An Introduction to
An Introduction to
Computer Vision
Computer Vision
Luke Fletcher
Luke Fletcher
Matlab
functions:
bwlabel
1
1
1
0
1
0
0
0
0
0
1
0
1
0
0
0
1
1
1
0
1
0
0
0
0
0
3
0
2
0
0
0
a
b p c
d
Uses of Morphological
Operators
10
An Introduction to
An Introduction to
Computer Vision
Luke Fletcher
Computer Vision
Luke Fletcher
thin,
thicken,
find boundaries,
find skeletons (medial axes),
convex hulls, and more.
12
An Introduction to
An Introduction to
Dilation
Computer Vision
Luke Fletcher
Computer Vision
Luke Fletcher
Dilation
Erosion
Br
A
14
An Introduction to
Erosion
An Introduction to
Computer Vision
Combining
Dilation and Erosion
Luke Fletcher
Luke Fletcher
B
A
Computer Vision
Opening,
Particularly important
Closing,
Thickening,
Thinning,
Skeletonisation,
Br
16
An Introduction to
Intuitive Interpretations
An Introduction to
Computer Vision
Computer Vision
Closing
Luke Fletcher
Luke Fletcher
close(A, B) = er(dil(A,B), B)
A
smoothes contours,
enlarges narrow gaps,
eliminates thin protrusions.
dilation
erosion
close(A,B)
Closing
fills narrow gaps, holes, and small breaks.
17
18
An Introduction to
An Introduction to
Computer Vision
Opening
Computer Vision
Idempotency
Luke Fletcher
Luke Fletcher
open(A,B) = dil(er(A,B),B)
= {Bx|BxA}
B
open(open(A,B),B) = open(A,B)
close(close(A,B),B) = close(A,B)
erosion
dilation
open(A,B)
19
20
An Introduction to
Additional Structuring
Operations
An Introduction to
Find Boundary
Computer Vision
Luke Fletcher
Computer Vision
Luke Fletcher
boundary(A,B) = A - er(A, B)
A
erosion
difference
boundary(A,B)
21
22
An Introduction to
Region Filling
An Introduction to
Computer Vision
Let C0 = p
Calculate
Ck = dil(Ck-1,B) A c ,
Computer Vision
Solution
Luke Fletcher
A
B
23
Luke Fletcher
A
for k = 1,2,
24
An Introduction to
Skeletonisation
Computer Vision
Luke Fletcher
where
B is structuring element,
er(A,kB) = k successive erosions of A,
K = number of iterations to completely erode A.
25