Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS OCR C DLL Help

RECOGCHARS2

Show in webframe

typedef struct _tagRecogChars
{
   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.

Member

Description

uStructSize

Structure size. It should be equal to sizeof(RECOGCHARS2).

rcArea

RECT structure that contains 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.

nZoneIndex

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

nCellIndex

Index of the cell in the cell list that contains the character (applicable only for DOC2_ZONE_TABLE zones). 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.  The range value for nConfidence is from 0 to 100.

uFont

Font information about the recognized character. These 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. These 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

Expresses a measure of the capital letter height in pixels.

nChoicesCount

For internal use only. Please check L_Doc2GetCharacterChoices for list of character choices.

nSuggestionsCount

For internal use only. Please check L_Doc2GetWordSuggestions for list word's suggestions.

nNextChoiceIndex

For internal use only. Please check L_Doc2GetCharacterChoices for list of character choices.

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. Its most significant bit is used to express the certainty/uncertainty of the word (word is uncertain, if this bit set to one (1)). The remaining bits represent the certainty of the character recognition, which ranges between 0 and 100. The smaller this 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.

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.

This structure is used with the following functions:

L_Doc2GetRecognizedCharacters

L_Doc2SetRecognizedCharacters

L_Doc2FreeRecognizedCharacters

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.