ClassesClassesClassesClasses | | | | Operators

find_textfind_textFindTextfind_textFindTextFindText (Operator)

Name

find_textfind_textFindTextfind_textFindTextFindText — Find text in an image.

Signature

find_text(Image : : TextModel : TextResultID)

Herror find_text(const Hobject Image, const Hlong TextModel, Hlong* TextResultID)

Herror T_find_text(const Hobject Image, const Htuple TextModel, Htuple* TextResultID)

Herror find_text(Hobject Image, const HTuple& TextModel, Hlong* TextResultID)

HTextResult HImage::FindText(const HTextModel& TextModel) const

HTextResult HTextModel::FindText(const HImage& Image) const

void HTextResult::FindText(const HImage& Image, const HTextModel& TextModel)

void FindText(const HObject& Image, const HTuple& TextModel, HTuple* TextResultID)

HTextResult HImage::FindText(const HTextModel& TextModel) const

HTextResult HTextModel::FindText(const HImage& Image) const

void HTextResult::HTextResult(const HImage& Image, const HTextModel& TextModel)

void HTextResult::FindText(const HImage& Image, const HTextModel& TextModel)

void HOperatorSetX.FindText(
[in] IHUntypedObjectX* Image, [in] VARIANT TextModel, [out] VARIANT* TextResultID)

IHTextResultX* HImageX.FindText([in] IHTextModelX* TextModel)

IHTextResultX* HTextModelX.FindText([in] IHImageX* Image)

void HTextResultX.FindText(
[in] IHImageX* Image, [in] IHTextModelX* TextModel)

static void HOperatorSet.FindText(HObject image, HTuple textModel, out HTuple textResultID)

HTextResult HImage.FindText(HTextModel textModel)

HTextResult HTextModel.FindText(HImage image)

public HTextResult(HImage image, HTextModel textModel)

void HTextResult.FindText(HImage image, HTextModel textModel)

Description

find_textfind_textFindTextfind_textFindTextFindText finds text specified by the TextModelTextModelTextModelTextModelTextModeltextModel in the ImageImageImageImageImageimage and returns the result in TextResultIDTextResultIDTextResultIDTextResultIDTextResultIDtextResultID. Specific results of TextResultIDTextResultIDTextResultIDTextResultIDTextResultIDtextResultID can be obtained with get_text_resultget_text_resultGetTextResultget_text_resultGetTextResultGetTextResult and get_text_objectget_text_objectGetTextObjectget_text_objectGetTextObjectGetTextObject.

The text results in TextResultIDTextResultIDTextResultIDTextResultIDTextResultIDtextResultID differ, depending on how ModeModeModeModeModemode was set when creating the TextModelTextModelTextModelTextModelTextModeltextModel with create_text_model_readercreate_text_model_readerCreateTextModelReadercreate_text_model_readerCreateTextModelReaderCreateTextModelReader.

For a text model with ModeModeModeModeModemode = 'auto'"auto""auto""auto""auto""auto" find_textfind_textFindTextfind_textFindTextFindText extracts and classifies text of arbitrary size within the ImageImageImageImageImageimage. It is possible to restrict the search to characters with specific attributes, see set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam for details.

For a text model with ModeModeModeModeModemode = 'manual'"manual""manual""manual""manual""manual" reasonable parameters for the text model, including the expected character height and width, need to be set using set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam. Furthermore, the ImageImageImageImageImageimage is preprocessed such that character like structures are enhanced. The resulting compensated image can be queried from TextResultIDTextResultIDTextResultIDTextResultIDTextResultIDtextResultID if 'persistence'"persistence""persistence""persistence""persistence""persistence" was set to 'true' in TextModelTextModelTextModelTextModelTextModeltextModel.

Both the text models with ModeModeModeModeModemode = 'auto'"auto""auto""auto""auto""auto" and ModeModeModeModeModemode = 'manual'"manual""manual""manual""manual""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 ModeModeModeModeModemode set to 'auto'"auto""auto""auto""auto""auto" require a text line to consist of at least two characters, whereas text models with ModeModeModeModeModemode set to 'manual'"manual""manual""manual""manual""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_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam. Finally, if TextModelTextModelTextModelTextModelTextModeltextModel contains 'text_line_structure'"text_line_structure""text_line_structure""text_line_structure""text_line_structure""text_line_structure" entries, the completed line is fitted to these structures.

find_textfind_textFindTextfind_textFindTextFindText finds text which is roughly horizontally aligned in ImageImageImageImageImageimage. text_line_orientationtext_line_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation and rotate_imagerotate_imageRotateImagerotate_imageRotateImageRotateImage can be used to achieve this alignment.

Since memory is allocated for the text result during the call of find_textfind_textFindTextfind_textFindTextFindText and during the following operations, the text result should be freed explicitly by the operator clear_text_resultclear_text_resultClearTextResultclear_text_resultClearTextResultClearTextResult as soon as it is no longer used.

Parallelization

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.

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2)

Input image.

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

Text model specifying the text to be segmented.

TextResultIDTextResultIDTextResultIDTextResultIDTextResultIDtextResultID (output_control)  text_result HTextResult, HTupleHTupleHTextResult, HTupleHTextResultX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Result of the segmentation.

Result

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

Possible Predecessors

create_text_model_readercreate_text_model_readerCreateTextModelReadercreate_text_model_readerCreateTextModelReaderCreateTextModelReader, set_text_model_paramset_text_model_paramSetTextModelParamset_text_model_paramSetTextModelParamSetTextModelParam, text_line_orientationtext_line_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation, text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant

Possible Successors

get_text_resultget_text_resultGetTextResultget_text_resultGetTextResultGetTextResult, get_text_objectget_text_objectGetTextObjectget_text_objectGetTextObjectGetTextObject

Module

OCR/OCV


ClassesClassesClassesClasses | | | | Operators