Digital Image Processing: Lecture # 3 Connected Component Analysis
Digital Image Processing: Lecture # 3 Connected Component Analysis
Lecture # 3
Connected Component Analysis
1
Determine different regions in the
image
2
Connectivity
Establishing boundaries of objects and components in an image
Group the same region by assumption that the pixels being the same
color or equal intensity
Two pixels p & q are connected if
They are adjacent in some sense
If their gray levels satisfy a specified criterion of
similarity
3
Connectivity
V: Set of gray levels used to define the criterion of similarity
4-connectivity
4-connectivity
Set
Setofofgray
graylevels
levelsVV=={1}
{1}
4
Connectivity
V: Set of gray levels used to define the criterion of similarity
8-connectivity
8-connectivity
Set
Setofofgray
graylevels
levelsVV=={1}
{1}
5
Connectivity
V: Set of gray levels used to define the criterion of similarity
m-connectivity
m-connectivity(Mixed
(MixedConnectivity)
Connectivity)
If gray level
6
Example: m – Connectivity
Note: Mixed connectivity can eliminate the multiple path connections that often
occurs in 8-connectivity
7
Paths
Path: Let coordinates of pixel p: (x, y), and of pixel q: (s, t)
where (x0, y0) = (x, y) & (xn,yn) = (s, t), and (xi,yi) is adjacent
to (xi-1,yi-1) 1≤i ≤n
8
Test Yourself
CC labeling – 4 Connectivity
Process the image from left to
right, top to bottom:
1.) If the next pixel to process is 1
i.) If only one of its neighbors
(top or left) is 1, copy its label.
10
CC labeling – 4 Connectivity
11
CC labeling – 4 Connectivity
12
CC labeling – 8 Connectivity
Same
Samealgorithm
algorithmbut
butexamine
examinealso
alsothe
theupper
upperdiagonal
diagonalneighbors
neighborsofofpp
13
CC labeling – 8 Connectivity
Background pixel
Background pixel
Unlabeled Pixel
Unlabeled Pixel
Label 1
14
CC labeling – 8 Connectivity
15
CC labeling – 8 Connectivity
16
CC labeling – 8 Connectivity
Label 1 Label 1
Label 2 Label 2
Label 3 Label 3
17
CC labeling – 8 Connectivity
18
Distance Metrics
19
City block distance (D4 distance)
D4 ( p, q) x s y t
20
Chessboard distance (D8 distance)
D8 ( p, q) max( x s , y t )
21
Euclidean Distance
De ( p, q) ( x s) 2 ( y t ) 2
q(s,t)
p(x,y)
23
Arithmetic Operations
f s K f m max( f m )
25
Logical Operations (Binary Images)
26
Readings from Book (3 Edn.) rd
28