Fact-checked by Grok 2 weeks ago

Chain code

A chain code is a algorithm for representing the contours of objects in binary digital images by encoding the boundary as a sequence of discrete directional steps along connected pixels. Introduced by Herbert Freeman in 1961, it traces the perimeter starting from an arbitrary boundary point and records unit moves in either 4-connectivity (horizontal and vertical directions) or 8-connectivity (including diagonals), using integer codes from 0 to 3 or 0 to 7, respectively. This method provides a compact, symbolic description of shapes that preserves essential topological and geometric information while reducing storage needs compared to coordinate lists—for instance, requiring only 2–3 bits per boundary pixel. The core principle of chain codes relies on raster scanning or boundary-following algorithms to generate the sequence, which inherently supports translation invariance since it depends solely on relative directions rather than absolute positions. To achieve rotation invariance, variants like the differential (first-difference) chain code compute changes in direction rather than absolute orientations, enabling normalized comparisons of rotated s. Freeman's original formulation, detailed in his conference paper, laid the foundation for subsequent enhancements, including techniques co-developed with Feder in 1965 to improve shape matching efficiency. Over decades, chain code schemes have evolved with notable contributions from researchers like in 1973, who simplified encoding to binary turn codes, and Ernesto Bribiesca in 1999, who introduced vertex chain codes (VCC) that use vertex coordinates for enhanced invariance under translation, rotation, and scaling in both and contexts. Further refinements include compressed variants, such as Huffman-coded chain codes proposed in 2005, and histogram-based extensions like chain code histograms (CCH) and coherence vectors (CCCV) developed around 2006, which facilitate statistical shape analysis across diverse grid structures like triangular or hexagonal cells. These advancements address limitations in the original Freeman code, such as sensitivity to starting point and direction, while maintaining computational efficiency. In computer vision and image processing, chain codes find broad applications in shape recognition, where they enable compact feature extraction for pattern matching; medical imaging, such as quantifying cell boundaries or analyzing brain structures; and optical character recognition (OCR), supporting digit and symbol identification through boundary encoding. They also aid in object tracking, industrial manufacturing for defect detection, space exploration imagery, and defense-related surveillance by allowing efficient storage, retrieval, and comparison of contours in large datasets. Recent trends, including noise-robust injections into chain codes as of 2025, underscore their ongoing relevance in robust geometric modeling amid imperfect real-world data.

Fundamentals

Definition

Chain code is a and technique used in image processing to encode the contours of connected components, often referred to as blobs, in images. It achieves this by tracing the perimeter of an object by , converting the boundary into a compact sequence of directional moves rather than storing the full coordinates. This method was originally proposed by Herbert Freeman in 1961 as a way to encode arbitrary geometric configurations efficiently. The core principle of chain code involves representing a shape's as a of unit-length steps along specified directions, typically employing either 4-connectivity ( and vertical moves only) or 8-connectivity (including diagonals). In the 8-connectivity system, directions are encoded as integers from 0 to 7, where 0 denotes a move to the right (east), 1 to the upper-right (northeast), 2 upward (north), and so on, progressing counterclockwise in 45-degree increments. This encoding allows for a succinct description of the , preserving all topological and geometric details without loss of . To generate a chain code, an arbitrary boundary pixel is selected as the starting point, with its coordinates (x, y) explicitly transmitted to enable reconstruction. The tracing proceeds along the contour until it returns to this starting pixel, forming a closed loop that fully delineates the connected component. This approach is particularly suitable for binary images featuring a small number of large connected components, as it minimizes redundancy and storage requirements for prominent object boundaries while being less efficient for scenes with numerous tiny elements.

Boundary Representation

