Info

In the example of Fig. 9b, the sum is 5. The second sum, s(p1), is the sum of 0-to-1 transitions in the sequence of neighbor FIGURE 9 (a) Neighborhood pixel labels, (b) Example neighborhood.

pixels, computed by considering all nine transitions around the pixel p1, starting with p2 to p3 and ending with p9 to p2. The value of s(p1 ) is 2 for the example in Fig. 9b.

The algorithm has two steps in each iteration. In step 1, the algorithm first checks the entire image and determines border pixels, which are defined as pixels that have a value of 1 and at least one 8-connected pixel equal to 0. In this step, a border pixel is deleted if four conditions are satisfied simultaneously:

If p1 has only one neighbor, it is the end of a pixel strand and should not be deleted. If p1 has 7 neighbors, deleting it may deplete the region and lead to splitting.

If the neighborhood has more than one 0-to-1 transition, deleting p1 may lead to splitting the region.

These two conditions are satisfied simultaneously if p4 = 0, or p6 = 0, or p2 = p8 = 0. When conditions 1 and 2 are met, these three possibilities refer to the three cases illustrated in Fig. 10, which correspond to an east border, south border, and northwest corner, respectively. In each of these three cases, the pixel p1 should be deleted for thinning.

If all four conditions are met, then pixel p1 is marked for deletion but not deleted until all the pixels in the image are evaluated. After the complete evaluation, all marked pixels are deleted.

Step 2 of the algorithm is applied to the result of step 1, also using four conditions. The first two conditions are the same as those of step 1, but the other two are modified as:

These two conditions address the cases of north border, west border, and southeast corner in a manner similar to step 1.

In step 2 also, a pixel is marked for deletion if all four conditions are met; all marked pixels are deleted after each pixel in the image is visited. When step 2 is completed, the algorithm starts another iteration by applying step 1 to the outcome of step 2. This iterative process is terminated when no pixel is marked in step 1 and step 2. This algorithm yields a skeleton made of a strand of 8-connected pixels. Figure 11 shows the result of thinning a small section of an image with the Zhang and Suen algorithm. Figure 8 compares this algorithm with the MAT on a femur image. The two produce similar results with a few differences. Although the Zhang and 