Improve UPS Shipping Label Scans with Dynamsoft MaxiCode SDK

Improve UPS Shipping Label Scans with Dynamsoft MaxiCode SDK

With the release of Dynamsoft Barcode Reader (DBR) version 7.2, we are excited to announce added support for UPS MaxiCode.

What is MaxiCode?

MaxiCode is a two-dimensional code developed by United Parcel Service (UPS) in 1992. It is mostly used on shipping labels for addressing and sorting US domestic and international packages. MaxiCode symbols include a number of encoded messages such as:

  • Address data (postal code, country code, etc.)
  • Service class
  • Delimiter character

Maxicode-1

Image Source: Wikipedia

MaxiCode Specifications and Imaging Geometry

To ensure high performance, barcode reading software needs to exploit all types of constraints imposed by code specifications and imaging geometry.

  1. Bullseye

MaxiCode’s concentric circles, or ‘bullseye’ pattern, is useful regardless of orientation, allowing symbols to be scanned on packages traveling rapidly, typically on a conveyor belt. The pattern helps locate the symbols against a complex or unknown background.

  1. Hexagonal grid

MaxiCode symbols use dots (modules) arranged in a hexagonal grid instead of bars, which can store over 90 characters of information. Additionally, up to 8 MaxiCode symbols can be chained together to convey more data.

  1. Error correction

Since most of these MaxiCode symbols are found on packages, they must be able to withstand damage. With the built-in Reed-Solomon error correction, up to 1/8th of the symbol can be torn, smudged or damaged and still be scannable.

  1. Fixed size

MaxiCode has a fixed size of about one square inch, and the bullseye has a fixed size of 07.74mm. In printing, there is approximately 5% of tolerance from the nominal size that is allowable.

  1. Fixed number of lines and modules

The black-and-white modules in a MaxiCode symbol are arranged in a diagonal matrix comprised of 33 rows, which alternately contain 30 and 29 modules. The total number of light and dark modules is 886, and the rightmost two modules in the first row are also always black.

How Dynamsoft Barcode Reader Decodes a MaxiCode

Dynamsoft Barcode Reader SDK goes through the following steps to decode a MaxiCode:

  1. Localization

The process in which Dynamsoft Barcode Reader decodes MaxiCodes is to first localize the concentric circles. This is the seed area for the next phase ⁠— segmentation. Based on the circles, DBR will search for the six orientation patterns.

  1. Segmentation

The basic idea of the segmentation process is to start from the bullseye and to gradually expand its boundary.

First, the software searches for the six orientation patterns. After DBR has determined the correct orientation, it calculates the exact direction of each border based on the statistical features of the modules’ distribution. DBR will then seek the position from inside to the outside. From there, it can determine how many lines of modules are in the area of the code. The search continues until all 33 lines are found.

  1. Decoding

Once the borders are detected, the polygon is then meshed, resampled, and binarized. Finally, the pattern of the mesh nodes are evaluated to decipher the encoded value.

Technical Hurdles of MaxiCode and How DBR Overcomes Them

Due to the nature of MaxiCode’s design, there are a number of challenges that can arise. Below are a few unique challenges when decoding MaxiCode symbols.

The Concentric Circles

The concentric circles used to localize the image can become damaged (due to a printing error, circles can become off-center or smudged during transit, etc.), making it difficult to read the symbol.

The Orientation

Similarly to the concentric circles, the orientation patterns could become damaged or distorted, causing difficulties in determining the orientation, which is the starting point of the Segmentation phase.

In the event where one or two orientation patterns are damaged, DBR will select the best composition of the orientation patterns to determine the rough orientation of the MaxiCode.

The Dots

Since MaxiCode is composed by sparse dots, the reader can become confused on delineations of the borders and modules. If there is too much space between the modules, the reader may mistake it for a quiet zone.

To resolve this, DBR searches for exact orientation of each border independently. This way, it can minimize the influence of the distribution of modules close to the borders.

The Perspective

Compared to other codes comprised of squares and bars, the concentric circles are not too useful in determining the perspective of a MaxiCode. The six orientation patterns works a bit better, but they are fairly small, 18 modules (6 patterns * 3 modules per pattern) compared with the 886 modules of the whole code. Thus, a minor deviation of the coordinates calculation of the 6 orientation patterns in the middle could result in significant inaccuracy when calculating the overall code size and orientation.

DBR overcomes this hurdle with the aforementioned four steps. After getting a rough orientation based on the orientation patterns, DBR calculates the exact direction of each border. Then it expands from the circle out to find a quadrilateral, which an anti-perspective algorithm can convert to a rectangle. DBR can handle MaxiCode with perspective to a wide degree.

Getting Started

Interested in testing Dynamsoft Barcode Reader on your MaxiCodes? Download our free 30-day trial.

We support the following languages and platforms:

Start your Free 30-Day Trial

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.

Subscribename@email.com