Chain codes represent the boundary of an object in a binary image by encoding the sequence of directional moves along its perimeter, effectively capturing the geometric structure through a compact string of integers corresponding to unit steps in predefined directions. This method, introduced by Herbert Freeman, traces the contour starting from a designated point and follows the boundary in a consistent direction, such as clockwise, to ensure a closed loop representation without gaps or overlaps. The boundary tracing process typically employs algorithms like Moore's neighborhood algorithm, which begins at the leftmost of the topmost row of the object and examines neighboring pixels in a manner to identify and follow the edge pixels. This ensures all boundary points are visited exactly once before returning to the starting point, forming a complete description. For , chain codes support two primary models: 4-connected, which uses four cardinal directions (0 for east/right, 1 for south/down, 2 for west/left, 3 for north/up), restricting moves to horizontal and vertical steps; and 8-connected, which expands to eight directions (0-7, starting from east and proceeding to include diagonals), allowing for more fluid approximations of curved boundaries. The choice of affects the smoothness and length of the code, with 8-connected often yielding shorter sequences for diagonal-heavy . A representative example in 4-connectivity is a simple square traversed , starting from the top-left corner: the sequence "000111222333" encodes three right moves (0), three down moves (1), three left moves (2), and three up moves (3) for a 4x4 square, precisely outlining the perimeter. In 8-connectivity, the same square would use only cardinal directions but could incorporate diagonals (e.g., 1 for southeast) if the includes slanted edges in more complex shapes. One key advantage of chain codes is their compact storage of contour information, requiring minimal space—often just one byte per direction—while preserving all boundary pixels losslessly, enabling exact reconstruction of the original shape by interpreting the sequence as a series of vector steps from the starting point. For instance, decoding "000111222333" repositions a cursor successively right three times, down three times, left three times, and up three times, yielding the square's exact pixel outline without interpolation errors. However, chain codes have limitations, including sensitivity to the choice of starting point, which can alter the sequence despite representing the same shape, and vulnerability to rotation, as shifting the orientation changes the directional codes; they are also not inherently scale-invariant, requiring additional processing for resized images.

Historical Development

Origins in Image Processing

Chain codes originated in the field of during the early era of , where researchers sought efficient methods to represent and analyze visual from scanned or digitized sources. Herbert Freeman introduced the concept in his seminal 1961 paper, proposing a technique for encoding arbitrary geometric configurations to enable compact storage, transmission, and machine recognition of shapes. This approach addressed the challenges of handling large volumes of on early computers, focusing on descriptions to support tasks. Freeman's prototype, known as the Freeman Chain Code of Eight Directions (FCCE), utilized an 8-connected path that quantized boundary directions into eight discrete orientations spaced at 45-degree increments, allowing for a concise sequence of directional symbols to trace object contours. The method formalized the encoding process by following contours in a counterclockwise manner, preserving essential shape information while reducing data redundancy compared to pixel-by-pixel representations. This innovation built upon prior informal ideas in contour-following algorithms but provided a structured, numerical framework for digital curve representation. During the 1960s and 1970s, chain codes saw early adoption in research on topological properties of digital images and the development of shape descriptors, enabling applications in automated image analysis and recognition systems. Freeman's work laid the groundwork for subsequent variations that extended the basic encoding scheme to handle more complex boundary features.

Key Advancements

In 1965, Freeman and Jerry Feder co-developed correlation techniques for chain codes, improving shape matching efficiency by analyzing directional correlations in boundary sequences. In the 1970s, Seymour Papert simplified encoding to binary turn codes, reducing complexity for basic direction changes. During the 1970s and 1980s, differential chain codes (DCC) emerged as a significant improvement over early Freeman codes, encoding relative direction changes between successive boundary segments to mitigate sensitivity to rotations and translations. This approach, pioneered by researchers at Delft University, reduced storage requirements by exploiting correlations in boundary directions, achieving higher compression efficiency for line drawings compared to absolute direction encodings. Building on Freeman's foundational work from , the (VCC) was developed in 1999 by Ernesto Bribiesca, emphasizing representations based on corner points or rather than every along the , which enhanced compactness and invariance properties. uses a minimal set of symbols to describe vertex connections, allowing for more efficient storage of complex shapes while maintaining topological accuracy. During the and , chain codes saw integrations with complementary encodings such as crack codes, which trace boundaries along pixel cracks, and (RLE), enabling hybrid representations for improved in images. In 2005, Huffman-coded chain codes were proposed as a compressed variant to further optimize storage. Around 2006, histogram-based extensions like chain code histograms (CCH) and coherence vectors (CCCV) were developed, facilitating statistical shape analysis across diverse grid structures. The 3-Orthogonal Chain Code (3OT), introduced in 2005, further advanced this by using only three orthogonal symbols to represent boundaries, facilitating simpler computations for properties like the and outperforming prior codes in storage efficiency for rasterized shapes. The 2010s introduced biologically inspired variants, drawing from natural systems for more robust boundary tracing. The Ant Colonies Chain Code (ACCC) of 2018 employs optimization principles, simulating trails to achieve resilient extraction in noisy environments. Similarly, the Predator-Prey System Chain Code (PPSCC), from 2019, models dynamic interactions akin to ecological predation for adaptive detection, enhancing performance in evolving or irregular shapes. In the 2020s, chain codes have been increasingly integrated into AI-driven pipelines, particularly for post-processing contours extracted via models, as explored in agent-based simulations for bi-level . Works like Dhou's 2019 analysis highlight future applications in systems combining chain codes with neural networks for precise in and . As of 2025, advancements include noise-robust techniques such as direct noise injection into Freeman chain codes to model imperfections in real-world data. Algorithms for interconvertibility among major chain code formats, including , , 3OT, and Differential Freeman Chain Code Extended (DFCCE), were established to enable seamless transformations and unified processing across variants.

