Skip to main content
Version: 10.2.9

Recognize barcodes

Enable barcode extraction mode

OCR provides document processing with the barcodeRecognition profile designed for barcode extraction scenarios. The use of this profile as the profile parameter in API activates barcode extraction mode.

The mode extracts barcodes only. Texts, pictures, or tables are ignored.

Check prerequisites

Barcodes should be available in your license.

View license info

Use APIs to define all available information about the license:

  • /api/v1/cloud/activeLicense
  • /api/v1/cloud/listLicenses

According to the license parameters, you can recognize the following barcode types with OCR:

  • 1D
  • 2D

See the /activeLicense response example below:

<availableBarcodeModules>ABM_1D</availableBarcodeModules>
<availableBarcodeModules>ABM_PDF417</availableBarcodeModules>
<availableBarcodeModules>ABM_Aztec</availableBarcodeModules>
<availableBarcodeModules>ABM_QRCode</availableBarcodeModules>
<availableBarcodeModules>ABM_MaxiCode</availableBarcodeModules>
<availableBarcodeModules>ABM_DataMatrix</availableBarcodeModules>
<availableBarcodeModules>ABM_Autolocation</availableBarcodeModules>

Configure barcode recognition settings

To enable barcode recognition, perform the following steps:

  • A document with a barcode only is recognized automatically when profile=barcodeRecognition is used.
  • A document with text requires the use of either profile=barcodeRecognition or the custom region of type = BT_Barcode.
  • Usage of the profile or custom region is mandatory.
  • The barcode extraction contains:
    • Barcode only with the activated profile
    • Barcode and other blocks with custom regions

Explore 1D barcodes

  • Codabar is a self-checking, variable-length barcode that can encode 16 data characters. It is used primarily for numeric data but also encodes six special characters. Codabar is useful for encoding dollar and mathematical figures because a decimal point, plus sign, and minus sign can be encoded.
  • Code 128 is an alphanumeric, very high-density, compact, variable-length barcode scheme that can encode the full 128 ASCII character set. Each character is represented by three bars and three spaces totaling 11 modules. Each bar or space is one, two, three, or four modules wide, with the total number of modules representing bars an even number and the total number of modules representing a space an odd number. Three different start characters are used to select one of three character sets.

Explore 2D barcodes

  • PDF 417 is a variable length, stacked symbology that can store up to 1,850 printable ASCII characters or 1,100 binary characters per symbol. PDF417 is designed with selectable levels of error correction. Its high data capacity can be helpful in applications where a large amount of data must travel with a labeled document or item.
  • Aztec is high-density two-dimensional matrix-style bar code symbology that can encode up to 3,750 characters from the entire 256 byte ASCII character set. The symbol is built on a square grid with a bulls-eye pattern at its center.
  • QR Code is the next-generation format used already in Japan for both image and text data with the ability to store URLs that can be read and launched by appropriate software.
  • Data Matrix.
  • MaxiCode is created and used by United Parcel Service.

View barcode recognition examples

Profile

profile=barcodeRecognition

  • A barcode only is displayed on the provided image:

    Recognition result: A31117013206375B.

  • A barcode and additional text are displayed on the provided image:

    Recognition result: 1ode*O28. Mind that the barcode is recognized only when the profile is used.

Custom region

customRegions=[ {"page":1,"left":60,"top":50,"right":245,"bottom":205, "type":"BT_Barcode" }]

To define a custom region on the image, perform the following steps:

  1. Use a simple picture editor, for example, Paint.

  2. Switch on the Rulers feature and try to define points (coordinates) of borders (px).

    Recognition result:

    Code 1ode*O28 Code 128 is an alphanumeric very high-density, compact variable length barcode scheme that can encode the full 128 ASCII character set. Each character is represented by three bars and three spaces totaling 11 modules. Each bar or space is one, two, three, or four modules wide with the total number of modules representing bars an even number and the total number of modules representing a space an odd number Three different start characters are used to select one of three character sets. 1ode*O28

Recognition can fail in the following cases:

  • The page size is larger than the provided region.
  • The page size is smaller than the provided region.
troubleshooting

For troubleshooting tips, refer to the following support guides: