AI 1D/2D Barcode Recognition

You are currently viewing the documentation for the latest version (2.2.2). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Function Description

This Step recognizes 1D and 2D barcodes within a specified image region and outputs information such as barcode content, barcode type, barcode center pose, barcode contour, and judgment results. Supported barcode types include Code 128, Code 39, Code 93, EAN, UPC, DM Code, and QR Code.

This Step requires a Lite AI license. Contact Mech-Mind Sales to obtain one.

Usage Scenario

This Step is suitable for vision inspection and robot guidance scenarios where 1D or 2D barcode information needs to be read, such as loading, unloading, sorting, and traceability applications in industries including 3C, automotive parts, medical, and logistics and warehousing.

Input and Output

Input

Input Port Data Type Description

Image

Image

Image containing 1D or 2D barcodes.

Object Pose

Pose2D[]

The position and orientation of the matched object in the image.

Output

Output Port Data Type Description

Barcode Content

String[]

The content of the recognized 1D/2D barcodes. When multiple barcodes are recognized, the contents are output according to the sorting method.

Barcode Type

String[]

The types of the recognized 1D/2D barcodes, such as Code 128, QR Code, and DM Code. When multiple barcodes are recognized, the types are output according to the sorting method.

Barcode Center Poses

Pose2D[]

The 2D poses of the centers of the recognized 1D/2D barcodes in the image. When multiple barcodes are recognized, the poses are output according to the sorting method.

Barcode Contours

Shape2D/Contour[]

The image coordinates of the four vertices of each recognized 1D/2D barcode region. Connecting the four vertices forms the barcode contour. When multiple barcodes are recognized, the contours are output according to the sorting method.

Single Barcode Judgment Results

Bool[]

The reading judgment result for each 1D/2D barcode. The output is true if the corresponding barcode is read successfully; otherwise, it is false. When multiple barcodes are recognized, the results are output according to the sorting method.

All Barcodes Judgment Result

Bool

The overall judgment result for all 1D/2D barcodes. When count judgment is disabled, the output is true only if all individual barcodes are read successfully. When count judgment is enabled, the output is true only if all individual barcodes are read successfully and the actual number of recognized barcodes equals the expected count; otherwise, it is false. If timeout judgment is enabled and recognition is not completed within the specified time, the output is false.

Image with Results

Image

Image with recognition results.

Parameter Description

1D Barcode Settings

Parameter Description

Barcode Types

Select the types of 1D barcodes to recognize. Only the selected types of 1D barcodes will be recognized, which helps reduce misrecognition and improve recognition efficiency.

Value List: Select All, Code 128, Code 39, Code 93, EAN, UPC

Barcode Polarity

Sets the polarity of the barcode image to be recognized. Select the polarity based on the color relationship between the barcode and its background to reduce misrecognition and improve recognition stability.

Value List:

  • Black Barcode on White Background: Recognizes dark barcodes on light backgrounds.

  • White Barcode on Black Background: Recognizes light barcodes on dark backgrounds.

Enable Deformation Correction

When enabled, the Step corrects barcode deformation during recognition to improve the recognition success rate of 1D/2D barcodes. The correction is used for recognition only and does not modify the original image. Enabling this option increases Step processing time.

2D Barcode Settings

Parameter Description

Code

Select the types of 2D barcodes to recognize. Only the selected types of 2D barcodes will be recognized, which helps reduce misrecognition and improve recognition efficiency.

Value List: Select All, DM Code, QR Code

Barcode Polarity

Sets the polarity of the barcode image to be recognized. Select the polarity based on the color relationship between the barcode and its background to reduce misrecognition and improve recognition stability.

Value List:

  • Auto: Recognizes both dark barcodes on light backgrounds and light barcodes on dark backgrounds.

  • Black Barcode on White Background: Recognizes dark barcodes on light backgrounds.

  • White Barcode on Black Background: Recognizes light barcodes on dark backgrounds.

Enable Deformation Correction

When enabled, the Step corrects barcode deformation during recognition to improve the recognition success rate of 1D/2D barcodes. The correction is used for recognition only and does not modify the original image. Enabling this option increases Step processing time.

DM Code Size

Sets the size of the DM Codes to be recognized. When a specific size is selected, the Step recognizes only codes of that size, improving recognition speed and reducing misrecognition. If you are unsure of the actual code size, select Auto, and the Step will determine the DM Code size automatically.

Value List: Auto, 10*10, 12*12, 14*14, 16*16, 18*18, 20*20, 22*22, 24*24, 26*26, 32*32, 36*36

QR Code Size

Sets the size of the QR Codes to be recognized. When a specific size is selected, the Step recognizes only codes of that size, improving recognition speed and reducing misrecognition. If you are unsure of the actual code size, select Auto, and the Step will determine the QR Code size automatically.

Value List: Auto, 21*21, 25*25, 29*29, 33*33, 37*37, 41*41

General Settings

Parameter Description

Sorting Method

Sets how multiple 1D/2D barcode recognition results are sorted. The Step sorts the results based on barcode center coordinates. The output ports for barcode content, barcode type, barcode center poses, barcode contours, and single barcode judgment results follow this sorting method.

Value List:

  • X then Y: Sorts first by the X coordinate and then by the Y coordinate. This is suitable when barcodes are mainly arranged horizontally.

  • Y then X: Sorts first by the Y coordinate and then by the X coordinate. This is suitable when barcodes are mainly arranged vertically.

  • Auto Grid Sorting: Automatically sorts barcodes by grid structure. Based on the Y-coordinate proximity of barcode centers, barcodes are divided into rows. Barcodes within each row are sorted by X coordinate, and rows are sorted by Y coordinate. This is suitable when multiple barcodes are arranged in regular rows and columns.

Verification Method

Sets how barcode recognition results are verified to determine whether they comply with the corresponding standards or rules. Verification results are output through the Single Barcode Judgment Results and All Barcodes Judgment Result ports.

Enable Count Judgment

When enabled, the Step checks whether the actual number of recognized 1D/2D barcodes equals the expected count and uses this result as one of the judgment conditions for All Barcodes Judgment Result.

Expected Count

Sets the expected number of 1D/2D barcodes to be recognized.

Adjustment: Set this parameter when Enable Count Judgment is selected.

Enable Timeout Judgment

When enabled, you can set a recognition timeout. If the Step runtime exceeds the specified time before recognition is completed, the All Barcodes Judgment Result port outputs false. If barcodes are recognized within the specified time, the other ports output the recognition results. If no barcodes are recognized within that time, the other ports produce no output.

Timeout

Sets the maximum duration for a single recognition, in milliseconds (ms).

Adjustment: Set this parameter when Enable Timeout Judgment is selected.

The actual Step runtime may be slightly longer than this value, which is normal.

Visualization Settings

Parameter Description

Font Scaling Ratio

Sets the text font scaling ratio for the visualization image.

Visualized Recognition Results

When enabled, the Step outputs an image with visualized recognition result information, making it easier to view the recognition results of 1D/2D barcodes.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.