Types and Variations

Freeman Chain Code

The (FCC), introduced by Herbert in , represents the boundary of a digital object as a of codes corresponding to eight possible move directions in an 8-connected grid. This original formulation, often denoted as the Freeman Chain Code of Eight Directions (FCCE), numbers the directions from 0 to 7, with each code indicating a unit move of 45 degrees: 0 for east, 1 for northeast, 2 for north, 3 for northwest, 4 for west, 5 for southwest, 6 for south, and 7 for southeast, measured counter-clockwise from the positive x-axis. The angle for direction i is given by \theta_i = (i \times 45^\circ) \mod 360^\circ, where i \in \{0, 1, \dots, 7\}. In the first-order FCCE, the sequence records absolute directions of each step, starting from an arbitrary point and tracing the , typically or counter-clockwise. A second-order variant computes differences between consecutive absolute directions, reducing sensitivity to starting but requiring additional for full invariance, such as cyclically shifting the sequence to its lexicographically smallest form. For example, a closed approximating a circle might yield a sequence like "012345670", forming an octagonal path that closes back to the starting direction. The FCCE's advantages include its simplicity, requiring only 3 bits per code for storage efficiency, and its ability to accurately capture diagonal moves inherent to 8-connectivity, enabling compact representation of irregular boundaries without loss of topological connectivity. Introduced in , it remains the baseline for evaluating subsequent chain code variants due to its foundational role and widespread adoption in shape encoding tasks.

Differential and Vertex Variants

Modifications to the foundational Freeman chain code have introduced variants that mitigate limitations such as sensitivity to rotation and representational redundancy, particularly for smooth or polygonal boundaries. These include the differential chain code, which emphasizes relative direction changes, and vertex-based approaches that focus on corner points rather than every boundary step. The differential chain code (DCC) encodes the difference in direction between consecutive steps along the boundary, defined as d_i = (n_i - n_{i-1}) \mod 8, where n_i represents the absolute direction code at step i. This relative encoding produces compact sequences for smooth contours, as straight lines yield repeated 0s, while gentle curves feature mostly 0s interspersed with small values like ±1 or ±2. For instance, a horizontal line segment results in an all-zeros sequence, significantly reducing storage compared to absolute codes. DCC was analyzed for its efficiency in line drawing representation, demonstrating reduced data volume without loss of information. The chain code (), introduced by Bribiesca, represents boundaries by traversing the vertices of regular s composing the shape, recording the number of cell vertices in contact with the at each step—typically using codes 1, 2, or 3 (with 4 indicating closure). This approach only updates the code at significant vertices or corners, making it suitable for polygonal approximations where straight segments are encoded implicitly through vertex positions. VCC achieves invariance to and , and it can be normalized for starting point independence, enhancing its utility for shape recognition. By focusing on vertices, it offers gains in boundaries with long straight segments, avoiding redundant codes for collinear points. The 3-orthogonal chain code (3OT) restricts movements to three orthogonal directions (forward, left, right relative to the current orientation), using a minimal set of three symbols for encoding. This simplification facilitates implementation, as it reduces the complexity of direction tracking while maintaining lossless boundary description. Proposed for applications like corner detection and computation, 3OT proves effective for images with orthogonal features, outperforming four-direction codes in for certain contours. These variants provide targeted advantages: DCC excels in compactness for smooth, continuous curves by leveraging directional stability; VCC enhances efficiency for polygonal or corner-dominated shapes through selective vertex recording; and 3OT prioritizes implementation simplicity in resource-constrained environments. While the foundational serves as a basis for these developments, the variants address specific representational challenges without altering core boundary-tracing principles.

