OCR - 识别和读取字符

<< 点击显示目录 >>

主页  mappVision帮助助手 > 机器视觉帮助 > mapp Vision  > 用例 >

OCR - 识别和读取字符

本节介绍为标准应用配置视觉功能OCR的基本方法。

要求

定义NumSearchMax

定义MaxStringSize

确定 OCRC 分类器

OCR 功能根据OCRClassifier 定义的预定义字体识别文本。OCRClassifier的选择取决于应读取的字体。有几种方法可以识别/定义对象上使用的字体:

将应读取的字体与文档中的示例进行比较(请参阅预训练 OCR 字体)。

使用ParameterMode= 0,即使用通用分类器。

使用ParameterMode= 1,允许手动更改参数,以便测试各个分类器。

定义搜索角度

SearchAngle定义文本的搜索方向。每次使用 OCR 功能时只能设置一次。必须将SearchAngle与要读取的文本精确对齐,这会影响文本的可识别性。

信息:

使用 TestExecute = 1 可以在 mapp Vision HMI 应用程序中显示找到的文本区域。

搜索优化

根据要识别的文本调整参数。在 mapp Vision HMI 应用程序中,可以使用移液管功能确定字符的宽度和高度。

必须通过激活参数的"ParameterMode= 1 "手动调整数值。

如果未找到文本,则设置合适的超时时间

优化执行兴趣区域(有限区域)。

信息:

重要的是,在改变字符大小时,字符的定义范围不能太窄。在某些情况下,这会导致结果失真。

加速搜索

优化执行兴趣区域(限制区域)。

如果可能,记录的文本在图像中不应显示得太大。这会增加搜索的处理时间。

如果可能,记录要读取的文本,使其在图像中处于水平位置。

本节主题:

预训练 OCR 字体

处理参数模式为 "用户定义 "的配方


This section describes the basic approach to configuring vision function OCR for standard applications.

Requirements

Define NumSearchMax.

Define MaxStringSize.

Determining OCRClassifier

The OCR function identifies texts based on predefined fonts that are defined by OCRClassifier. The selection of OCRClassifier depends on the font that should be read. There are several ways to identify/define the font used on the object:

Compare the font that should be read with the examples in the documentation (see Pre-trained OCR fonts).

Use ParameterMode = 0, which uses a universal classifier.

Use ParameterMode = 1, which allows the parameters to be changed manually so that the individual classifiers can be tested.

Defining SearchAngle

SearchAngle defines the search direction for a text. This can only be set once each time an OCR function used. An exact alignment of SearchAngle to the text to be read is necessary and affects the recognizability of the text.

Information:

The found text regions can be displayed in the mapp Vision HMI application by using TestExecute = 1.

Search optimization

Adapt the parameters to the text to be identified. In the mapp Vision HMI application, the width and height of the characters can be determined using the pipette function.

The values must be adjusted manually with active "ParameterMode = 1" for the parameters.

Set a suitable timeout if no text is found.

Optimize the Execution ROI (limited area).

Information:

It is important that the characters are not too narrowly defined when changing their size. This can result in a distortion of the result under certain circumstances.

Accelerating the search

Optimize the Execution ROI (restricted area).

If possible, the recorded text should not appear too large in the image. This increases the processing time of the search.

Record the text to be read so that it is horizontal in the image, if possible.

Topics in this section:

Pre-trained OCR fonts

Handling recipes with ParameterMode "User-defined"