The goal of the Moseycode barcode symbology is to support realtime spatial interaction. This requires the rapid detection, accurate registration and reliable decoding of a sufficient amount of binary data. This document attempts to present the technical details of the barcode symbology in sufficient detail for an appropriately skilled software engineer to implement a writer or reader for the code. Firstly, for readers who want a summary of the barcodes characteristics:
The overall design goal was to support realtime spatial interaction by compositing 2½D and 3D rendered imagery with information from a barcode. To achieve this, the following design goals needed to be met.
The following aspects of the symbology's design make the design goals attainable:
These features are fully described in the sections that follow.
The symbology is two dimensional; it is square, conceptually divided into a regular 24x24 grid. 200 of these 576 grid locations contain 'bits' that communicate binary data to a barcode reader. Eight of these 200 bits communicate the physical orientation of the barcode; the remainder encode the data stored within the barcode. This means that only one third of the barcode surface area is used for data storage, the remainder is dedicated to registration markers and human readable information, or is reserved as a 'quiet zone' that provides a visual buffer between vital barcode elements and unconstrained parts of the view.
The organisation of these different elements is displayed in the figure below. Note that in what follows grid coordinates are specified in the format (x,y) where x is the horizontal ordinate with zero representing the leftmost location and y is the vertical ordinate with zero representing the topmost location. All ordinates are positive. The term unit length refers to the length of one side of a grid location, that is 1⁄24th of the barcode width.
The quiet area consists of all empty grid locations (including corners). Specifically the rows and columns at 0, 6, 17, 23.
The free area, indicated above by yellow grid locations, is unconstrained by this specification. It is intended to serve as an area in which barcode publishers can include human readable information. It occupies a square area in the centre of the barcode, the top-left-hand corner of which occupies (7,7) and the bottom-right-hand corner of which occupies (16, 16).
The registration markers are four rings. The outer circles have a diameter of 5 units, the inner circles have a diameter of 3 units; the smaller concentric with the larger. Their centres coincide with the centres of the grid locations (3,3), (20,3), (3,20) and (20,20).
To identify the orientation of the barcode relative to the viewer, a fixed sequence of 8 binary bits is recorded at the grid locations (11,5), (12,5), (18,11), (18,12), (12,18), (11,18), (5,12), (5,11). A one bit is recorded with a filled black circle with a diameter of 0.9 units concentric with its grid location. A zero bit is recorded as a blank space. The sequence used is described later in this document.
An ordered sequence of eight (a,b,...,h) 24 bit (MSB 0,1,...,23 LSB) codewords are likewise recorded (with a circle for each one bit). The location of each bit is indicated by the labels given to each circle. For example, the 4th bit of the 5th codeword is labelled e3 which is located at (12,2). The coding used is described later in this document.
This specification places no restrictions on the colour used to render/display the barcode beyond the general requirement that the background is lighter than, and contrasts strongly, with the elements of the symbology. It is anticipated that most contexts will be best served by using white for the background and black for all elements. This is strongly recommended but not mandated.
This section of the document describes how bits in the symbology encode data bits.
The orientation bits communicate information about a barcode's orientation in space. Without knowing the orientation, decoding may still be possible in some circumstances by exhaustively attempting to decode bits in all possible orientations, though this should be regarded as undesirable.
There are eight orientation bits which are written in a clockwise manner at locations specified in a previous section. The pattern of bits is: 11100100. The eight symmetry preserving transforms (including reflections) of the registration markers give rise to eight distinct 8 bit words. The minimum Hamming distance between any two words that can be obtained in this way is 4. This gives rise to an orientation block code that can always correct at least one erroneous bit.
The symbology has a data capacity of 96 bits. These are encoded for inclusion within the symbology as follows:
The parity check matrix used for the extended Golay coding of step 2 is:
011111111111100000000000 111011100010010000000000 110111000101001000000000 101110001011000100000000 111100010110000010000000 111000101101000001000000 110001011011000000100000 100010110111000000010000 100101101110000000001000 101011011100000000000100 110110111000000000000010 101101110001000000000001
The fixed pseudo-random sequence of bits in step 3 is:
001000001011010001100000 110110010101000100111000 100100111100101101111010 001110010111000010111110 001011011100100111110110 000111011111000000111010 111010010111000010110111 111101000010010100000011
The first codeword is XORed with the first row in this sequence and so on.
For completeness, the complete procedure for decoding data is:
The image displayed here results from encoding 96 zero bits. Grey corners are included only to help delimit the barcode. The image is provided to clarify what an instance of the symbology actually looks like. It may also prove useful for verifying implementations of the specification. Note that this is not a valid barcode, only a valid instance of the symbology.
The following changes to the symbology are under consideration. Every effort will be made to ensure that new symbolgies are 'compatible' with previous ones.
The original version of this document contained an incorrect reference image. This image did not symbolize 96 zero bits as stated, instead it symbolized 80 zero bits followed by 16 checksum bits, some of which were not zero. This error was corrected in the first revision by replacing the image with the correct symbol.
Important Notice: I do not hold any patents, design rights or any other intellectual property that prevents anyone from using this symbology in any way whatsoever. Nor do I intend to do so at any future date; I want this symbology to be freely usable by all. However, it is my understanding that many barcode symbologies are protected by one or more patents. The symbology above has been developed entirely independently of any existing symbology. In particular, though I have surveyed the necessary aspects of coding theory, computer vision and augmented reality, I have elected not to read the specifications of any pre-existing barcode symbology. It is possible that the symbology presented here may infringe on some patent but I believe it is unlikely since this symbology doesn't resemble any existing barcode and almost certainly uses a different coding. Nevertheless, I am in no way able to indemnify anyone who wishes to use this symbology, for any purpose, against litigation that may arise due to possible claimed infringements on the intellectual properties of others.