<< 点击显示目录 >> 主页 mappVision帮助助手 > 机器视觉帮助 > mapp Vision > 编程 > 视觉功能 > OCR > OCR 配置(非循环写入) |
本节介绍 MVTec 的 HALCON 22.11 机器视觉软件库中包含的参数。
信息:
这些参数可直接在 mapp Vision HMI 应用程序中更改(参见配置视觉功能)。
信息:
决定 POWERLINK 帧长度的单个配置参数只能在 AS 软件的配置过程中更改(即循环更改)。因此,这些参数只能在运行时读取,并标识为常量。
UCHAR |
2 至 254 |
一行/行中的最大字符数 默认值:50 |
|
R/W1 |
|
UCHAR |
1 至 255 |
分割区域(即线条)的最大数量 默认值:10 |
|
R/W1 |
|
配置参数 |
|||||
UCHAR |
1 至 255 |
字符与背景的最小对比度 默认值 = 15 |
|
R/W |
|
UINT16 |
0 至 2 |
0 = 灯亮暗(默认值) 1 = 明_暗 2 = 两种 = 两种极性都与搜索相关。 |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最小高度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最大高度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最小宽度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最大宽度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
BOOL |
0 至 1 |
0 = 真 1 = 假(默认值) 提高点矩阵的可识别性。 |
|
R/W |
|
UCHAR |
0 至 67 |
用于选择预训练字体集的分类器。 默认值:Universal_Rej.occ |
|
R/W |
|
UINT16 |
0 至 2 |
控制将相邻字符分割为一个区域时的处理方式。 0 = 假 1 = 默认(默认值) 2 = 增强 |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最小笔画宽度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
字符的最大笔画宽度(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
定义用于识别的文本结构(例如,"2 2 4 "表示日期 DD.MM.YYYYY) 默认值 |
|
R/W |
|
字符串 |
|
文本行结构搜索过程中应忽略的字符串。 默认值'' |
|
R/W |
|
UCHAR |
0 至 255 |
两个字符(DotPrint)之间的最小间距,以像素为单位,从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
UCHAR |
0 至 255 |
两个字符(DotPrint)之间的最大距离(像素),从 1 到 255 0 = 自动(默认值) |
|
R/W |
|
INT16 |
-17999 至 18000 |
搜索方向,从 -179.99° 到 +180.00°,增量为 1/100°。 |
|
R/W |
1 |
该配置参数在运行时保持不变,此时只能 "读取"。 |
运行时不可修改的变量。该值相当于一行中的最大字符数。最大内存长度为一行最大字符数 + 1(由于空结束符)。
信息:
搜索上限应设置为应用程序中可能出现的最大值。如果搜索结果的字符数超过配置的最大字符数,则搜索失败。
运行时不可修改的变量。仅在 AS 软件上下文中需要使用。保留内存块的最大数量。分段区域(行)的最大数量。
信息:
MaxStringSize 和 NumResultsMax 的乘积必须小于 1490,以免超过 POWERLINK 框架的最大长度。
字符与背景相比的极性。深色文字在浅色背景上,浅色文字在深色背景上,或两者兼有。
设置 "都 "搜索两种极性会增加执行时间(ExecutionTime)。
min_char_height "限制字符的高度,但不限制标点符号或分隔符的高度。
可以指定值 "auto "来分割任意高度的字母。"max_char_height "限制字符的高度,但不限制标点符号或分隔符的高度。
min_char_width "限制字符的宽度,但不限制标点符号或分隔符的宽度。
可以指定值 "auto "来分割任意宽度的字符。"max_char_width "限制字符的宽度,但不限制标点符号或分隔符的宽度。
如果要读取点阵(点打印),则应启用此参数,以便更好地识别。否则,设置为 "false"。
用于从现有的标准格式列表中为通用 OCR 选择字符集的参数,该字符集将在获取的图像中进行搜索和解释。
通用 "组中的字体是通过 "深度学习 "进一步改进的字体。
有关示例,请参阅预训练 OCR 字体。
字体 |
值 |
字体 |
|
---|---|---|---|
0 |
Universal_NoRej.occ |
34 |
文档_A-Z+_Rej |
1 |
Universal_Rej.occ (默认值) |
35 |
文档_A-Z+_NoRej |
2 |
Universal_0-9_NoRej.occ |
36 |
文档_0-9_Rej |
3 |
Universal_0-9_Rej.occ |
37 |
文档_0-9_NoRej |
4 |
Universal_0-9+_NoRej.occ |
38 |
文档_0-9A-Z_Rej |
5 |
Universal_0-9+_Rej.occ |
39 |
文档_0-9A-Z_NoRej |
6 |
Universal_0-9A-Z_NoRej.occ |
40 |
OCRA_Rej |
7 |
Universal_0-9A-Z_Rej.occ |
41 |
OCRA_NoRej |
8 |
Universal_0-9A-Z+_NoRej.occ |
42 |
OCRA_A-Z+_Rej |
9 |
Universal_0-9A-Z+_Rej.occ |
43 |
OCRA_A-Z+_NoRej |
10 |
Universal_A-Z+_NoRej.occ |
44 |
OCRA_0-9_Rej |
11 |
Universal_A-Z+_Rej.occ |
45 |
OCRA_0-9_NoRej |
12 |
DotPrint_0-9_NoRej.omc |
46 |
OCRA_0-9A-Z_Rej |
13 |
DotPrint_0-9_Rej.omc |
47 |
OCRA_0-9A-Z_NoRej |
14 |
DotPrint_0-9+_NoRej.omc |
48 |
OCRB_Rej |
15 |
DotPrint_0-9+_Rej.omc |
49 |
OCRB_NoRej |
16 |
DotPrint_0-9A-Z_NoRej.omc |
50 |
OCRB_A-Z+_Rej |
17 |
DotPrint_0-9A-Z_Rej.omc |
51 |
OCRB_A-Z+_NoRej |
18 |
DotPrint_A-Z+_NoRej.omc |
52 |
OCRB_0-9_Rej |
19 |
DotPrint_A-Z+_Rej.omc |
53 |
OCRB_0-9_NoRej |
20 |
DotPrint_NoRej.omc |
54 |
OCRB_0-9A-Z_Rej |
21 |
DotPrint_Rej.omc |
55 |
OCRB_0-9A-Z_NoRej |
22 |
工业_0-9_NoRej.omc |
56 |
OCRB_passport_Rej |
23 |
工业_0-9_Rej.omc |
57 |
OCRB_passport_NoRej |
24 |
工业_0-9+_NoRej.omc |
58 |
制药 |
25 |
工业_0-9+_Rej.omc |
59 |
制药 |
26 |
工业_0-9A-Z_NoRej.omc |
60 |
制药_0-9_Rej |
27 |
工业_0-9A-Z_Rej.omc |
61 |
制药_0-9_NoRej |
28 |
工业_A-Z+_NoRej.omc |
62 |
制药_0-9+_Rej |
29 |
工业_A-Z+_Rej.omc |
63 |
制药_0-9+_NoRej |
30 |
工业_NoRej.omc |
64 |
制药_0-9A-Z_Rej |
31 |
工业_Rej.omc |
65 |
制药_0-9A-Z_NoRej |
32 |
文档_Rej |
66 |
SEMI_Rej |
33 |
文档_NoRej |
67 |
SEMI_NoRej |
如果选择 "标准 "或 "增强",则会检测到此类区域并将其分割为两个或多个单独字符。虽然 "增强 "方法能提供更精确的结果,但 "标准 "方法不那么复杂,因此速度更快。如果 "separate_touching_chars"(分离触摸字符)设置为 "false"(假),则不会分离触摸字符。
如果在文本分割时自动估算最小笔画宽度,可以指定值 "auto"。"min_stroke_width "限制字符的笔画宽度,但不限制标点符号或分隔符的笔画宽度。
如果在文本分割时要自动估计最大笔画宽度,可以指定值 "auto"。"max_stroke_width "限制字符的笔画宽度,但不限制标点符号或分隔符的笔画宽度。
定义文本结构(如日期 DD.MM.YYYY),用于文本识别搜索和选择。
每一行都会计算连续字母之间的距离。根据这些距离,该行将被划分为单个字母块。非常小的字符,如"."、"_"和"-"会被忽略并解释为空格。此外,还可以指定额外的分隔符;这些分隔符也应忽略,请参见文本行分隔符。然后,系统会检查创建的字母块是否与指定的结构之一相对应。结构由一个字符串组成,其中包含每个字母块中用空格分隔的字母/数字的个数。例如,如果要查找一个日期,其中日、月、年分别为两位数,那么结构就是 "2 2 2"。如果年份也可以由四位数字组成,则结构为 "2 2 2-4",这样最后一个数据块就可以由两到四个字母/数字组成。在参数 "text_line_structure_0 "或 "text_line_structure_1 "中添加索引等,可以设置多个结构。如果 text_line_structure 设置为空字符串(" "),则要查找的文本可以由任何结构组成。
包含在搜索 TextLineStructure 过程中应忽略的字符的字符串。
请注意,分类器中必须始终包含这种分隔符。例如,如果字符": "和"\"应被视为分隔符,那么可以指定字符串":\"。需要注意的是,前缀"\"允许使用符号"\"作为字面意义。
两个字符(DotPrint)之间的最小距离,单位为像素。如果字母之间的间隙小于字母内部点之间的间隙,则使用该参数可以获得更准确的分割效果。如果不知道最小尺寸或最小尺寸大于字母内点之间的最大间隙,则可以指定值 "auto"。如果 "dot_print "设置为 "false",该参数将不起作用。
该参数可用于定义两个字符之间的最小距离。如果不同字符之间的 DotPrint 字符间距差别很大,该参数将非常有用。该参数的作用与参数 DotPrintMaxDotGap 类似,但在字符内部,即单个点之间的间距。这两个参数(使用合适的值)都可以提高 OCR 的鲁棒性,但如果设置不正确,也会导致无效/无结果。
字符(DotPrint)两点之间的最大距离,单位为像素。可以指定值 "auto "来分割任何点打印字母。如果 "dot_print "设置为 "false",则该参数无效。
搜索方向从 -179.99° 到 +180°,增量为 1/100°。
SearchAngle 0° 表示文本水平对齐。
如果文本逆时针旋转,SearchAngle 将发生正向变化。如果文本顺时针旋转,SearchAngle 将发生负向变化。
This section describes the included parameters from the HALCON 22.11 machine vision software library from MVTec.
Information:
These parameters can be changed directly in the mapp Vision HMI application (see Configuring vision functions).
Information:
Individual configuration parameters that determine the length of a POWERLINK frame can only be changed during configuration in Automation Studio (i.e. acyclically). These parameters can therefore only be read at runtime and are identified as constants.
UCHAR |
2 to 254 |
Maximum number of characters in a row/line Default value: 50 |
|
R/W1 |
|
UCHAR |
1 to 255 |
Maximum number of segmented regions (i.e. lines) Default value: 10 |
|
R/W1 |
|
Configuration parameters |
|||||
UCHAR |
1 to 255 |
Minimum contrast of characters compared to the background Default value = 15 |
|
R/W |
|
UINT16 |
0 to 2 |
0 = dark_on_light (default value) 1 = light_on_dark 2 = Both = Both polarities are relevant for the search. |
|
R/W |
|
UCHAR |
0 to 255 |
Minimum height of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
Maximum height of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
Minimum width of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
Maximum width of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
BOOL |
0 to 1 |
0 = True 1 = False (default value) Better recognizability of dot matrices. |
|
R/W |
|
UCHAR |
0 to 67 |
Classifier for selecting a pre-trained font set. Default value: Universal_Rej.occ |
|
R/W |
|
UINT16 |
0 to 2 |
Controls how neighboring characters are handled when segmented as a region. 0 = False 1 = Default (default value) 2 = Enhanced |
|
R/W |
|
UCHAR |
0 to 255 |
Minimum stroke width of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
Maximum stroke width of the character in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
Defines a text structure for recognition (e.g. "2 2 4" for the date DD.MM.YYYY) Default value '' |
|
R/W |
|
STRING |
|
A string with characters that should be ignored during the search process for TextLineStructure. Default value '' |
|
R/W |
|
UCHAR |
0 to 255 |
The minimum distance between two characters (DotPrint) in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
UCHAR |
0 to 255 |
The maximum distance between two characters (DotPrint) in pixels from 1 to 255 0 = Auto (default value) |
|
R/W |
|
INT16 |
-17999 to 18000 |
Search direction from -179.99° to +180.00° in increments of 1/100 degree. |
|
R/W |
1 |
This configuration parameter is constant at runtime and in this case only "Read". |
Variable that cannot be modified at runtime. The value corresponds to the maximum number of characters in a line. The maximum memory length is the maximum number of characters in a line + 1 (due to the null terminator).
Information:
The upper limit for the search should be set to the maximum possible value that can appear in the application. The search fails if a result has more than the configured maximum number of characters.
Variable that cannot be modified at runtime. Only necessary in the Automation Studio context. Reserves the maximum number of memory blocks. Maximum number of segmented regions (lines).
Information:
The product of MaxStringSize and NumResultsMax must be less than 1490 to not exceed the maximum length of a POWERLINK frame.
The minimum contrast of characters compared to the background.
The given polarity of characters compared to the background. Dark text on light background, light text on dark background or both.
Setting "both" to search both polarities can increase the execution time (ExecutionTime).
Minimum height of the character in pixels.
Value "auto" can be specified to segment characters of any height. "min_char_height" restricts the height of characters, but not the height of punctuation or separators.
Maximum height of the character in pixels.
Value "auto" can be specified to segment letters of any height. "max_char_height" restricts the height of characters, but not the height of punctuation or separators.
Minimum width of the character in pixels.
Value "auto" can be specified to segment characters of any width. "min_char_width" restricts the width of characters, but not the width of punctuation or separators.
Maximum width of the character in pixels.
Value "auto" can be specified to segment characters of any width. "max_char_width" restricts the width of characters, but not the width of punctuation or separators.
If a dot matrix (dot prints) should be read, this parameter should be enabled for better recognition. Otherwise, set to "false".
Parameter to select a character set for the generic OCR from an existing list of standard formats, that will be searched for in the acquired image and interpreted.
The fonts in group "Universal" are those that are further improved via "deep learning".
For examples, see Pre-trained OCR fonts.
Font |
Value |
Font |
|
---|---|---|---|
0 |
Universal_NoRej.occ |
34 |
Document_A-Z+_Rej |
1 |
Universal_Rej.occ (default value) |
35 |
Document_A-Z+_NoRej |
2 |
Universal_0-9_NoRej.occ |
36 |
Document_0-9_Rej |
3 |
Universal_0-9_Rej.occ |
37 |
Document_0-9_NoRej |
4 |
Universal_0-9+_NoRej.occ |
38 |
Document_0-9A-Z_Rej |
5 |
Universal_0-9+_Rej.occ |
39 |
Document_0-9A-Z_NoRej |
6 |
Universal_0-9A-Z_NoRej.occ |
40 |
OCRA_Rej |
7 |
Universal_0-9A-Z_Rej.occ |
41 |
OCRA_NoRej |
8 |
Universal_0-9A-Z+_NoRej.occ |
42 |
OCRA_A-Z+_Rej |
9 |
Universal_0-9A-Z+_Rej.occ |
43 |
OCRA_A-Z+_NoRej |
10 |
Universal_A-Z+_NoRej.occ |
44 |
OCRA_0-9_Rej |
11 |
Universal_A-Z+_Rej.occ |
45 |
OCRA_0-9_NoRej |
12 |
DotPrint_0-9_NoRej.omc |
46 |
OCRA_0-9A-Z_Rej |
13 |
DotPrint_0-9_Rej.omc |
47 |
OCRA_0-9A-Z_NoRej |
14 |
DotPrint_0-9+_NoRej.omc |
48 |
OCRB_Rej |
15 |
DotPrint_0-9+_Rej.omc |
49 |
OCRB_NoRej |
16 |
DotPrint_0-9A-Z_NoRej.omc |
50 |
OCRB_A-Z+_Rej |
17 |
DotPrint_0-9A-Z_Rej.omc |
51 |
OCRB_A-Z+_NoRej |
18 |
DotPrint_A-Z+_NoRej.omc |
52 |
OCRB_0-9_Rej |
19 |
DotPrint_A-Z+_Rej.omc |
53 |
OCRB_0-9_NoRej |
20 |
DotPrint_NoRej.omc |
54 |
OCRB_0-9A-Z_Rej |
21 |
DotPrint_Rej.omc |
55 |
OCRB_0-9A-Z_NoRej |
22 |
Industrial_0-9_NoRej.omc |
56 |
OCRB_passport_Rej |
23 |
Industrial_0-9_Rej.omc |
57 |
OCRB_passport_NoRej |
24 |
Industrial_0-9+_NoRej.omc |
58 |
Pharma_Rej |
25 |
Industrial_0-9+_Rej.omc |
59 |
Pharma_NoRej |
26 |
Industrial_0-9A-Z_NoRej.omc |
60 |
Pharma_0-9_Rej |
27 |
Industrial_0-9A-Z_Rej.omc |
61 |
Pharma_0-9_NoRej |
28 |
Industrial_A-Z+_NoRej.omc |
62 |
Pharma_0-9+_Rej |
29 |
Industrial_A-Z+_Rej.omc |
63 |
Pharma_0-9+_NoRej |
30 |
Industrial_NoRej.omc |
64 |
Pharma_0-9A-Z_Rej |
31 |
Industrial_Rej.omc |
65 |
Pharma_0-9A-Z_NoRej |
32 |
Document_Rej |
66 |
SEMI_Rej |
33 |
Document_NoRej |
67 |
SEMI_NoRej |
Controls the type of separation of adjacent characters that have been segmented as a region.
If "standard" or "enhanced" is selected, such regions are detected and split into two or more individual characters. While method "enhanced" provides more accurate results, method "standard" is less complex and therefore faster. If "separate_touching_chars" is set to "false", no separation of touching characters is performed.
Minimum stroke width of a character in pixels.
Value "auto" can be specified if the minimum stroke width should be estimated automatically during text segmentation. "min_stroke_width" restricts the stroke width of characters, but not the stroke width of punctuation or separators.
Maximum stroke width of a character in pixels.
Value "auto" can be specified if the maximum stroke width should be estimated automatically during text segmentation. "max_stroke_width" restricts the stroke width of characters, but not the stroke width of punctuation or separators.
Defines a text structure (e.g. date DD.MM.YYYY) with which text recognition searches and selects.
The distance between successive letters is calculated for each line. Based on these distances, the line is divided into individual letter blocks. Very small characters such as ".", "_" and "-" are ignored and interpreted as spaces. In addition, additional separators can be specified; these should also be neglected, see TextLineSeparators. The system then checks whether the letter blocks created correspond to one of the specified structures. A structure consists of a string containing the number of letters/numbers per letter block separated by spaces. If a date with two digits for the day, two for the month and two for the year should be found, for example, then the structure would be "2 2 2". If the year can also consist of four digits, the structure would be "2 2 2-4", so that the last block can consist of two to four letters/numbers. Appending an index, e.g. to parameter "text_line_structure_0" or "text_line_structure_1" makes it possible to set more than one structure. If text_line_structure is set to an empty string (" "), the text to be found can consist of any structure.
A string with characters that should be ignored during the search process for TextLineStructure.
Note that this kind of separator must always be included in the classifier. If characters ":" and "\" should be treated as separators, for example, then string ":\\" can be specified. It is important to note that prefix "\" permits the use of symbol "\" as a literal.
Minimum distance between two characters (DotPrint) in pixels. This parameter may result in more accurate segmentation in cases where the gaps between letters are smaller than those between points within letters. Value "auto" can be specified if the minimum size is not known or is greater than the maximum gap between the dots within a letter. If "dot_print" is set to "false", this parameter has no effect.
The parameter can be used to define the minimum distance between two characters. The parameter can be very useful if the distance of the DotPrint characters varies greatly from character to character. This also applies in a similar way to parameter DotPrintMaxDotGap, but here within a character, i.e. the spacing between individual dots. Both can (with suitable values) increase the robustness of OCR but can also result in invalid/no results if set incorrectly.
Maximum distance between two points of a character (DotPrint) in pixels. Value "auto" can be specified to segment any dot print letters. If "dot_print" is set to "false", this parameter has no effect.
Search direction from -179.99° to +180° in increments of 1/100 degree.
SearchAngle 0° means a horizontally aligned text.
If text is rotated counterclockwise, SearchAngle is changed positively. If the text is rotated clockwise, SearchAngle is changed negatively.