find_text — Find text in an image.
find_text finds text specified by the
TextModel in the
Image and returns the result in
Specific results of
TextResultID can be obtained with
The text results in
TextResultID differ, depending on how
Mode was set when creating the
For a text model with
Mode = 'auto'
extracts and classifies text of arbitrary size within the
It is possible to restrict the search to characters with specific
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
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
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
'text_line_structure' entries, the completed line is fitted to
find_text finds text which is roughly horizontally aligned
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
freed explicitly by the operator
clear_text_result as soon as it is
no longer used.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
This operator supports cancelling timeouts and interrupts.
→object (byte / uint2)
Text model specifying the text to be segmented.
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)
If the parameters are valid, the operator
find_text returns the value TRUE. If
necessary, an exception is raised.