gerard.
PROJECTSPUBLICATIONSABOUT MECONTACT
Circular Barcode

Circular Barcode | Like a QR code. But better.

Circular barcodes allow merging visual content with a barcode.

Circular Barcode
    • Python
    Challenge
    Approach
    Implementation
    Decoding Algorithm
    Solution
    Impact
    Reflection

    Challenge: Creating a space-efficient identification system for game tokens

    While designing a digitally interactive board game, I needed a way to scan physical game tokens with a smartphone to capture the board state. Traditional QR codes were problematic for this application because their square format would occupy too much space on circular tokens and detract from the visual design.

    The challenge was to develop a more elegant identification system that would satisfy several requirements:

    • Work efficiently with circular game tokens
    • Leave the center area free for artwork and game information
    • Be reliably scannable from various angles with a smartphone camera
    • Contain sufficient data capacity to uniquely identify each game piece
    • Include error correction for reliable scanning in real game conditions
    • Be visually discreet and integrate with the game's aesthetic

    Approach: Reinventing barcodes for circular media

    I designed a ring-shaped barcode system that encodes information in a circular pattern around the perimeter of game tokens. This approach preserves the center area for artwork while placing the identification code discretely along the outer edge.

    The encoding process follows several key steps:

    • Convert the token's ID to a hexadecimal code
    • Apply Reed-Solomon encoding for robust error correction
    • Convert the encoded data to a binary sequence
    • Add distinctive start/end patterns and recurring markers for orientation detection
    • Represent each bit as a black or white segment in a toroidal ring
    Example of a circular barcode on a game token
    A game token featuring a circular barcode around its perimeter, with the center area used for visual information

    Implementation: Technical details of the encoding system

    The implementation consists of two main components: the encoding system to generate circular barcodes and the decoding algorithm to read them from images.

    For the encoding process, I developed Python code using matplotlib for visualization and the Reed-Solomon library for error correction. The process involves:

    • Reading a hexadecimal ID and applying Reed-Solomon error correction
    • Converting the encoded data to a binary sequence
    • Adding special marker patterns that help with orientation detection
    • Creating evenly-spaced recurring patterns to verify alignment
    • Mapping each bit to an angular segment in a ring visualization

    The visualization renders each bit as a toroidal segment (a section of a ring) in black or white. This creates the distinctive ring pattern around the outer edge of the token while leaving the center area completely available for artwork or game information.

    Decoding Algorithm: Computer vision techniques for reading circular barcodes

    The true challenge of this project was developing a reliable method to read the circular barcodes from images. I implemented a computer vision pipeline with the following steps:

    • Apply Hough Circle Transform to identify the outer circle of the token
    • Mask the image to focus only on the token area
    • Detect inner contours to find the inner circle of the barcode ring
    • Correct for perspective distortion (as tokens appear as ellipses when viewed at an angle)
    • Divide the ring into the expected number of segments
    • Analyze the color intensity of each segment to determine the binary value
    • Locate the start pattern and verify recurring marker patterns
    • Extract and decode the binary sequence using Reed-Solomon error correction

    One of the key insights was recognizing that the tokens would often appear as ellipses rather than perfect circles due to camera perspective. This required implementing perspective correction before attempting to read the barcode segments.

    Circular barcode with detection lines showing segmentation
    Visualization of the barcode decoding process showing the detected segments and the radial lines used to sample each bit value

    Solution: A functional token identification system

    The final Circular Barcode system successfully met all the project requirements. Each token could be uniquely identified while maintaining a clean visual design that preserved the center area for game-related artwork and information.

    • Space-efficient: Utilized only the perimeter of circular tokens
    • Robust: Reed-Solomon encoding provided error correction capabilities
    • Reliable orientation: Start patterns and recurring markers ensured proper reading regardless of rotation
    • Visually integrated: The ring design complemented the circular tokens naturally
    • Sufficient capacity: Could encode token IDs with room for additional data if needed
    • Scannable: Successfully readable from smartphone images despite perspective distortion

    The system proved to be reliable even under various lighting conditions and scanning angles, making it suitable for real-world tabletop gaming environments.

    Impact: Implications beyond the original use case

    Although the board game project was ultimately not completed, the Circular Barcode system demonstrates several valuable concepts that could be applied to other domains:

    • Adapting data encoding to match physical form factors rather than forcing standard formats
    • Using geometric constraints as design opportunities rather than limitations
    • Balancing technical requirements with aesthetic considerations
    • Applying computer vision techniques to read distorted or non-standard identification patterns

    The technology could be applied to other circular items needing digital identification, such as coins, tokens, wearable accessories, or circular product packaging, where preserving central branding or information is important.

    Reflection: Learning and future possibilities

    This project provided valuable experience in several technical areas, including:

    • Error correction encoding techniques
    • Computer vision algorithms for shape detection and perspective correction
    • Design thinking that balances functional and aesthetic requirements
    • Creating custom data encoding formats tailored to specific use cases

    While the board game didn't materialize, the circular barcode concept could be extended in several ways for future applications:

    • Developing a mobile app specifically optimized for reading circular barcodes
    • Creating multi-ring versions for higher data capacity
    • Incorporating RGB multicolor segments for even greater information density
    • Applying similar ring-based encoding to other geometric shapes beyond circles

    This project demonstrates how rethinking established formats can lead to innovative solutions that better address specific constraints and opportunities.

    Technologies

    This project was built with:

    ↗ Python

    Circular Barcode
      • Python
      Challenge
      Approach
      Implementation
      Decoding Algorithm
      Solution
      Impact
      Reflection
      Technologies