For each such region, a point on the boundary is selected and its coordinates are transmitted. The encoder then moves along the boundary of the region and, at each step, transmits a symbol representing the direction of this movement.
This continues until the encoder returns to the starting position, at which point the blob has been completely described, and encoding continues with the next blob in the image.
This encoding method is particularly effective for images consisting of a reasonably small number of large connected components.
Some popular chain codes include:
Freeman Chain Code of Eight Directions (FCCE)
Freeman Chain Code of Eight Directions (DFCCE)
In particular, FCCE, VCC, 3OT and DFCCE can be transformed from one to another
A related blob encoding method is
crack code. Algorithms exist to convert between chain code, crack code, and run-length encoding.
A new trend of chain codes involve the utilization of biological behaviors. This started by the work of Mouring et al. who developed an algorithm that takes advantage of the pheromone of ants to track image information. An ant releases a pheromone when they find a piece of food. Other ants use the pheromone to track the food. In their algorithm, an image is transferred into a virtual environment that consists of food and paths according to the distribution of the pixels in the original image. Then, ants are distributed and their job is to move around while releasing pheromone when they encounter food items. This helps other ants identify information, and therefore, encode information.
abDhou, Khaldoon (2018). A Novel Agent-Based Modeling Approach for Image Coding and Lossless Compression Based on the Wolf-Sheep Predation Model. ICCS 2018. Computational Science – ICCS 2018.
LNCS. Vol. 10861. pp. 117–128.