Algorithms and Implementation

Encoding Process

The encoding process for generating a chain code from a boundary involves systematically tracing the of a while recording directional changes. This procedure typically employs 8-connectivity, as introduced in Freeman's framework for representing object boundaries. The process begins with identifying a starting on the boundary and proceeds through a sequential traversal until the boundary is fully enclosed, ensuring a lossless representation of the shape. To initiate encoding, the starting is selected as the leftmost (or uppermost leftmost) point in the image, often the first foreground encountered in a from the top-left corner; its coordinates (x, y) are output as the initial position. Next, the initial is determined by examining the eight possible neighbors of the starting in a predefined order, such as from an assumed entry (e.g., from the west neighbor, treated as ), to identify the first adjacent . The traversal follows a consistent search pattern using the , which checks the eight surrounding s in a manner starting from the previous entry to locate the next . At each step, the from the current to the next is encoded as a value from 0 to 7, corresponding to the eight possible unit moves (0 for east, 1 for northeast, up to 7 for southeast). This code is appended to the sequence, and the process repeats, updating the current position and entry for the next check. The traversal continues until the starting is revisited and the subsequent matches the initial next , confirming closure of the . The following outlines the core for 8-connected tracing and chain code generation:
Initialize: Find starting [boundary](/page/Boundary) [pixel](/page/Pixel) b0 = (x0, y0); set entry [direction](/page/Direction) c0 (e.g., west neighbor as background).
Set current [pixel](/page/Pixel) b = b0; set previous entry c = c0; initialize empty chain code sequence S.
While true:
    Examine [Moore neighborhood](/page/Moore_neighborhood) of b clockwise starting from c: check [pixels](/page/Pixel) n1 to n8.
    Find first foreground ([boundary](/page/Boundary)) [pixel](/page/Pixel) nk among n1 to n8.
    If nk == b0 and b == starting next [pixel](/page/Pixel) b1, break (closure detected).
    Append [direction](/page/Direction) code d (0-7) from b to nk to S.
    Set c = the [pixel](/page/Pixel) preceding nk in the neighborhood check (new entry for next step).
    Set b = nk.
Output: Coordinates (x0, y0) and sequence S.
This algorithm ensures consistent tracing by always advancing to the next boundary pixel without revisiting interiors. To handle potential cracks or junctions in the boundary—such as thin gaps or branching points caused by rasterization—the check enforces a single-path traversal by prioritizing the first encountered neighbor in the ordered search, preventing gaps and maintaining without . Junctions are resolved implicitly by the rule, which selects one outgoing direction consistently. The computational complexity of the encoding process is O(N), where N is the length of the boundary in pixels, as each boundary pixel is visited exactly once during the linear traversal.

Normalization Techniques

Chain code normalization techniques render the directional sequence invariant to translation, rotation, and starting point, enabling reliable comparisons in shape analysis. Translation invariance arises naturally from the focus on relative directions in the sequence, with absolute starting coordinates managed independently during encoding. Starting point normalization treats the chain code as a circular and applies a cyclic shift to begin with the lowest code, such as the first 0 in chain code equivalents, yielding the lexicographically smallest representation. Rotation invariance for codes is obtained by subtracting an equal to the minimum value from all codes 8, aligning the to start from 0; differential chain codes, based on changes, are inherently robust as uniform preserve differences. The standard proceeds as follows: compute the initial chain code , identify the minimum code position, perform a cyclic shift to relocate it to the start, and apply the rotation adjustment by subtracting the minimum 8 for absolute codes. For instance, an original "0642" is cyclically redefined to "20642", then transformed via first differences to "6666", resulting in the normalized shape number "66666". Scale invariance, when required, involves resampling the boundary contour to a uniform length prior to chain code generation, though this extension is uncommon for traditional binary chain codes. These methods underpin effective shape matching in recognition tasks by ensuring canonical forms across transformations.

Applications

Image Compression

