2D Barcodes:
Detection vs Distance

A key factor in deciding which 2D Barcode (or marker) you should use, is if it can be detected it in your application! There has been surprisingly little formal study in trying to determine which marker works best where. De facto standards have emerged in different industries, often for reasons unrelated to performance. In this article we compare different markers and see at which distance they break down.

Markers: QR Code, Micro QR Code, and Aztec Code

Date: 2022-Feb-23 Author: Peter Abeles

QR Code is by far the most popular and is used heavily in manufacturing, warehousing, and consumer products.

Micro QR Code shares much with QR Codes but has less overhead and can only encode small amounts of data.

Aztec Codes is popular in transportation for tickets with airlines and trains.

A detailed discussion of the technical advantages and disadvantages of each of these markers goes beyond the scope of this article. Needless to say it's extremely complex and difficult to predict when you can detect any of these markers as a function of distance. While a bit of a simplification, the major limiting factor is the apparent size of the smallest element in the image. The smallest element in all of these markers are the data bits, which are encoded as small squares.

If you fix the marker's size, then size of each bit is dependent on the amount of data encoded. If you fix message being encoded, then how efficient each message is encoded matters as well as the amount of space taken by "overhead". The overhead takes the form of landmarks and is used by image processing to detect the markers.

The Figures below show what two of the markers look like if remove all the data bits from them and leave just the fixed landmarks. Location and shape of these landmarks play a critical role in being able to effectively decode the marker.

QR Code Landmarks

Landmarks are on the outside and inside. Making it easy to read data bits but more susceptible to damage.

Aztec Code Landmarks

Landmarks are inside and does not require a white border. However data becomes more difficult to read as more is encoded.

To determine the maximum distance of each marker we are going to do a Monte Carlo simulation study with the following parameters

  • The number of characters encoded: 14 or 52 characters

  • The size of each marker: 10 cm

  • Distance, orientation, and small amounts of salt and pepper noise added

  • Simulated Camera: 800x600 images 67 degree FOV

At fixed distances, we will do 100 trials where the frontal orientation of each marker is slightly disturbed.

Aztec Code visual degradation at different distances.

Video showing Qr Code degrading

Above we show how marker's appearance changes as the distance increase. The farther away marker is much more difficult to read. More jumbled the data bits become.

14 characters encoded. 10cm markers: At around 150 cm distance all markers start to have issues. However, Aztec Markers have issues much sooner. This is largely due to lack of landmarks in the outer edge. A more advanced processing algorithm could partially mitigate this problem, but it will still be there.

Well what happens if you encode more data? Aztec Codes can actually encode text more efficiently than QR Codes, so maybe that would result in larger data bits in the image and better detection at range?

52 characters encoded. 10cm markers: While Aztec Codes might be more efficient at encoding data the inherit instability previously discussed increases the more data you encode! This would also explain why Aztec Codes are primarily used in applications where you can stick a camera right next to them.

The reason Micro QR isn't included is that they can't encode 52 characters.

It is clear from this brief study there are a lot of variables which need to be considered when selecting a marker. For example, decreasing the amount of error correction can actually increase the distance you can read a marker at! It gets worse when you consider all the possible decoding approaches available.

At NINOX 360 we will help you make the best selection and perform simulation studies to evaluate their performance in your application before you install, reducing time, labor, and cost.

sales@ninox360.com

Please share if you found this article helpful.