RECOGCHARS2

typedef struct _tagRecogChars2 
{ 
   L_UINT uStructSize; 
   RECT rcArea; 
   L_INT nYOffset; 
   L_WCHAR wGuessCode; 
   L_INT nZoneIndex; 
   L_INT nCellIndex; 
   L_INT nConfidence; 
   L_UINT uFont; 
   L_INT nFontSize; 
   L_INT nCharFormat; 
   DOC2_LANGIDS Lang; 
   DOC2_LANGIDS Lang2; 
   L_INT nCapHeight; 
   L_INT nChoicesCount; 
   L_INT nSuggestionsCount; 
   L_INT nNextChoiceIndex; 
   L_INT nUnderLineWidthDot; 
   L_INT nUnderLineWidthGap; 
   L_INT nFGColorIndex; 
   L_INT nBGColorIndex; 
} RECOGCHARS2, * pRECOGCHARS2; 

The RECOGCHARS2 structure provides information about the recognized characters.

Members

uStructSize

Structure size. Set it to sizeof(RECOGCHARS2).

rcArea

RECT structure containing the area for the recognized character.

nYOffset

Y coordinate of the baseline, measured from the top edge of the rectangle exactly containing the character.

wGuessCode

Character code in UNICODE. This is either the first guess of the recognition or the rejected character that was set by calling L_Doc2SetSpecialChar / L_Doc2SetSpecialCharExt.

nZoneIndex

Index of the zone in the zone list that contains the character.

nCellIndex

Index of the cell in the cell list containing the character (applicable only for DOC2_ZONE_TABLE zone type of DOC2_ZONETYPE ). The cell list is not accessible for the application.

nConfidence

Confidence number expressing both the certainty of the recognition of the first guess (code member) and also the certainty of the word.  Valid values for nConfidence range from 0 to 100.

uFont

Font information about the recognized character. Values can be combined using OR (|). Possible values are:

Value Meaning
DOC2_FONT_ITALIC [0x001] The character is italic.
DOC2_FONT_BOLD [0x002] The character is bold.
DOC2_FONT_UNDERLINE [0x004] The character is underlined.
DOC2_FONT_SUBSCRIPT [0x008] The character is subscript.
DOC2_FONT_SUPERSCRIPT [0x010] The character is superscript.
DOC2_FONT_SANSSERIF [0x020] The character is Sans Serif.
DOC2_FONT_SERIF [0x040] The character is Serif.
DOC2_FONT_PROPORTIONAL [0x080] The character is proportional.
DOC2_FONT_SMALLCAPS [0x0100] The character is a Small Caps character
DOC2_FONT_DROPCAP [0x0200] The character is a Dropcap character.
DOC2_FONT_POPCAP [0x0400] The character is a Popcap character.
DOC2_FONT_INVERTED [0x1000] The character is an Inverted character.

nFontSize

Font size in points.

nCharFormat

Formatting attributes of the character. Values can be combined using OR (|). Possible values are:

Value Meaning
DOC2_CHAR_ENDOFLINE [0x001] This is the last character in a line.
DOC2_CHAR_ENDOFPARA [0x002] This is the last character in a paragraph.
DOC2_CHAR_ENDOFWORD [0x004] This is the last character of a word.
DOC2_CHAR_ENDOFZONE [0x008] This is the last character in a zone.
DOC2_CHAR_ENDOFPAGE [0x010] This is the last character on a page.
DOC2_CHAR_ENDOFCELL [0x020] This is the last character in a cell. (applicable only for DOC2\_ZONE\_TABLE type zones).
DOC2_CHAR_ENDOFROW [0x040] This is the end of the last line of the last filled cell of a table row.
DOC2_CHAR_INTABLE [0x080] The character is in a table cell.

Lang

Value that represents the first language in which the recognized word is found. For a list of possible values, refer to DOC2_LANGIDS.

Lang2

Value that represents the second language in which the recognized word is found.

nCapHeight

The capital letter height in pixels.

nChoicesCount

For internal use only. For the list of character choices, refer to L_Doc2GetCharacterChoices / L_Doc2GetCharacterChoicesExt.

nSuggestionsCount

For internal use only. For the list word's suggestions, refer to L_Doc2GetWordSuggestions / L_Doc2GetWordSuggestionsExt.

nNextChoiceIndex

For internal use only. For the list of character choices, refer to L_Doc2GetCharacterChoices / L_Doc2GetCharacterChoicesExt.

nUnderLineWidthDot

Width of a dot in pixels if the "underline" is under dots in reality. 0 if simple underline, 0 if nothing.

nUnderLineWidthGap

Width of a gap in pixels if the "underline" is under dots in reality. 0 if simple underline, 0 if nothing.

nFGColorIndex

Index of the foreground color within the palette of the recognition data.

nBGColorIndex

Index of the background color within the palette of the recognition data.

Comments

The application should evaluate the nConfidence member when confidence information on the recognition is also required. The nConfidence value represents the certainty of the character recognition and ranges between 0 and 100. The larger the nConfidence value is, the higher the confidence of the recognition. For more details, see the Confidence reporting topic.

pRECOGCHARS2 is a pointer to a RECOGCHARS2 structure. If the function parameter type is pRECOGCHARS2, declare a RECOGCHARS2 variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pRECOGCHARS2 variable is necessary only if the program requires a pointer.

If the recognition process cannot associate the current recognized word with any language, then Lang is updated with the DOC2_LANG_ID_NO member of DOC2_LANGIDS.

If the recognized word can be found in more than one language, then Lang will be updated with the ID of the first language in which the recognized word was found, and Lang2 will be updated with the second language in which the word was found.

The structure is used by:

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help