Вы находитесь на странице: 1из 31

1

Computer
Vision
Lecture 3
Connected Component Labeling
Hendrawan A.
Sekolah Tinggi Teknik Surabaya
What Is CCL?
One image processing
technique that can make a unit
change from pixel to region
All pixels that have value binary
1 and are connected to each
other by a path of pixels all with
value binary 1 are given the
same identifying label
The label is a unique name or
index of the region to which the 2

pixels belong
Sekolah Tinggi Teknik Surabaya
What Is CCL?
1 1 1 1
1
1 1
1 1 1
1 1

1 1
1 1 1 1 1 1
1 1

Sekolah Tinggi Teknik Surabaya


What Is CCL?
1 1 1 1
2
2 2
2 3 3
3 3

4 4
4 4 5 5 5 5
5 5

Sekolah Tinggi Teknik Surabaya


CCL Algorithm
Recursive
Iterative
Classical

Sekolah Tinggi Teknik Surabaya


Recursive
From Top Left to Bottom Right
do
IF a pixel is white or already
labeling then
+Do Nothing
IF a pixel is black then
+Give that pixel label and recursively
check his neighbor to know his region

Sekolah Tinggi Teknik Surabaya


Recursive
1 1 1 1
1
1 1
1 1 1
1 1

1 1
1 1 1 1 1 1
1 1

Sekolah Tinggi Teknik Surabaya


Recursive
1 1 1 1
1
1 1
1 1 1
1 1

1 1
1 1 1 1 1 1
1 1

Sekolah Tinggi Teknik Surabaya


Recursive
1 1 1 1
2
2 2
2 1 1
1 1

1 1
1 1 1 1 1 1
1 1

Sekolah Tinggi Teknik Surabaya


Recursive
1 1 1 1
2
2 2
2 3 3
3 3

1 1
1 1 1 1 1 1
1 1

1
0
Sekolah Tinggi Teknik Surabaya
Recursive
1 1 1 1
2
2 2
2 3 3
3 3

4 4
4 4 1 1 1 1
1 1

1
1
Sekolah Tinggi Teknik Surabaya
Recursive
1 1 1 1
2
2 2
2 3 3
3 3

4 4
4 4 5 5 5 5
5 5

1
2
Sekolah Tinggi Teknik Surabaya
Iterative
Iterative algorithm have 3
phase:
Initialization Phase
Top Down Phase
Bottom Up Phase

Do Top Down Phase and Bottom


Up Phase until nothing change
in both of phase
1
3
Sekolah Tinggi Teknik Surabaya
Iterative
Initialization Phase
From Top Left to Bottom Right if
found black pixel, give a
sequence label 1 1 1 1
1
1 1
1 1 1
1 1

1 1
1 1 1 1 1 1
1 1

1
4
Sekolah Tinggi Teknik Surabaya
Iterative
Initialization Phase
1 2 3 4
5
6 7
8 9 10
11 12

13 14
15 16 17 18 19 20
21 22

1
5
Sekolah Tinggi Teknik Surabaya
Iterative
Top Down Phase
From Top Left to Bottom Right
check minimal label
M = Min (Labels(P U
NEIGHBORS (P)))


5




1

2

3

4





6 7
8 9 10
11 12

13 14
15 16 17 18 19 20
21 22

1
6
Sekolah Tinggi Teknik Surabaya
Iterative
Top Down Phase
1 1 1 1
5
5 5
5 9 9
9 9

13 13
13 13 17 17 17 17
17 17

1
7
Sekolah Tinggi Teknik Surabaya
Iterative
Bottom Up Phase
From Bottom Right to Top Left
check minimal label
M = Min (Labels(P U
NEIGHBORS (P))) 1 1 1 1
5
5 5
5 9 9
9 9

13 13
13 13 17 17 17 17
17 17

1
8
Sekolah Tinggi Teknik Surabaya
Iterative
Bottom Up Phase
1 1 1 1
5
5 5
5 9 9
9 9

13 13
13 13 17 17 17 17
17 17

1
9
Sekolah Tinggi Teknik Surabaya
Classical
Use table for help us in labeling
pixel
The table consist of 2 column:
Neighbor Label Column
Pixel Label Column
Classical also have 3 phase:
Top Down I Phase
Class Definition Phase
Top Down II Phase
2
0
Sekolah Tinggi Teknik Surabaya
Classical
1 1 1 1
1 1 1 1
1 1
1 1 1
1 1

1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1

2
1
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
From Top Left to Bottom Right
If Neighbor(Pixel) didnt have label
+Give pixel a new label
Else
+Give pixel minimal label from his
neighbor
+If there is two label then place the
connection between label to table

2
2
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1
1 1
1 1 1
1 1

1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1

2
3
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1 Neighbor
1 1 Label Pixel Label
1 1 1 2 1
1 1

1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1

2
4
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1 Neighbor
2 2 Label Pixel Label
2 3 3 2 1
3 3

4 4 4 4 4
4 4 4 4 4 4
1 1 1 1 1

2
5
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1 Neighbor
2 2 Label Pixel Label
2 3 3 2 1
3 3

4 4 4 4 4
4 4 4 4 4 4
5 5 1 1 1

2
6
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1 Neighbor
2 2 Label Pixel Label
2 3 3 2 1
3 3 5 4

4 4 4 4 4
4 4 4 4 4 4
5 5 4 1 1

2
7
Sekolah Tinggi Teknik Surabaya
Classical
Top Down I Phase
1 1 1 1
2 2 2 1 Neighbor
2 2 Label Pixel Label
2 3 3 2 1
3 3 5 4

4 4 4 4 4
4 4 4 4 4 4
5 5 4 4 4

2
8
Sekolah Tinggi Teknik Surabaya
Classical
Class Definition
Phase
Based on table, the system will
decide how many class and the
classification of the label

Class Label
1 1, 2
2 4, 5

2
9
Sekolah Tinggi Teknik Surabaya
Classical
Top Down II Phase
From Top Left to Bottom Right
Change every label from class
table into his class minimal label
1 1 1 1
2 2 2 1
2 2
2 3 3
3 3

4 4 4 4 4
4 4 4 4 4 4
5 5 4 4 4

3
0
Sekolah Tinggi Teknik Surabaya
Classical
Top Down II Phase
1 1 1 1
1 1 1 1
1 1
1 3 3
3 3

4 4 4 4 4
4 4 4 4 4 4
4 4 4 4 4

3
1
Sekolah Tinggi Teknik Surabaya

Вам также может понравиться