Boundary tracing (also known as contour tracing) of a binary digital region can be thought of as a segmentation technique that identifies the boundary pixels of the digital region. Boundary tracing is an important first step in the analysis of that region. Algorithms such as Square Tracing algorithm, Moore-Neighbor Tracing algorithm and the Theo Pavlidis’ algorithm have been used for boundary tracing. With an abstract cell complex representation of a digital image, the boundary point coordinates may be extracted from that digital image by following an algorithm created by Dr Kovalevsky using modulo division and simple pixel lookups. A generic approach using vector algebra for tracing of a boundary can be found at. An extension of boundary tracing for segmentation of traced boundary into open and closed sub-section is described at.
This algorithm assumes a single connected region within the binary image and begins with an exhaustive search to locate the first foreground pixel by iterating over the columns and rows of the image.
Once that pixel is located the algorithm may begin by tracing the cracks of the region in a counterclockwise fashion following one of four possible directions at each step. These directions are represented by a crack code sequence: 0 (East), 1 (South), 2 (West), 3 (North)