Image Processing Reference
In-Depth Information
North
West
7
North
East
1
East
2
South
East
3
North
0
North
0
West
3
East
1
West
6
Origin
Origin
South
West
5
South
2
South
4
(a) 4-way connectivity
(b) 8-way connectivity
Figure 7.3
Connectivity in chain codes
describing the shape is 2. The direction from point P1 to the next, P2, is east (code 1) so
the next element of the code is 1. The next point after P2 is P3 that is south giving a code
2. This coding is repeated until P23 that is connected eastwards to the starting point, so the
last element (the twenty-fourth element) of the code is 1. The code for 8-way connectivity
shown in Figure 7.4 (b) is obtained in an analogous way, but the directions are assigned
according to the definition in Figure 7.3 (b). Notice that the length of the code is shorter for
this connectivity, given that the number of boundary points is smaller for 8-way connectivity
than it is for 4-way.
Start
P23
P15
Start
P21
P22
P1
P2
P14
P1
P19
P20
P3
P13
P2
P18
P4
P5
P12
P3
P17
P16
P6
P11
P4
P15
P14
P8
P7
P10
P5
P13
P12
P9
P9
P6
P11
P10
P8
P7
code = {2,1,2,2,1,2,2,3,2,2,3,0,3,0,3,0,3,0,0,1,0,1,0,1}
code = {3,4,3,4,4,5,4,6,7,7,7,0,0,1,1,2}
(a) Chain code given 4-way connectivity
(b) Chain code given 8-way connectivity
Figure 7.4
Chain codes by different connectivity
Search WWH ::




Custom Search