Data Matrix Code Reader vTool#
Data Matrix Code Reader 可以检测并解码通过图像输入引脚接收的图像中的数据矩阵码。它通过区域和文本输出引脚来输出结果。
区域输出包含找到数据矩阵码的区域。文本输出是由数据矩阵码编码的文本字符串。
如果您在检测前使用 ROI Creator vTool 指定感兴趣区域,则 Data Matrix Code Reader 会通过其 Roi 输入引脚接受 ROI 数据。这样可减少 Data Matrix Code Reader 在其中搜索代码的图像区域,从而有助于消除错误候选码。同时,这也会让处理速度更快且更稳定。
The Data Matrix Code Reader vTool can be bought as a single license (Basic or Pro) or as part of the Code Reader Bundle license. To buy a license, visit the Basler website.
Data Matrix Code Reader 版本#
有三个版本的 Data Matrix Code Reader 可用。下表显示了版本之间的差异。单击表标题中的版本可直接跳转到本主题中的相关部分。
Starter | Basic | Pro | |
---|---|---|---|
您可以检测到多少数据矩阵码? | 3 | 3 | 不受限制 |
您是否可以检测到 GS1 数据矩阵码? | 无 | 是 | 是 |
您可以指定检测的超时时间吗? | 无 | 是 | 是 |
允许哪些模块大小? | Minimum side length is 3 pixels | 边长介于 6–20 个像素之间 | Side lengths between 1–100 pixels |
模块之间是否允许存在间隙? | 无 | 无 | 是 |
模块是否允许倾斜? | 是,但必须符合模块大小 | Yes, up to 10° | Yes, up to 30° |
模块是否必须位于矩阵网格结构内? | 是 | 是 | 无 |
您是否可以检测到前亮后暗数据矩阵码? | 否 这需要一个预处理步骤。 | 否 这需要一个预处理步骤。 | 是 |
您是否可以检测到镜像的数据矩阵码? | 是 | 是 | 是 |
是否可以使用强化检测模式? | 无 | 无 | 是 |
Is the maximum detection mode available? | 无 | 无 | 是 |
ROI 输入引脚的有效数据类型 | RectangleF | RectangleF、RectangleF 数组、区域、区域数组 | RectangleF、RectangleF 数组、区域、区域数组 |
Buy license | Included in the pylon Software Suite | Visit Basler website | Visit Basler website |
运作原理#
信息
Data Matrix Code Reader Starter vTool 不支持 GS1 二维码检测。
视 Data Matrix Code Reader 的版本而定,您可以在图像中检测到多达三个或无限数量的数据矩阵码。
在 Basic 和 Pro 版本中,您可以指定超时时间以在一定时间后结束检测。如果您知道您的图像仅包含一个数据矩阵码,则配置 Data Matrix Code Reader 只寻找一个代码可以节省处理时间。
常见用例#
- Reading 数据矩阵码:在这种情况下,您只需连接 Texts 输出引脚,即可输出解码后的字符串。
- 确定数据矩阵码的 positions:使用从 Regions 输出引脚返回的数据矩阵码的位置和大小进行后续处理。
Data Matrix Code Reader Starter#
您可以在图像中检测到多达三个数据矩阵码。将数量限制为图像中的预期代码数量可以节省处理时间。不支持检测 GS1 数据矩阵码。若要进行检测,您需要 Basic 或 Pro 版的 vTool。
检测标准#
数据矩阵码必须满足以下标准,才能检测到并予以解码:
- Code structure: The Data Matrix Code Reader Starter supports the standard Data Matrix code ECC200 structure (matrices with 8 to 144 rows and 10 to 144 columns).
- Module size: The sides of individual modules in the matrix must be at least 3 pixels long.
- 模块之间的间隙:模块之间不允许存在间隙。
- 倾斜:只要不超过模块大小,代码就可以倾斜。
- 网格一致性:所有模块都必须位于矩阵网格内。
- 极性:数据矩阵码必须是明暗模式。对于前亮后暗模式,请运行预处理步骤来反转输入图像,例如,使用 Gray Value Transformer vTool。
- 镜像:可以检测到垂直和/或水平镜像的数据矩阵码。
- 易读性:代码必须没有视觉缺陷,例如,没有反射或污迹,并且必须具有足够的分辨率。
配置 vTool#
要配置 Data Matrix Code Reader Starter vTool:
- 在 vTool 设置区域的配方管理窗格中,单击打开设置或双击 vTool。
Data Matrix Code Reader Starter 对话框即打开。 - 在 Number of Data Matrix Codes 区域中,选择要检测的数据矩阵码数量。
您可以在引脚数据视图中查看 Data Matrix Code Reader Starter 的结果。在这里,您可以选择要显示的输出。
Data Matrix Code Reader Basic#
您可以在图像中检测到多达三个数据矩阵码。将数量限制为图像中的预期代码数量可以节省处理时间。
检测标准#
数据矩阵码必须满足以下标准,才能检测到并予以解码:
- Code structure: The Data Matrix Code Reader Basic supports the standard Data Matrix code ECC200 structure (matrices with 8 to 144 rows and 10 to 144 columns).
- 模块大小:矩阵中各个模块的边长必须在 6 和 20 像素之间。
- 模块之间的间隙:模块之间不允许存在间隙。
- Slant: Codes with a slant up to 10° can still be read.
- 网格一致性:所有模块都必须位于矩阵网格内。
- 极性:数据矩阵码必须是明暗模式。对于前亮后暗模式,请运行预处理步骤来反转输入图像,例如,使用 Gray Value Transformer vTool。
- 镜像:可以检测到垂直和/或水平镜像的数据矩阵码。
- 易读性:代码必须没有视觉缺陷,例如,没有反射或污迹,并且必须具有足够的分辨率。
数据代码类型#
数据代码类型下拉列表允许您选择要查找的数据代码类型:
- 数据矩阵码
- GS1 数据矩阵码
数据矩阵码和 GS1 数据矩阵码的符号结构相同,但其编码方案不同。
When decoding standard Data Matrix codes, the Data Matrix Code Reader Basic outputs the raw strings. If you select GS1 Data Matrix codes, the Data Matrix Code Reader Basic decodes the strings in a format that is compliant with the GS1 standard.
超时#
对于时间要求严格的应用程序,您可以指定超时。在处理时间变化或无法预见的情况下,超时会有所帮助,例如,如果图像不包含数据矩阵码。一旦超过指定的超时时间,检测过程就会停止,并继续处理下一个图像。
Basler 建议将超时设置为略低于所需的时间限制。这是因为 vTool 不会立即停止检测过程。因此,将超时设置为所需时间限制的 70%-80%。
配置 vTool#
配置 Data Matrix Code Reader Basic vTool:
- 在 vTool 设置区域的配方管理窗格中,单击打开设置或双击 vTool。
Data Matrix Code Reader Basic 对话框即打开。 - 在数据代码类型下拉列表中,选择所需的数据代码类型。
- 在 Number of Data Matrix Codes 区域中,选择要检测的数据矩阵码数量。
- 在 Timeout 区域中,指定是否要在一定时间后结束检测。如果要指定超时,请清除 No timeout 复选框并在输入字段中输入所需的超时。
您可以在引脚数据视图中查看 Data Matrix Code Reader Basic 的结果。在这里,您可以选择要显示的输出。
Data Matrix Code Reader Pro#
您可以在图像中检测到无限数量的数据矩阵码。将数量限制为图像中的预期代码数量可以节省处理时间。
检测标准#
数据矩阵码必须满足以下标准,才能检测到并予以解码:
- Code structure: The Data Matrix Code Reader Pro supports the standard Data Matrix code ECC200 structure (matrices with 8 to 144 rows and 10 to 144 columns).
- Module size: In Enhanced detection mode, the sides of individual modules must be between 2 and 100 pixels long. In Maximum detection mode, the sides of individual modules must be between 1 and 100 pixels long.
- 模块之间的间隙:模块之间允许存在小间隙。
- Slant: Codes with a slant up to 30° can still be read.
- 网格一致性:部分位于矩阵网格之外的模块仍可读取。
- 极性:数据矩阵码可以是前暗后亮图案或前亮后暗图案或两者的混合。
- 镜像:可以检测到垂直和/或水平镜像的数据矩阵码。
- 易读性:可以检测到具有视觉缺陷(例如反射或污迹)且分辨率偏低的代码。
数据代码类型#
数据代码类型下拉列表允许您选择要查找的数据代码类型:
- 数据矩阵码
- GS1 数据矩阵码
数据矩阵码和 GS1 数据矩阵码的符号结构相同,但其编码方案不同。
When decoding standard Data Matrix codes, the Data Matrix Code Reader Pro outputs the raw strings. If you select GS1 Data Matrix codes, the Data Matrix Code Reader Pro decodes the strings in a format that is compliant with the GS1 standard.
Detection Modes#
Standard: This is a fast detection mode but deformed or low-resolution data codes won't be detected.
Enhanced: In this detection mode, the Data Matrix Code Reader Pro is more tolerant regarding the quality of the Data Matrix codes. This means that codes that don't meet all the detection criteria can be detected. Enabling this option slows down the detection process.
Maximum: In this detection mode, in addition to the advantages of the Enhanced detection mode, the Data Matrix Code Reader Pro accepts smaller module sizes, is more robust in the detection of smaller modules, and is more tolerant regarding finder pattern deformations. This means that more codes that don't meet all the detection criteria can be detected. Enabling this option slows down the detection process.
超时#
对于时间要求严格的应用程序,您可以指定超时。在处理时间变化或无法预见的情况下,超时会有所帮助,例如,如果图像不包含数据矩阵码。一旦超过指定的超时时间,检测过程就会停止,并继续处理下一个图像。
Basler 建议将超时设置为略低于所需的时间限制。这是因为 vTool 不会立即停止检测过程。因此,将超时设置为所需时间限制的 70%-80%。
配置 vTool#
配置 Data Matrix Code Reader Pro vTool:
- 在 vTool 设置区域的配方管理窗格中,单击打开设置或双击 vTool。
Data Matrix Code Reader Pro 对话框即打开。 - 在数据代码类型下拉列表中,选择所需的数据代码类型。
- 在数据矩阵码数量区域中,选择要检测的数据矩阵码数量。如果不知道要检测的最大代码数量,请选择无限制。
- In the Detection Mode area, select the desired detection mode.
- 在极性下拉列表中,选择适合您应用的选项。
如果您的应用中的代码具有特定的极性,请相应地选择设置。如果图像中代码的极性未知或出现多个具有不同极性的代码,请选择任意。 - 在 Timeout 区域中,指定是否要在一定时间后结束检测。如果要指定超时,请清除 No timeout 复选框并在输入字段中输入所需的超时。
您可以在引脚数据视图中查看 Data Matrix Code Reader Pro 的结果。在这里,您可以选择要显示的输出。
输入#
图像#
直接从 Camera vTool 或从输出图像的 vTool(例如 Image Format Converter vTool)接受图像。
- 数据类型:图像
- 图像格式:8 位单色或彩色图像。彩色图像在内部转换为单色图像。
ROI#
从 ROI Creator vTool 或任何其他可输出区域或矩形的 vTool 中接受感兴趣区域。多个矩形或区域在内部合并以形成单个感兴趣区域。Starter 版本仅接受 RectangleF。
- 数据类型:RectangleF、RectangleF 数组、区域、区域数组
输出#
文本#
返回以数据矩阵码编码的文本字符串。
- 数据类型:字符串数组
区域#
Returns a region for each Data Matrix code found. The region is of rectangular shape. It can be used for visualization purposes or for subsequent feature extraction.
- 数据类型:区域数组
OrientedBoxes_px#
Returns an oriented bounding box for each Data Matrix code found.
- 数据类型:RectangleF 数组
相关的 vTools#
典型前置项#
典型后置项#
- Region Feature Extraction vTool
允许您确定找到的数据矩阵码的中心、大小和方向。