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

该接口类表示单行文本对象,用于获取其具体属性。 更多...

类 ILOCRLine 继承关系图:
ILObjects ILObject LOCRLine

Public 成员函数

void Draw (HDC hdc, LPVOCRDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY)
 
double GetCharHeightMetric (LPVAggregation aggType)
 
double GetCharSpaceMetric (LPVAggregation aggType)
 
double GetCharWidthMetric (LPVAggregation aggType)
 
void GetLineImage (ILImage *img)
 
ILOCRCharItem (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 ()
 

属性

double Angle [get]
 该行文本的角度
 
ILPoint Center [get]
 该行文本的中心
 
double Height [get]
 该行文本的高度
 
ILLine Midline [get]
 该行文本的中线
 
ILPolygon Quad [get]
 该行文本的四边形区域
 
double Space [get]
 该行文本与其前一行的行间距。第一行的行间距为 -1。
 
LString String [get]
 识别结果
 
double Width [get]
 该行文本的宽度
 

详细描述

该接口类表示单行文本对象,用于获取其具体属性。

通常通过 ILOCRResult::ItemLine() 函数获得 LOCRLine 对象。可以使用该接口访问单行文本对象的具体信息,如位置、识别结果、局部图像等, 还可以调用绘制函数将单行文本对象绘制在界面上。

示例代码

成员函数说明

◆ Draw()

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

绘制该行文本对象到给定设备。

参数
[in]drawFlags控制字符绘制内容,使用方式请查阅 LPVOCRDrawFlags
参见
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()

◆ GetCharWidthMetric()

double GetCharWidthMetric ( LPVAggregation  aggType)

计算该行中的所有字符宽度的统计值,如所有宽度的均值

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

◆ GetLineImage()

void GetLineImage ( ILImage img)

获取该行文本的图像。对于斜体字符,该图像为斜切矫正后的图像。

参数
[out]img输出该行的图像

◆ Item()

ILOCRChar* Item ( int  index)

获取索引对应的字符对象

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