Example
To compute the string edit distance between the two shapes shown in Fig. 5.23a and b. First we will compute the normalized classical chain code of the two shapes, and then apply the previous algorithm to compute the string edit distance between these chains. Fig. 5.23c and d show the classical chain for the images in a and b, respectively.
To apply the previous algorithm, we will assign a cost to each operation as:
Now, if we apply the previous algorithm we obtain the results as shown in Table 5.1. From Table 5.1 we note that the string edit distance between the classical chain codes shown in Fig. 5.23c and d is 2, D(8; 6) = 2.
Also, we can compute the string edit distance between the VCC of the same shapes in Fig. 5.23. The vertex chain codes of Fig.5.23a and b are 1 1 2 2 1 1 2 2 and 1 1 2 1 1 2, respectively. Table 5.2 shows the string edit distance between the VCC of the two shapes in Fig. 5.23. Where we assume that,
and the cost of deletion is 1, and the cost of insertion is 1.