set_text_model_paramT_set_text_model_paramSetTextModelParamSetTextModelParamset_text_model_param (Operator)

Name

set_text_model_paramT_set_text_model_paramSetTextModelParamSetTextModelParamset_text_model_param — Set parameters of a text model.

Signature

set_text_model_param( : : TextModel, GenParamName, GenParamValue : )

Herror T_set_text_model_param(const Htuple TextModel, const Htuple GenParamName, const Htuple GenParamValue)

void SetTextModelParam(const HTuple& TextModel, const HTuple& GenParamName, const HTuple& GenParamValue)

void HTextModel::SetTextModelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HTextModel::SetTextModelParam(const HString& GenParamName, Hlong GenParamValue) const

void HTextModel::SetTextModelParam(const char* GenParamName, Hlong GenParamValue) const

void HTextModel::SetTextModelParam(const wchar_t* GenParamName, Hlong GenParamValue) const   ( Windows only)

static void HOperatorSet.SetTextModelParam(HTuple textModel, HTuple genParamName, HTuple genParamValue)

void HTextModel.SetTextModelParam(HTuple genParamName, HTuple genParamValue)

void HTextModel.SetTextModelParam(string genParamName, int genParamValue)

def set_text_model_param(text_model: HHandle, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> None

Description

set_text_model_paramset_text_model_paramSetTextModelParamSetTextModelParamset_text_model_param sets parameters of a text model. The list of allowed parameter values for GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name differs, depending on which ModeModeModemodemode was set when creating the text model with create_text_model_readercreate_text_model_readerCreateTextModelReaderCreateTextModelReadercreate_text_model_reader. In the following, first the parameter values for text models with ModeModeModemodemode = 'auto'"auto""auto""auto""auto" are listed, and then those for text models with ModeModeModemodemode = 'manual'"manual""manual""manual""manual".

The name and value of a parameter must be given in GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value. The following values are possible:

Execution Information

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters

TextModelTextModelTextModeltextModeltext_model (input_control, state is modified)  text_model HTextModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Text model.

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Names of the parameters to be set.

Default: 'min_contrast' "min_contrast" "min_contrast" "min_contrast" "min_contrast"

Suggested values: 'add_fragments'"add_fragments""add_fragments""add_fragments""add_fragments", 'dot_print'"dot_print""dot_print""dot_print""dot_print", 'dot_print_max_dot_gap'"dot_print_max_dot_gap""dot_print_max_dot_gap""dot_print_max_dot_gap""dot_print_max_dot_gap", 'dot_print_min_char_gap'"dot_print_min_char_gap""dot_print_min_char_gap""dot_print_min_char_gap""dot_print_min_char_gap", 'dot_print_tight_char_spacing'"dot_print_tight_char_spacing""dot_print_tight_char_spacing""dot_print_tight_char_spacing""dot_print_tight_char_spacing", 'eliminate_border_blobs'"eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs", 'max_char_height'"max_char_height""max_char_height""max_char_height""max_char_height", 'max_char_width'"max_char_width""max_char_width""max_char_width""max_char_width", 'max_stroke_width'"max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width", 'min_char_height'"min_char_height""min_char_height""min_char_height""min_char_height", 'min_char_width'"min_char_width""min_char_width""min_char_width""min_char_width", 'min_contrast'"min_contrast""min_contrast""min_contrast""min_contrast", 'min_stroke_width'"min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width", 'num_classes'"num_classes""num_classes""num_classes""num_classes", 'ocr_classifier'"ocr_classifier""ocr_classifier""ocr_classifier""ocr_classifier", 'polarity'"polarity""polarity""polarity""polarity", 'return_punctuation'"return_punctuation""return_punctuation""return_punctuation""return_punctuation", 'return_separators'"return_separators""return_separators""return_separators""return_separators", 'return_whole_line'"return_whole_line""return_whole_line""return_whole_line""return_whole_line", 'separate_touching_chars'"separate_touching_chars""separate_touching_chars""separate_touching_chars""separate_touching_chars", 'text_line_separators'"text_line_separators""text_line_separators""text_line_separators""text_line_separators", 'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure", 'text_line_structure_0'"text_line_structure_0""text_line_structure_0""text_line_structure_0""text_line_structure_0", 'text_line_structure_1'"text_line_structure_1""text_line_structure_1""text_line_structure_1""text_line_structure_1", 'text_line_structure_2'"text_line_structure_2""text_line_structure_2""text_line_structure_2""text_line_structure_2", 'manual_add_fragments'"manual_add_fragments""manual_add_fragments""manual_add_fragments""manual_add_fragments", 'manual_base_line_tolerance'"manual_base_line_tolerance""manual_base_line_tolerance""manual_base_line_tolerance""manual_base_line_tolerance", 'manual_char_height'"manual_char_height""manual_char_height""manual_char_height""manual_char_height", 'manual_char_width'"manual_char_width""manual_char_width""manual_char_width""manual_char_width", 'manual_eliminate_border_blobs'"manual_eliminate_border_blobs""manual_eliminate_border_blobs""manual_eliminate_border_blobs""manual_eliminate_border_blobs", 'manual_eliminate_horizontal_lines'"manual_eliminate_horizontal_lines""manual_eliminate_horizontal_lines""manual_eliminate_horizontal_lines""manual_eliminate_horizontal_lines", 'manual_fragment_size_min'"manual_fragment_size_min""manual_fragment_size_min""manual_fragment_size_min""manual_fragment_size_min", 'manual_is_dotprint'"manual_is_dotprint""manual_is_dotprint""manual_is_dotprint""manual_is_dotprint", 'manual_is_imprinted'"manual_is_imprinted""manual_is_imprinted""manual_is_imprinted""manual_is_imprinted", 'manual_max_line_num'"manual_max_line_num""manual_max_line_num""manual_max_line_num""manual_max_line_num", 'manual_persistence'"manual_persistence""manual_persistence""manual_persistence""manual_persistence", 'manual_polarity'"manual_polarity""manual_polarity""manual_polarity""manual_polarity", 'manual_return_punctuation'"manual_return_punctuation""manual_return_punctuation""manual_return_punctuation""manual_return_punctuation", 'manual_return_separators'"manual_return_separators""manual_return_separators""manual_return_separators""manual_return_separators", 'manual_stroke_width'"manual_stroke_width""manual_stroke_width""manual_stroke_width""manual_stroke_width", 'manual_text_line_structure'"manual_text_line_structure""manual_text_line_structure""manual_text_line_structure""manual_text_line_structure", 'manual_text_line_structure_0'"manual_text_line_structure_0""manual_text_line_structure_0""manual_text_line_structure_0""manual_text_line_structure_0", 'manual_text_line_structure_1'"manual_text_line_structure_1""manual_text_line_structure_1""manual_text_line_structure_1""manual_text_line_structure_1", 'manual_text_line_structure_2'"manual_text_line_structure_2""manual_text_line_structure_2""manual_text_line_structure_2""manual_text_line_structure_2", 'manual_uppercase_only'"manual_uppercase_only""manual_uppercase_only""manual_uppercase_only""manual_uppercase_only"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  string(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Values of the parameters to be set.

Default: 10

Suggested values: 'true'"true""true""true""true", 'false'"false""false""false""false", 'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light", 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark", 'both'"both""both""both""both", 'auto'"auto""auto""auto""auto", 'standard'"standard""standard""standard""standard", 'enhanced'"enhanced""enhanced""enhanced""enhanced"

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 input parameters are set correctly, the operator set_text_model_paramset_text_model_paramSetTextModelParamSetTextModelParamset_text_model_param returns the value 2 ( H_MSG_TRUE) . Otherwise, an exception will be raised.

Possible Predecessors

create_text_model_readercreate_text_model_readerCreateTextModelReaderCreateTextModelReadercreate_text_model_reader

Possible Successors

find_textfind_textFindTextFindTextfind_text

See also

get_text_model_paramget_text_model_paramGetTextModelParamGetTextModelParamget_text_model_param

Module

OCR/OCV