ConectedComponentAnalysis 27032024 085741am
ConectedComponentAnalysis 27032024 085741am
y-1 y y+1
x-1
x
x+1
22
4- Neighbors of a Pixel –N4(p)
x
x+1
23
Diagonal Neighbors of a Pixel –ND(p)
y-1 y y+1
x-1
x
x+1
24
8- Neighbors of a Pixel –N8(p)
y-1 y y+1
x-1
x
x-1
N8 ( p) N4 ( p) N D ( p)
(x-1,y), (x+1,y), (x, y-1), (x, y+1)
(x-1,y-1), (x+1,y-1), (x-1, y+1), (x+1, y+1)
25
Determine different regions in the
image
26
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
27
Connectivity
V: Set of gray levels used to define the criterion of similarity
4-connectivity
28
Connectivity
V: Set of gray levels used to define the criterion of similarity
8-connectivity
29
Connectivity
V: Set of gray levels used to define the criterion of similarity
If gray level
30
Example: m – Connectivity
Note: Mixed connectivity can eliminate the multiple path connections that often
occurs in 8-connectivity
31
Paths
Path: Let coordinates of pixel p: (x, y), and of pixel q: (s, t)
32
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.
35
CC labeling – 4 Connectivity
36
CC labeling – 4 Connectivity
37
CC labeling – 8 Connectivity
38
CC labeling – 8 Connectivity
Background pixel
Background pixel
Unlabeled Pixel
Unlabeled Pixel
Label 1
39
CC labeling – 8 Connectivity
Label 3
40
CC labeling – 8 Connectivity
41
CC labeling – 8 Connectivity
Label 1 Label 1
Label 2 Label 2
Label 3 Label 3
42
CC labeling – 8 Connectivity
43
Distance Metrics
44
City block distance (D4 distance)
D4 ( p, q) x s y t
45
Chessboard distance (D8 distance)
D8 ( p, q) max( x s , y t )
47
Euclidean Distance
De ( p, q ) ( x s ) 2 ( y t ) 2
q(s,t)
p(x,y)
50
Arithmetic Operations
f s K f m max( f m )
52
Assignment-1
Readings from Book (4th Edn.)
• Chapter – 2
Acknowledgements
Statistical Pattern Recognition: A Review – A.K Jain et al., PAMI (22) 2000
Pattern Recognition and Analysis Course – A.K. Jain, MSU
Material in these slides has been taken from, the following resources
56