Leaper WaferScan Toolkit
中文 / English 2.x
Public 成员函数 | 属性
ILOCRResult接口 参考

该接口类表示字符识别结果对象,用于获取其具体识别结果。 更多...

类 ILOCRResult 继承关系图:
ILObjects ILObject LOCRResult

Public 成员函数

int CountChar ()
 
int CountLine ()
 
void Draw (HDC hdc, int lineIndex, int charIndex, LPVOCRDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY)
 
void DrawAll (HDC hdc, LPVOCRDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY)
 
double GetCharHeightMetric (LPVAggregation aggType)
 
double GetCharSpaceMetric (LPVAggregation aggType)
 
double GetCharWidthMetric (LPVAggregation aggType)
 
double GetLineSpaceMetric (LPVAggregation aggType)
 
ILOCRCharItemChar (int index)
 
ILOCRLineItemLine (int index)
 
- Public 成员函数 继承自 ILObjects
int Count ()
 
BOOL Empty ()
 
ILObjectItemObject (int objIndex)
 
- Public 成员函数 继承自 ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

属性

LString String [get]
 识别结果。对于多行识别结果,该结果按换行符 '\n' 合并。
 

详细描述

该接口类表示字符识别结果对象,用于获取其具体识别结果。

通常通过字符分割或识别获得 LOCRResult 对象。可以使用该接口访问具体的识别结果细节,如单行或单个字符结果, 还可以调用绘制函数将该结果对象绘制在界面上。

示例代码

成员函数说明

◆ CountChar()

int CountChar ( )

获取该结果的总字符数

参见
ItemChar()

◆ CountLine()

int CountLine ( )

获取该结果的总行数

参见
ItemLine()

◆ Draw()

void Draw ( HDC  hdc,
int  lineIndex,
int  charIndex,
LPVOCRDrawFlags  drawFlags,
double  zoomX,
double  zoomY,
double  panX,
double  panY 
)

绘制该字符识别结果对象中的部分到给定设备。

参数
[in]drawFlags控制字符绘制内容,使用方式请查阅 LPVOCRDrawFlags
[in]lineIndex需绘制的行号
[in]charIndex需绘制的字符的行内索引。负数表示绘制全行。
参见
DrawAll()
Use Draw Functions
备注
该函数在 Linux / MacOS 平台暂不可用。

◆ DrawAll()

void DrawAll ( HDC  hdc,
LPVOCRDrawFlags  drawFlags,
double  zoomX,
double  zoomY,
double  panX,
double  panY 
)

绘制该字符识别结果对象到给定设备。

参数
[in]drawFlags控制字符绘制内容,使用方式请查阅 LPVOCRDrawFlags
参见
Draw()
Use Draw Functions
备注
该函数在 Linux / MacOS 平台暂不可用。

◆ GetCharHeightMetric()

double GetCharHeightMetric ( LPVAggregation  aggType)

计算该结果对象中的所有字符高度的统计值,如所有高度中的最大值

参数
[in]aggType统计方式,查看 LPVAggregation
返回值
val返回高度统计值
参见
GetCharWidthMetric(), GetCharSpaceMetric()

◆ GetCharSpaceMetric()

double GetCharSpaceMetric ( LPVAggregation  aggType)

计算该结果对象中的所有字符字间距的统计值,如所有字间距的均值

参数
[in]aggType统计方式,查看 LPVAggregation
返回值
val返回字间距统计值
参见
GetCharWidthMetric(), GetCharHeightMetric(), GetLineSpaceMetric()

◆ GetCharWidthMetric()

double GetCharWidthMetric ( LPVAggregation  aggType)

计算该结果对象中的所有字符宽度的统计值,如所有宽度的均值

参数
[in]aggType统计方式,查看 LPVAggregation
返回值
val返回宽度统计值
参见
GetCharHeightMetric(), GetCharSpaceMetric()

◆ GetLineSpaceMetric()

double GetLineSpaceMetric ( LPVAggregation  aggType)

计算该结果对象中的所有行间距的统计值,如所有行间距的均值

参数
[in]aggType统计方式,查看 LPVAggregation
返回值
val返回行间距统计值
参见
GetCharSpaceMetric()

◆ ItemChar()

ILOCRChar* ItemChar ( int  index)

获取索引对应的字符对象。对于多行识别结果,字符先按行、再按其在行内的索引排序。

参数
[in]index输入索引,从 0 开始但小于总数的数字
返回值
result返回索引对应的字符对象
参见
CountChar()

◆ ItemLine()

ILOCRLine* ItemLine ( int  index)

获取索引对应的单行文本对象

参数
[in]index输入索引,从 0 开始但小于总数的数字
返回值
result返回索引对应的单行文本对象
参见
CountLine()