Chain codes facilitate the compression of contours by representing the path as a compact sequence of directional instructions, rather than storing the coordinates of each individually. In Freeman's chain code, for instance, an 8-connectivity variant encodes each step along the contour using one of eight possible directions, requiring only 3 bits per step (log₂(8)), which contrasts sharply with the bit cost of listing all N s explicitly. This mechanism achieves substantial data reduction for smooth or structured boundaries, as the sequence length remains proportional to the number of steps, typically much shorter than exhaustive lists. To further enhance compression ratios, chain codes are often combined with preprocessing transforms and techniques. The move-to-front (MTF) transform reorganizes the sequence to prioritize frequent directions, improving subsequent encoding efficiency, while adaptive exploits statistical redundancies in the transformed data for near-optimal bit allocation. Additionally, (RLE) can be applied to handle repeated directions, such as long straight segments in contours, yielding further savings in repetitive patterns. These enhancements form a , as demonstrated in methods integrating Burrows-Wheeler transform (BWT) with MTF and , which achieve average code lengths below 2 bits per symbol on benchmark datasets. Performance evaluations highlight chain code-based methods' superiority for contour-heavy images, such as document scans, where they outperform standards like and . A 2014 study using 3-orthogonal-tilt (3OT) chain codes with reported 27% better compression than JBIG2 at 200 dpi and 65% at 600 dpi, alongside 6-35% gains over 's JB2 layer, particularly on binary objects with clear edges. Similarly, 2019 surveys of techniques, including those combining chain codes with LZ77, highlight improved efficiency for scanned documents and . Despite these advantages, chain codes exhibit limitations in handling noisy or highly irregular boundaries, where extraneous direction changes inflate the sequence length and degrade ratios, as the method assumes clean, connected traceable via boundary following algorithms.

Shape Analysis and Recognition

Chain codes facilitate feature extraction from object boundaries in images by encoding as sequences of directional symbols, enabling the of geometric and statistical properties. The perimeter P of a is directly derived from the chain code as the length of the sequence, adjusted for ality: for 4-directional codes, P equals the number of codes, while for 8-directional codes, it is the count of even directions plus twice the odd directions to account for diagonal steps. , a measure of circularity, is calculated as \frac{4\pi A}{P^2}, where A is the enclosed area, providing insight into elongation or irregularity. histograms, generated by tallying the of each directional code in the sequence, capture angular distribution and orientation trends along the . In shape recognition, normalized codes serve as compact representations for matching against templates or databases. String techniques, such as modified Needleman-Wunsch algorithms, compare code sequences by allowing gaps and substitutions to quantify similarity, accommodating variations in contour length or noise. descriptors can be derived from chain codes by treating the sequence as a parametric curve and applying discrete transforms to its coordinates, yielding - and scale-invariant coefficients for . Chain codes have been applied in handwritten recognition since the , where encoding distinguishes scripts by patterns, as in early systems using direction histograms from chain codes. In medical imaging, they trace cell for segmentation and analysis, such as in algorithms that vectorize from microscopic images. For geographic information systems, chain codes represent , supporting simplification by reducing code length while preserving essential . For example, in , chain codes differentiate an 'O'—characterized by a smooth, uniform sequence of directions—from a 'D', which features longer straight segments interrupted by curves. Since the 2010s, chain codes have integrated with as preprocessing steps, where embeddings of code sequences feed into convolutional neural networks for enhanced shape classification, such as in numeral recognition systems achieving high accuracy through combined codes and neural classifiers. Chain codes also enable topological analysis, computing properties like genus via the from multiple contours, as in recent methods using orthogonal chain symbols to evaluate connectivity in binary images.

Comparisons with Other Codes

