find_text — 在图像中查找文本。
find_text(Image : : TextModel : TextResultID)
find_text finds text specified by the TextModel in the
Image and returns the result in TextResultID.
Specific results of TextResultID can be obtained with
get_text_result and get_text_object。
The text results in TextResultID differ, depending on how
Mode was set when creating the TextModel with
create_text_model_reader。
For a text model with Mode = 'auto' find_text
extracts and classifies text of arbitrary size within the Image.
It is possible to restrict the search to characters with specific
attributes, see set_text_model_param for details.
For a text model with Mode = 'manual' reasonable
parameters for the text model, including the expected character height and
width, need to be set using set_text_model_param。Furthermore, the Image is preprocessed such that character like
structures are enhanced. The resulting compensated image can be queried from
TextResultID if 'persistence' was set to 'true' in
TextModel。
Both the text models with Mode = 'auto' and
Mode = 'manual' apply various thresholds to the input
image and segment character candidates based on region and gray value
features. These candidates are further clustered to lines. Each line is
individually completed and tested if it fulfills the constraints of a text
line. Text models with Mode set to 'auto' require a text
line to consist of at least two characters, whereas text models with
Mode set to 'manual' require a text line to consist of at
least three characters. In a further step, punctuations and separators are
added if the correspondent parameters were set via
set_text_model_param。Finally, if TextModel contains
'text_line_structure' entries, the completed line is fitted to
these structures.
find_text finds text which is roughly horizontally aligned
in Image. text_line_orientation and rotate_image
can be used to achieve this alignment.
Since memory is allocated for the text result during the call of
find_text and during the following operations, the text result
should be
freed explicitly by the operator clear_text_result as soon as it is
no longer used.
此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。
此算子支持取消超时和中断。
Image (输入对象) singlechannelimage → object (byte / uint2)
输入图像。
TextModel (输入控制) text_model → (handle)
Text model specifying the text to be segmented.
TextResultID (输出控制) text_result → (handle)
Result of the segmentation.
read_image (Image, 'numbers_scale')
create_text_model_reader ('auto', 'Document_Rej.omc', TextModel)
* Optionally specify text properties
set_text_model_param (TextModel, 'min_char_height', 20)
find_text (Image, TextModel, TextResultID)
* Return character regions and corresponding classification results
get_text_object (Characters, TextResultID, 'all_lines')
get_text_result (TextResultID, 'class', Class)
如果参数有效,算子
find_text 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
create_text_model_reader,
set_text_model_param,
text_line_orientation,
text_line_slant
get_text_result,
get_text_object
光学字符识别/光学字符验证