Skip to content

get_text_objectGetTextObjectGetTextObjectget_text_objectT_get_text_object🔗

Short description🔗

get_text_objectGetTextObjectGetTextObjectget_text_objectT_get_text_object — Query an iconic value of a text segmentation result.

Signature🔗

get_text_object( out object Characters, text_result TextResultID, string ResultName )void GetTextObject( HObject* Characters, const HTuple& TextResultID, const HTuple& ResultName )static void HOperatorSet.GetTextObject( out HObject characters, HTuple textResultID, HTuple resultName )def get_text_object( text_result_id: HHandle, result_name: MaybeSequence[Union[str, int]] ) -> HObject

Herror T_get_text_object( Hobject* Characters, const Htuple TextResultID, const Htuple ResultName )

HObject HTextResult::GetTextObject( const HTuple& ResultName ) const

HObject HTextResult::GetTextObject( const HString& ResultName ) const

HObject HTextResult::GetTextObject( const char* ResultName ) const

HObject HTextResult::GetTextObject( const wchar_t* ResultName ) const (Windows only)

HObject HTextResult.GetTextObject( HTuple resultName )

HObject HTextResult.GetTextObject( string resultName )

Description🔗

get_text_objectGetTextObject queries the iconic result ResultNameresultNameresult_name of TextResultIDtextResultIDtext_result_id returned by find_textFindText. The possible parameter values for ResultNameresultNameresult_name differ, depending on the text model used within the text segmentation process of find_textFindText.

In the following, first the possible parameter values for text models with Modemodemode = 'auto'"auto" are listed, and then those for text models with Modemodemode = 'manual'"manual".

The following results can be queried:

  • Result objects for text segmentation with text models with Modemodemode = 'auto'"auto"

    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.

    • 'all_lines'"all_lines": Returns all characters in all segmented text lines.

    • '[line, LineIndex**'"[line, LineIndex**":] Returns all characters within the text line specified by LineIndex. For example, ['line', 0]["line", 0] returns the first line.

    • '[element, Index**'"[element, Index**":] Returns the character at position Index. For example, ['element', 0]["element", 0] returns the first character.

  • Result objects for text segmentation with text models with Modemodemode = 'manual'"manual"

    • 'manual_all_lines'"manual_all_lines": Returns all characters in all segmented text lines. The text lines are sorted from top to bottom and left to right. The characters within the text lines are sorted from left to right.

    • '[manual_line, Index**'"[manual_line, Index**":] Returns all characters within the text line specified by Index (e.g., ['manual_line', 0]["manual_line", 0] to return the first line). The characters within the text line are sorted from left to right.

    If 'manual_persistence'"manual_persistence" was activated for the text model used to create TextResultIDtextResultIDtext_result_id, the following additional value can be queried:

    • 'manual_compensated_image'"manual_compensated_image": the enhanced image used for segmentation.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Characterscharacterscharacters (output_object) object(-array) → objectHObjectHObjectHObjectHobject *

Returned result.

TextResultIDtextResultIDtext_result_id (input_control) text_result → (handle)HTuple (HHandle)HTextResult, HTuple (IntPtr)HHandleHtuple (handle)

Text result.

ResultNameresultNameresult_name (input_control) string(-array) → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)MaybeSequence[Union[str, int]]Htuple (char* / Hlong)

Name of the result to be returned.

Default: 'all_lines'"all_lines"
List of values: 'all_lines', 'element', 'line', 'manual_all_lines', 'manual_compensated_image', 'manual_line'"all_lines", "element", "line", "manual_all_lines", "manual_compensated_image", "manual_line"

Example🔗

(HDevelop)

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)

Result🔗

If the parameters are valid, the operator get_text_objectGetTextObject returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

find_textFindText

See also

get_text_resultGetTextResult

Module🔗

Foundation