Operators |
get_text_result — Query a control value of a text segmentation result.
get_text_result( : : TextResultID, ResultName : ResultValue)
get_text_result queries the control result ResultName of TextResultID returned by find_text. The possible parameter values for ResultName differ, depending on the text model used within the text segmentation process of find_text.
In the following, first the possible parameter values for text models with Mode = 'auto' are listed, and then those for text models with Mode = 'manual' :
The following results can be queried:
Results for text segmentation with text models with Mode = 'auto'
Note that if the classifier contained in the text model was trained with rejection class, get_text_result does not return characters classified as rejection class. Instead, the second best classification result is returned.
Number of lines found.
Returns the result of classifying the characters in all segmented text lines with the OCR classifier contained in the corresponding text model. For each polarity, the text lines are independently sorted from top to bottom and left to right. The character within the text lines are sorted from left to right.
Returns the result of classifying the characters within the text line specified by 'Index' with the OCR classifier contained in the corresponding text model (e.g. ['class_line',0] returns the character classes within the first text line). The characters within the text line are sorted from left to right.
Returns the confidences of the above classes for all characters within all segmented text lines. For each polarity, the text lines are independently sorted from top to bottom and left to right. The characters within the text lines are sorted from left to right.
Returns the confidences of the above classes for all characters within the text line specified by 'Index' (e.g. ['confidence_line',0] to return the confidences of the characters within the first text line). The characters within the text line are sorted from left to right.
Returns the polarity of the characters in all segmented text lines. For each polarity, the text lines are independently sorted from top to bottom and left to right. The characters within the text lines are sorted from left to right.
Returns the polarity of the characters in the segmented text line specified by 'Index' (e.g. ['polarity_line',0] to return the polarity within the first text line). The characters within the text line are sorted from left to right.
Results for text segmentation with text models with Mode = 'manual'
Number of lines found.
If 'persistence' was activated and Mode = 'manual' for the text model used to create TextResultID, the following additional value can be queried:
The thresholds used for segmentation.
Text result.
Name of the result to be returned.
Default value: 'class'
List of values: 'class' , 'class_line' , 'confidence' , 'confidence_line' , 'num_lines' , 'polarity' , 'polarity_line' , 'thresholds'
Value of ResultName.
If the parameters are valid, the operator get_text_result returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
Foundation
Operators |