Chain codes differ from crack codes in their approach to boundary tracing in binary images. Chain codes, such as the variant, trace the by connecting the centers of pixels inside the object, using 8- to encode directions between adjacent pixels. In contrast, codes trace the cracks or boundaries between object and background pixels, employing 4-connectivity for horizontal and vertical moves. This interior-focused path in chain codes provides better preservation of object connectivity but underestimates enclosed area and lacks sub-pixel , whereas codes offer more accurate area estimation and sub-pixel resolution at the cost of longer code lengths and overestimated perimeters along diagonals. Compared to (RLE), which compresses filled regions by encoding consecutive runs of identical pixels across scanlines, chain codes are specialized for contour boundaries only and do not efficiently represent interior pixels. RLE excels in compacting uniform areas within binary images, making it suitable for entire raster data, while chain codes focus on shape outlines, often leading to hybrid approaches where RLE handles region filling and chain codes describe edges. In relation to polygonal approximations, such as those generated by the Douglas-Peucker algorithm, chain codes provide pixel-precise, lossless representations of digital curves but result in verbose sequences for complex boundaries. Polygonal methods simplify these chains into fewer straight-line segments that approximate smooth shapes, achieving compactness for storage and rendering while introducing minor approximation errors. Chain codes serve as an intermediate step for deriving such polygons, preserving exact raster details that approximations may discard. Regarding performance, chain codes are simpler and more straightforward for representing boundaries in binary images compared to vector formats like , which support scalable, parametric curves but require more computational overhead for raster-to-vector conversion. However, chain codes are less efficient for complex, high-resolution images where vector representations reduce file sizes through geometric . Overall, chain codes offer advantages in lossless, discrete boundary encoding that reduces storage needs relative to full coordinate lists, enabling efficient . Their primary disadvantages include to , which can propagate errors along the boundary, and lack of inherent , necessitating extensions like resampling for multi-resolution analysis.

Interconversion Methods

Interconversion between chain code variants and other representations is essential for integrating chain codes into diverse processing pipelines, such as combining with rendering or in systems. These methods typically involve directional sequences to alternative encodings while preserving the original , often achieving linear O(N), where N is the length of the chain code sequence. Seminal works have established procedural algorithms for these translations, leveraging local transitions or adjustments to ensure lossless fidelity. One key aspect of interconversion involves adapting chain codes to vertex-based representations like the Vertex Chain Code (VCC), introduced by Bribiesca in 1999. VCC encodes the boundary of shapes composed of regular cells (e.g., pixels) using symbols that represent the number of cell vertices on the contour for each boundary cell, providing invariance to translation, rotation, starting point, and scaling. While direct mapping from Freeman Chain Code of Eight Directions (FCCE) to VCC requires reconstructing the boundary pixel sequence to count vertices per cell, algorithms exist to derive VCC from pixel boundaries traced by chain codes. Converting a standard chain code to a crack code addresses the representational shift from pixel-centered boundaries (interior to pixels) to inter-pixel cracks, enabling compatibility with crack-based analyses like area estimation. The algorithm adjusts directions by rotating them 45 degrees clockwise or counterclockwise and reverses the traversal order to align the path with crack edges; for an FCCE direction d, the corresponding crack direction is (d + 1) mod 8 or equivalent, followed by path inversion. This mapping ensures the crack code traces the dual boundary without loss, as detailed in analyses of contour code properties. Reverse conversion from crack to chain code applies the inverse rotation and forward traversal, restoring the pixel-based sequence. To translate a chain code to (RLE), the algorithm simulates boundary traversal to populate row-wise run lengths, effectively rasterizing the into segments for image reconstruction or . Starting from the initial position, each directional step in the chain code updates the current row and column, appending or merging run lengths for pixels encountered in that row; straight moves contribute directly to runs, while vertical or diagonal steps trigger row changes and partial run updates. This yields an RLE sequence representing the filled outline. The reverse process, from RLE to chain code, employs algorithms that rows to identify transitions using neighborhood rules, tracing the perimeter to generate directional codes in a single pass. These extractions can operate on the RLE structure to achieve efficient . A straightforward example of interconversion within chain code variants is between FCCE and the Differential Freeman Chain Code of Eight Directions (DFCCE), where DFCCE encodes relative turns rather than absolute directions. The forward conversion computes the differential as the modular difference between consecutive FCCE directions.
pseudocode
function fcc_to_dfcc(fcc_sequence):
    dfcc = []
    for i in 1 to length(fcc_sequence) - 1:
        diff = (fcc_sequence[i+1] - fcc_sequence[i]) mod 8
        dfcc.append(diff)
    return dfcc  // Starting direction from fcc_sequence[0]
