- Fill in image border with zeros
- Start at pixel x=1,y=1
- Begin Row: Starting at (x,y) scan for a value of not zero. Let this point be (x,y)
- Trace contour. This contour must be an external contour and is saved.
- Resume scanning the row starting at (x+1,y) for a pixel with a value of zero. This pixel will now be (x,y)
- If the pixel (x-1,y) has a value of 1 trace the inner contour. Otherwise move to next step.
- Iterate from "Begin Row" until the end of the row has been reached
- Move to the next row starting at point (1,y+1)
 Fu Chang and Chun-jen Chen and Chi-jen Lu, "A linear-time component-labeling algorithm using contour
tracing technique" Computer Vision and Image Understanding, 2004
 Rosenfeld, Azriel. "Digital topology." American Mathematical Monthly (1979): 621-630.
processpublic void process
(GrayU8 binary, int adjustX, int adjustY)Detects contours inside the binary image.
binary- Binary image. Will be modified. See class description
adjustX- adjustment applied to coordinate in binary image for contour. 0 or 1 is typical
adjustY- adjustment applied to coordinate in binary image for contour. 0 or 1 is typical
getConnectRulepublic ConnectRule getConnectRule()
setConnectRulepublic void setConnectRule
getExternalContourspublic PackedSetsPoint2D_I32 getExternalContours()