ClassesClassesClassesClasses | | | | Operators

set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam (Operator)

Name

set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam — Set parameters of a text model.

Signature

set_text_model_param( : : TextModel, GenParamName, GenParamValue : )

Herror set_text_model_param(const Hlong TextModel, const char* GenParamName, const Hlong GenParamValue)

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

Herror set_text_model_param(const HTuple& TextModel, const HTuple& GenParamName, const HTuple& GenParamValue)

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

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 HOperatorSetX.SetTextModelParam(
[in] VARIANT TextModel, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

void HTextModelX.SetTextModelParam(
[in] VARIANT GenParamName, [in] VARIANT GenParamValue)

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

void HTextModel.SetTextModelParam(HTuple genParamName, HTuple genParamValue)

void HTextModel.SetTextModelParam(string genParamName, int genParamValue)

Description

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

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

Parameters of text models with Mode = 'auto'

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

The minimal contrast the characters have to their surrounding background.

List of values: integer or float value between 1 and 255 for byte images and between 1 and 65.535 for uint2 images

Default value: 15

'polarity'"polarity""polarity""polarity""polarity""polarity":

'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light""dark_on_light" if the text to be segmented is darker than its background, 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark""light_on_dark" if the text to be segmented is lighter than its background, and 'both'"both""both""both""both""both" if both kinds of text are to be segmented.

List of values: 'dark_on_light'"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""light_on_dark", 'both'"both""both""both""both""both"

Default value: 'both'"both""both""both""both""both"

'min_char_height'"min_char_height""min_char_height""min_char_height""min_char_height""min_char_height":

The minimal height of the characters in pixel. If text of arbitrary height is to be segmented, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'min_char_height'"min_char_height""min_char_height""min_char_height""min_char_height""min_char_height" refers to characters only. The height of punctuation marks or separators is not restricted by 'min_char_height'"min_char_height""min_char_height""min_char_height""min_char_height""min_char_height".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'max_char_height'"max_char_height""max_char_height""max_char_height""max_char_height""max_char_height":

The maximal height of the characters in pixel. If text of arbitrary height is to be segmented, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'max_char_height'"max_char_height""max_char_height""max_char_height""max_char_height""max_char_height" refers to characters only. The height of punctuation marks or separators is not restricted by 'max_char_height'"max_char_height""max_char_height""max_char_height""max_char_height""max_char_height".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'min_char_width'"min_char_width""min_char_width""min_char_width""min_char_width""min_char_width":

The minimal width of the characters in pixel. If text of arbitrary width is to be segmented, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'min_char_width'"min_char_width""min_char_width""min_char_width""min_char_width""min_char_width" refers to characters only. The width of punctuation marks or separators is not restricted by 'min_char_width'"min_char_width""min_char_width""min_char_width""min_char_width""min_char_width".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'max_char_width'"max_char_width""max_char_width""max_char_width""max_char_width""max_char_width":

The maximal width of the characters in pixel. If text of arbitrary width is to be segmented, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'max_char_width'"max_char_width""max_char_width""max_char_width""max_char_width""max_char_width" refers to characters only. The width of punctuation marks or separators is not restricted by 'max_char_width'"max_char_width""max_char_width""max_char_width""max_char_width""max_char_width".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'min_stroke_width'"min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width":

The minimal stroke width of the characters in pixel. If the minimal stroke width is to be estimated within the text segmentation process automatically, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'min_stroke_width'"min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width" refers to characters only. The stroke width of punctuation marks or separators is not restricted by 'min_stroke_width'"min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'max_stroke_width'"max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width":

The maximal stroke width of the characters in pixel. If the maximal stroke width is to be estimated within the text segmentation process automatically, 'auto'"auto""auto""auto""auto""auto" may be passed. Note that 'max_stroke_width'"max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width" refers to characters only. The stroke width of punctuation marks or separators is not restricted by 'max_stroke_width'"max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width""max_stroke_width".

List of values: integer or float value greater or equal to 1

Default value: 'auto'"auto""auto""auto""auto""auto"

'eliminate_border_blobs'"eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs":

'true'"true""true""true""true""true" if regions that are touching the border of the image domain should be discarded, otherwise 'false'"false""false""false""false""false".

List of values: 'true'"true""true""true""true""true",'false'"false""false""false""false""false"

Default value: 'false'"false""false""false""false""false"

'return_punctuation'"return_punctuation""return_punctuation""return_punctuation""return_punctuation""return_punctuation":

'true'"true""true""true""true""true" if small punctuation marks that lie close to the base line of the corresponding text line (e.g. dots or commas) are to be returned. 'false'"false""false""false""false""false" if no such punctuations should be returned.

List of values: 'true'"true""true""true""true""true",'false'"false""false""false""false""false"

Default value: 'true'"true""true""true""true""true"

'return_separators'"return_separators""return_separators""return_separators""return_separators""return_separators":

'true'"true""true""true""true""true" if separators such as a minus or the equality sign should be returned as well. 'false'"false""false""false""false""false" if no separators should be returned.

List of values: 'true'"true""true""true""true""true",'false'"false""false""false""false""false"

Default value: 'true'"true""true""true""true""true"

'add_fragments'"add_fragments""add_fragments""add_fragments""add_fragments""add_fragments":

'true'"true""true""true""true""true" if fragments, such as the dot on the 'i', should be added to the segmented characters, otherwise 'false'. Be aware, that this can cause noise to be added to the segmented characters.

List of values: 'true'"true""true""true""true""true",'false'"false""false""false""false""false"

Default value: 'true'"true""true""true""true""true"

'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure":

To simplify the search for specific structures (e.g. dates or serial numbers) within the segmented text, it is possible to define text line structures. For each text line the distances between the characters are calculated, and based on these distances, the text line is divided into text blocks. Short characters such as '.', '_' and '-' are ignored in this process and treated as spaces. Furthermore, it is possible to define user specific separators which are also ignored. See the description of 'text_line_separators'"text_line_separators""text_line_separators""text_line_separators""text_line_separators""text_line_separators" for details. It is then tested if any of the user defined text line structures fit the resulting text blocks.

For example, if the text to be found is a date with two characters for month, day, and year the structure would be '2 2 2'. If the year may consist of two or four characters, the structure would be '2 2 2-4', indicating that the last character block consists of two to four characters. It is possible to provide more than one structure to match by appending an index to the parameter name, e.g. 'text_line_structure_0', 'text_line_structure_1'. If 'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure" is set to an empty string ' ', the text to be found may have any structure.

Please observe, that every text line structure which is found, is saved as a unique text line within the text result. Hence, when calling get_text_objectget_text_objectGetTextObjectget_text_objectGetTextObjectGetTextObject, a 'line' then refers to a valid text line structure. If the whole text line containing the text line structure is to be returned instead, it is possible to set 'return_whole_line'"return_whole_line""return_whole_line""return_whole_line""return_whole_line""return_whole_line" accordingly.

Default value: ' '

'text_line_separators'"text_line_separators""text_line_separators""text_line_separators""text_line_separators""text_line_separators":

A string containing the list of characters which are to be ignored in the process of finding text line structures, see 'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure" for further details. Please note, user specific separators need to be valid characters within the used OCR classifier. For example, if ':'":"":"":"":"":" and '\'"\""\""\""\""\" are to be ignored, ':\\'":\\"":\\"":\\"":\\"":\\" should be passed. Please observe, that '\'"\""\""\""\""\" escapes any special symbol to treat it as a literal, and hence '\\'"\\""\\""\\""\\""\\" needs to be passed to use '\'"\""\""\""\""\" as a separator.

List of values: '/'"/""/""/""/""/",':'":"":"":"":"":", ':\\'":\\"":\\"":\\"":\\"":\\" , '\\/:'"\\/:""\\/:""\\/:""\\/:""\\/:" ,...

Default value: ' '

'return_whole_line'"return_whole_line""return_whole_line""return_whole_line""return_whole_line""return_whole_line":

'false'"false""false""false""false""false" if only the segmented text line structures are to be returned as text lines. 'true'"true""true""true""true""true" if each whole text line containing a text line structure is to be returned in text lines.

List of values: 'true'"true""true""true""true""true",'false'"false""false""false""false""false"

Default value: 'false'"false""false""false""false""false"

'mlp_classifier'"mlp_classifier""mlp_classifier""mlp_classifier""mlp_classifier""mlp_classifier":

The MLP-based OCR classifier used within find_textfind_textFindTextfind_textFindTextFindText for text segmentation. An initial classifier is set when the text model is created. See create_text_model_readercreate_text_model_readerCreateTextModelReadercreate_text_model_readerCreateTextModelReaderCreateTextModelReader for more information about the required OCR Classifier.

Parameters of text models with Mode = 'manual'

'char_height'"char_height""char_height""char_height""char_height""char_height":

Height of the characters in pixel. Refers to an uppercase character. Default value: 30px

'char_width'"char_width""char_width""char_width""char_width""char_width":

Width of the characters in pixel. Refers to an uppercase character. Default value: 20px

'stroke_width'"stroke_width""stroke_width""stroke_width""stroke_width""stroke_width":

Stroke width of the characters in pixel. Default value: 4.0px

'base_line_tolarance'"base_line_tolarance""base_line_tolarance""base_line_tolarance""base_line_tolarance""base_line_tolarance":

Maximum base line deviation of the characters (in percent of 'char_height'"char_height""char_height""char_height""char_height""char_height"). Default value: 0.15

'polarity'"polarity""polarity""polarity""polarity""polarity":

'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light""dark_on_light" if the text to be segmented is darker than its background, otherwise 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark""light_on_dark". Default value: 'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light""dark_on_light"

'uppercase_only'"uppercase_only""uppercase_only""uppercase_only""uppercase_only""uppercase_only":

'true'"true""true""true""true""true" if the text to be segmented contains uppercase characters or numbers only, otherwise 'false'"false""false""false""false""false". Default value: 'false'"false""false""false""false""false"

'is_dotprint'"is_dotprint""is_dotprint""is_dotprint""is_dotprint""is_dotprint":

'true'"true""true""true""true""true" if the text to be segmented is a dotprint, otherwise 'false'"false""false""false""false""false". Default value: 'false'"false""false""false""false""false"

'is_imprinted'"is_imprinted""is_imprinted""is_imprinted""is_imprinted""is_imprinted":

'true'"true""true""true""true""true" if the text to be segmented suffers of local changes of polarity due to reflections, otherwise 'false'"false""false""false""false""false". Default value: 'false'"false""false""false""false""false"

'eliminate_horizontal_lines'"eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines":

'true'"true""true""true""true""true" if there are longer horizontal structures close to the text to be segmented, otherwise 'false'"false""false""false""false""false". Default value: 'false'"false""false""false""false""false"

'eliminate_border_blobs'"eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs":

'true'"true""true""true""true""true" if regions that are touching the border of the image domain should be discarded, otherwise 'false'"false""false""false""false""false". Default value: 'false'"false""false""false""false""false"

'max_line_num'"max_line_num""max_line_num""max_line_num""max_line_num""max_line_num":

Maximum number of lines to be found. Zero or negative values indicate no limitation. Setting 'max_line_num'"max_line_num""max_line_num""max_line_num""max_line_num""max_line_num" to a low value may strongly improve the runtime of find_textfind_textFindTextfind_textFindTextFindText. Default value: no limitation

'return_punctuation'"return_punctuation""return_punctuation""return_punctuation""return_punctuation""return_punctuation":

'true'"true""true""true""true""true" if punctuation marks (e.g., dots or comma) should be added to the segmented characters. Default value: 'true'"true""true""true""true""true"

'return_separators'"return_separators""return_separators""return_separators""return_separators""return_separators":

'true'"true""true""true""true""true" if separators such as a minus or the equality sign should be added to the segmented characters. Default value: 'true'"true""true""true""true""true"

'add_fragments'"add_fragments""add_fragments""add_fragments""add_fragments""add_fragments":

'true'"true""true""true""true""true" if fragments, such as the dot on the 'i', should be added to the segmented characters. Be aware, that this can cause noise to be added to the segmented characters. Default value: 'true'"true""true""true""true""true"

'fragment_size_min'"fragment_size_min""fragment_size_min""fragment_size_min""fragment_size_min""fragment_size_min":

minimum area of fragment regions that are added if 'add_fragments'"add_fragments""add_fragments""add_fragments""add_fragments""add_fragments" is set to 'true'"true""true""true""true""true". Default value: 1

'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure":

specifies the structure of the text to be found to reduce the search space and to avoid false positives. The structure is a string that contains the number of characters for every character block and spaces between these character blocks. For example, if the text to be found is a date with two characters for month, day, and year the structure would be '2 2 2'. If the year may also consist of four characters the structure would be '2 2 2-4', indicating that the last character block consists of two to four characters. It is possible to provide more than one structure to match by appending an index to the parameter name, e.g. 'text_line_structure_0', 'text_line_structure_1'. If 'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure" is set to an empty string ' ', the text to be found may have any structure. Default value: ' '

'persistence'"persistence""persistence""persistence""persistence""persistence":

'true'"true""true""true""true""true" if selected intermediate results should be kept with the output result of find_textfind_textFindTextfind_textFindTextFindText.

Parallelization

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

TextModelTextModelTextModelTextModelTextModeltextModel (input_control, state is modified)  text_model HTextModel, HTupleHTupleHTextModel, HTupleHTextModelX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Text model.

GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the parameters to be set.

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

List of values: 'add_fragments'"add_fragments""add_fragments""add_fragments""add_fragments""add_fragments", 'base_line_tolerance'"base_line_tolerance""base_line_tolerance""base_line_tolerance""base_line_tolerance""base_line_tolerance", 'char_height'"char_height""char_height""char_height""char_height""char_height", 'char_width'"char_width""char_width""char_width""char_width""char_width", 'eliminate_border_blobs'"eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs""eliminate_border_blobs", 'eliminate_horizontal_lines'"eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines""eliminate_horizontal_lines", 'fragment_size_min'"fragment_size_min""fragment_size_min""fragment_size_min""fragment_size_min""fragment_size_min", 'is_dotprint'"is_dotprint""is_dotprint""is_dotprint""is_dotprint""is_dotprint", 'is_imprinted'"is_imprinted""is_imprinted""is_imprinted""is_imprinted""is_imprinted", 'max_char_height'"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_char_width", 'max_line_num'"max_line_num""max_line_num""max_line_num""max_line_num""max_line_num", 'max_stroke_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_height", 'min_char_width'"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_contrast", 'min_stroke_width'"min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width""min_stroke_width", 'mlp_classifier'"mlp_classifier""mlp_classifier""mlp_classifier""mlp_classifier""mlp_classifier", 'persistence'"persistence""persistence""persistence""persistence""persistence", 'polarity'"polarity""polarity""polarity""polarity""polarity", 'return_punctuation'"return_punctuation""return_punctuation""return_punctuation""return_punctuation""return_punctuation", 'return_separators'"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""return_whole_line", 'stroke_width'"stroke_width""stroke_width""stroke_width""stroke_width""stroke_width", 'text_line_separators'"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", 'text_line_structure_0'"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_1", 'text_line_structure_2'"text_line_structure_2""text_line_structure_2""text_line_structure_2""text_line_structure_2""text_line_structure_2", 'uppercase_only'"uppercase_only""uppercase_only""uppercase_only""uppercase_only""uppercase_only"

GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Values of the parameters to be set.

Default value: 10

List of values: 'auto'"auto""auto""auto""auto""auto", 'both'"both""both""both""both""both", 'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light""dark_on_light", 'false'"false""false""false""false""false", 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark""light_on_dark", 'true'"true""true""true""true""true"

Result

If the input parameters are set correctly, the operator set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam returns the value 2 (H_MSG_TRUE). Otherwise, an exception will be raised.

Possible Predecessors

create_text_model_readercreate_text_model_readerCreateTextModelReadercreate_text_model_readerCreateTextModelReaderCreateTextModelReader

Possible Successors

find_textfind_textFindTextfind_textFindTextFindText

See also

get_text_model_paramget_text_model_paramGetTextModelParamget_text_model_paramGetTextModelParamGetTextModelParam

Module

OCR/OCV


ClassesClassesClassesClasses | | | | Operators