Information Reading (1D/2D Code Recognition)

You are currently viewing the documentation for a pre-release version (2.2.0). To access documentation for other versions, click the "Switch Version" button located in the upper-right corner of the page.

■ If you're unsure about the version of the product you are using, please contact Mech-Mind Technical Support for assistance.

This section introduces the target object recognition configuration workflow for 1D/2D code recognition scenarios. This method is used to read 1D/2D code information on target objects and obtain identification data such as material codes and serial numbers.

Click Configuration Wizard, select the Information Reading scenario, and choose 1D/2D Code Recognition to enter this workflow.

Workflow

The overall recognition workflow includes four steps:

information reading process
  1. Image Preprocessing: Performs preprocessing such as color conversion, enhancement, denoising, and morphological transformations on input images to improve image quality, highlight target-object features, and reduce background interference, providing reliable data for subsequent 1D/2D code recognition.

  2. Pose Alignment: Sets the recognition region and aligns recognition targets with templates through alignment operations. Appropriate correction methods can be selected based on target features, with flexible parameter settings to eliminate position and angle deviations and improve recognition accuracy and reliability.

  3. Information Reading: Based on actual requirements, sets target regions for detection in aligned images and configures judgment rules to accurately read and parse 1D/2D code content and verify correctness.

  4. General Settings: Configures output ports to output recognition results and key information, meeting automated production-line inspection and data traceability needs.

Image Preprocessing

Before recognition, you can enable Convert Image Color Space or Image Preprocessing to improve target features.

Convert Image Color Space

Convert input image from one color space to another (for example, BGR to Gray or BGR to HSV) to highlight features for subsequent processing.

For details, see Convert Image Color Space.

Image Preprocessing Parameters

Supports enhancement, denoising, morphology, grayscale inversion, and edge extraction.

For details, see Image Preprocessing.

Preview Preprocessing Result

After configuration, click Run Step or Run Project to preview results, then click Next.

Pose Alignment

After preprocessing, configure pose alignment so target pose in current image is corrected to match template pose.

Add Alignment Settings

Create a parameter group for pose alignment. Multiple groups are supported and independent from each other.

Click Add to create a new group, choose alignment mode, and configure parameters.

add parameter group

Supported modes:

  • No Alignment: Use input image directly without pose correction.

  • 2D Alignment: Align through translation/rotation with edge-based matching. See 2D Alignment.

  • 2D Blob Alignment: Align based on selected Blob centroid and principal axis. See 2D Blob Alignment.

After creating a group, right-click group name (or use action button) to rename, delete, or duplicate.

parameter group management operation

2D Alignment

2D Alignment uses translation and rotation to align target object in input image to template.

Set Recognition Region

Set effective alignment area. Region should fully cover target object with proper margin.

  • Whole Image as Recognition Region: Use entire image.

  • Custom Recognition Region: Manually draw region and ignore unrelated background.

Recognize Target Object

Configure Target Template

After region setup, choose/edit template in 2D template editor by clicking Edit.

Select representative and stable edge features to ensure unique and accurate matching. For details, see 2D Matching Template Editor.

Click Update after each template edit.
Adjust Recognition Parameters

Click Run Step to view matching result and tune parameters if needed.

For details, see 2D Alignment.

Click Next to continue.

2D Blob Alignment

2D Blob Alignment detects blobs, selects target Blob by geometric features, then aligns centroid and principal axis.

Set Recognition Region

Set effective area with sufficient margin. Rectangle and circle region modes are supported, and multiple regions can be mixed.

Recognize Target Object

Tune parameters according to target features.

For details and tuning examples, see 2D Blob Alignment.

View Running Result

Click Run Step or Run Project to inspect result, then click Next.

Information Reading

After image alignment, start recognizing 1D/2D codes within the specified image region to output code content and its image position.

Set Target Region

Set the valid region used for 1D/2D code detection. During ROI selection, fully cover the code to be detected and exclude irrelevant background interference. You can choose Use Entire Image as Recognition Region or Custom Recognition Region based on actual requirements. If custom recognition is selected, click the "ROI Selection" button and manually select the recognition region.

  • Use Entire Image as Recognition Region: Performs recognition on the whole image. It is usually suitable when 1D/2D codes are distributed over a wide area.

  • Custom Recognition Region: Performs recognition only in the selected ROI. It is usually suitable when only part of the image needs attention or irrelevant regions (such as background or fixture interference) should be excluded, helping improve recognition efficiency and accuracy.

Set Judgment Logic

After enabling judgment logic, you can enter the 1D/2D code content for judgment. Target code content can be obtained through global variables or manual input.

Parameter Description

Switch to Global Variable

Description: After selecting this parameter, values in global variables can be used for content judgment. It is suitable for scenarios where 1D/2D code content changes dynamically. Global variable values can be generated by other steps or projects. For usage, refer to Global Variables.

Switch to Manual Input

Description: This parameter is used to set custom 1D/2D code content for judgment. It is suitable for scenarios where 1D/2D code content is fixed.

View Judgment Results

After completing the above parameter settings, click Run Step or Run Project to view judgment results.

Then click Next to enter the general settings workflow.

General Settings

In this workflow, auxiliary functions outside visual recognition can be configured. Output port configuration is currently supported.

Configure Output Ports

Here, you can select output ports according to actual requirements. 1D/2D code content is output by default.

  • 1D/2D Code Position: Outputs the position of the 1D/2D code in the image.

  • 1D/2D Code Verification Result: Indicates whether 1D/2D code verification passes. Outputs true if passed, otherwise false. This port is displayed only when Judgment Logic is enabled.

After selecting these ports, the 2D Target Object Recognition step adds corresponding output ports in real time.

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.