The reverse uses cumulative summation modulo 8, initializing with the known starting direction to reconstruct the absolute sequence. This pairwise operation ensures exact reversibility. All major chain code variants, including FCCE, , the Three Orthogonal (3OT) code, and DFCCE, are interconvertible through graph-based mappings represented as transition matrices that define local symbol substitutions. For instance, FCCE (F8) maps to DFCCE (AF8) via differences 8, while and 3OT connect to four-directional (F4) subsets through orthogonal projections, allowing bidirectional translations without information loss. These mappings confirm topological equivalence across representations. The linear O(N) complexity arises from the locality of each transition, making interconversions computationally efficient for large contours. Such interconversion methods facilitate hybrid systems, for example, by compressing boundaries with chain codes for storage and then rendering them as polygons via vertex lists derived from boundary reconstruction for visualization or geometric analysis. This modularity enhances applications in image processing pipelines without redundant recomputation.

References

  1. [1]
    Chain Code - an overview | ScienceDirect Topics
    The chain code (Freeman 1961) is a slope intrinsic representation of a shape. The chain code of a digitized curve represents the sequences of direction changes ...
  2. [2]
    (PDF) The evolution and trend of chain code scheme - ResearchGate
    The first approach for representing digital curves using chain code was introduced by Freeman in 1961, and it is known as Freeman Chain Code (FCC). This code ...
  3. [3]
    (PDF) Digit Recognition Using Freeman Chain Code - ResearchGate
    In this paper ,we propose an effective chain code algorithm detecting ... proposed by Freeman in 1961) or chain code finally the chain codes are ...
  4. [4]
    Noise injection into Freeman chain codes - PMC - NIH
    Aug 7, 2025 · This article presents a novel method for direct noise injection into geometric shapes described by eight-or four-directional Freeman chain codes ...
  5. [5]
    On the Encoding of Arbitrary Geometric Configurations - IEEE Xplore
    On the Encoding of Arbitrary Geometric Configurations. Abstract: A method is described which permits the encoding of arbitrary geometric configurations so as to ...Missing: PDF | Show results with:PDF
  6. [6]
    [PDF] - 62 - Vol. 61, 1954, pp. 183 - 193. [16] H. H. Spitz and M. D. Borland ...
    Freeman, “On the encoding of arbitrary geometric configurations,” IRE Trans. Elec- tronic Computers, Vol. EC-10, pp. 260 - 268, June 1961. [5]. H. Freeman ...
  7. [7]
    On the Encoding of Arbitrary Geometric Configurations
    On the Encoding of Arbitrary Geometric Configurations · 1,792 Citations · Related Papers · What Is Semantic Scholar?
  8. [8]
    [PDF] Boundary tracking • Chain codes • Minimum perimeter polygons
    A Freeman chain code represents a boundary as a connected sequence of straight line segments of specified direction and length. Examples of chain code ...
  9. [9]
    [PDF] Lecture 18 Representation and description I
    Chain codes are used to represent a boundary by a connected sequence of straight line segments of special length and direction. • Freeman chain code: based on 4 ...
  10. [10]
    [PDF] The Evolution and Trend of Chain Code Scheme - Eprint UTM
    The Evolution and Trend of Chain Code Scheme. 1Lili Ayu Wulandhari, 2Habibolah Haron. Department of Modelling and Industrial Computing. Faculty of Computer ...Missing: Zhang | Show results with:Zhang
  11. [11]
    [PDF] differential chain coding for televvriting application - Eurecom
    Compared to. (1, 3)-MRDCC, DCC was better in over 94% of the images. In order to compare the codes in terms of quantisation error, we used a per-lcngth ...Missing: history | Show results with:history
  12. [12]
  13. [13]
  14. [14]
  15. [15]
  16. [16]
  17. [17]
  18. [18]
  19. [19]
  20. [20]
    [PDF] PERFORMANCE ANALYSIS OF CHAIN CODE DESCRIPTOR FOR ...
    Advantage of visual input is, it is possible to communicate any device without any physical contact. There are many visual inputs are use for HCI application ...<|control11|><|separator|>
  21. [21]
    Performance analysis of differential chain coding - Liu - 1992
    To reduce the amount of data required to represent a line drawing, differential chain coding (DCC) is used to convert the chain code of a line drawing into ...
  22. [22]
    A new chain code - ScienceDirect
    This boundary chain code is termed vertex chain code (VCC). The VCC is invariant under translation and rotation. Also, it may be starting point normalized ...
  23. [23]
    A proposal method for corner detection with an orthogonal three ...
    Sep 18, 2006 · Corner detection by searching two class pattern substrings · A proposal modification of the 3OT chain code · Effective and efficient contour-based ...
  24. [24]
    A universal chain code compression method - ScienceDirect.com
    This paper introduces a new approach for lossless chain code compression. ... The Three OrThogonal (3OT) chain code was introduced in 2005 [13]. Its codes ...
  25. [25]
    [PDF] Digital Image Processing, 2nd ed.
    The chain code of a boundary depends on the starting point. • We can normalize also for rotation by using the first difference of the chain code instead of.
  26. [26]
    [PDF] Chain Code Approach for Shape based Image Retrieval
    Contour-based shape description can be exploit shape boundary information present in the con- tour of an object and neglect the content within the object shape.
  27. [27]
  28. [28]
  29. [29]
  30. [30]
    [PDF] Outlines - Rutgers Computer Science
    rotation can lead to large changes in the perimeter and the area! Page 27. 27. ▫ Perimeter from a chain code. ▫ Perimeter. ▫ Area. ▫ Compactness and Roundness ...
  31. [31]
    Chain code – Knowledge and References - Taylor & Francis
    Chain code refers to a method of coding thin contours or lines in a picture, typically in a bilevel image, by encoding the direction of movement from one point ...Missing: definition | Show results with:definition
  32. [32]
    (PDF) Shape based Recognition Using Freeman Chain Code and ...
    ... On the Encoding of Arbitrary Geometric Configurations. Article. Jul 1961. Herbert Freeman. A method is described which permits the encoding of arbitrary ...
  33. [33]
    [PDF] A survey of shape feature extraction techniques - HAL
    Jul 15, 2008 · Differential chain codes (DCC) is encoding differences in the successive directions. This can be computed by subtract- ing each element of the ...
  34. [34]
    Improving shape classification accuracy with Binary Directional ...
    Fourier descriptors are particularly useful in analyzing closed contours and are commonly applied in handwriting recognition and biological shape analysis. 2.7.
  35. [35]
    [PDF] Effects of shape normalization and feature extraction - Hal-Inria
    Dec 14, 2006 · Though many features have been proposed for character recognition, we focus on the class of di- rection histogram features, including chaincode ...
  36. [36]
    Edge detection and contour tracing of medical cell images
    Jan 11, 2007 · Finally, it makes use of eightdirection chain code searching algorithm to trace contour, and carry on vectorization to the traced contour by ...
  37. [37]
    Chain Code Definition | GIS Dictionary - Esri Support
    A method of drawing a polygon as a series of straight line segments defined as a set of directional codes, with each code following the last like links in a ...Missing: simplification | Show results with:simplification
  38. [38]
    [PDF] an ancient number recognition - using freeman chain code with
    A new method for the classification of freeman chain code using four-connectivity and eight-connectivity events with deep learning approach is presented.
  39. [39]
  40. [40]
    [PDF] Chain Coding Streamed Images through Crack Run-Length Encoding
    It is based on run-length encoding the horizontal cracks between object and background pixels. If necessary, the crack run-length code can be converted to a ...Missing: integration 2000s
  41. [41]
    Image Compression and Encoding for Raster Data - GIS Geography
    Run Length Encoding – Grouping Rows of Data. Run-length encoding ... Chain coding defines the outer boundary using relative positions from a start point.<|separator|>
  42. [42]
    A new chain-coding algorithm for binary images using run-length ...
    This paper presents a new algorithm for converting a binary image into chain codes using its run-length codes. The basic idea of conventional chain-coding ...Missing: encoding | Show results with:encoding
  43. [43]
    Polygonal Approximation - an overview | ScienceDirect Topics
    Given a chain code representation of a digital curve, computing a polygonal approximation means to segment the curve into pieces which are well fit by straight ...
  44. [44]
    Chain Coding - an overview | ScienceDirect Topics
    Chain code is useful in cutting down storage relative to the number of bits required to hold a list of the coordinates of all the boundary pixels (and a ...
  45. [45]
    [PDF] Chapter 11 Representation & Description
    Chain codes are used to represent a boundary as a connected sequence of straight line segments of specified length and direction.Missing: differential DCC history