Nicomsoft OCR: Developer's Guide


Blk_GetCharQual


Syntax

C++:int Blk_GetCharQual(HBLK BlkObj, int LineIndex, int WordIndex, int CharIndex, int ResultIndex)
C#:int Blk_GetCharQual(int BlkObj, int LineIndex, int WordIndex, int CharIndex, int ResultIndex)
Visual Basic:Function Blk_GetCharQual(ByVal BlkObj As Integer, ByVal LineIndex As Integer, ByVal WordIndex As Integer, ByVal CharIndex As Integer, ByVal ResultIndex As Integer) As Integer
Java:int Blk_GetCharQual(HBLK BlkObj, int LineIndex, int WordIndex, int CharIndex, int ResultIndex)
Delphi:function Blk_GetCharQual(BlkObj:HBLK; LineIndex:integer; WordIndex:integer; CharIndex:integer; ResultIndex:integer):integer


Description

Retrieves the recognition quality for the specified character in the block after performing OCR with the Img_OCR function. Use the Blk_GetLineCnt function to get the total number of text lines in the block. Use the Blk_GetWordCnt function to get the total number of words in the specified line. Use the Blk_GetCharCnt function to get the total number of characters in the specified word.


Parameters

BlkObj [IN] – the Block object. You can also specify the Image object if you want to work with the global list of text lines for the entire image.
LineIndex [IN] – the index of the text line to retrieve; 0 – the first line.
WordIndex [IN] – the index of the word in the specified text line to retrieve; 0 – the first word.
CharIndex [IN] – the index of the character in the specified word; 0 – the first character.
ResultIndex [IN] – the index of the character variant. Specify 0 to get the best (selected) variant.


Return value

If success, the character quality as 0 ... 100 percent; otherwise, an error code.


Remarks

1. The OCRSTEP_OCR step must be executed before calling this function.
2. If the return value is 0, it means that the character quality is undefined, it is possible if character is a dot, comma, etc.


Example

See the sample code for the Blk_GetCharCnt function.