Boundary Extraction
The first step of the construction of the chain code is to extract the boundaries of the image. Extracting the contour depends on the connectivity. In the content of this chapter we use pixels with four-connectivity. The simplest contour following algorithms were presented by Papert [71] and Duda et al.[2]. Fig. 5.2 illustrates the contour following on an image composed of pixels. This contour was obtained using the algorithm proposed by Duda et al. [2] who state it as follows:
Scan the picture until a figure cell is encountered.
Then:
If you are in a figure cell, turn left and take a step.
If you are in a ground cell, turn right and take a step.
Terminate when you are within one cell of the starting point.
In this chapter we consider a new method to find the contourof a binary image and use this contour to obtain the chain code. To find the contour of a binary image apply the following steps: