查找文字 - FindStrDetail
函数简介
查找指定文字的坐标,默认返回最优结果,支持ShowMatchWindow弹窗显示结果
返回数据类型解析:
{
"MatchVal": 0.85,//数据相似度
"MatchState": true,//返回数据是否大于指定精度,用于快速判断识别结果
"Index": 0,//多图识别时的返回索引
"Angle": 45.0,//识别结果角度
"MatchPoint": {
"x": 100,//识别结果X坐标
"y": 200//识别结果Y坐标
}
}
函数原型
long FindStrDetail(long ola,int x1, int y1, int x2, int y2, string str, string colorList,string dict, double matchVal);
参数定义
ola
(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。x1
(整型数): 查找区域的左上角X坐标。y1
(整型数): 查找区域的左上角Y坐标。x2
(整型数): 查找区域的右下角X坐标。y2
(整型数): 查找区域的右下角Y坐标。str
(字符串): 要查找的文字。colorList
(字符串): 颜色列表的json字符串。dict
(字符串): 字典名称。matchVal
(双精度浮点数): 相似度,如0.85,最大为1。
返回值
字符串: 返回JSON格式的匹配结果,包含以下字段:
MatchVal
(双精度浮点数): 实际匹配的相似度值MatchState
(boolean): 是否匹配成功Index
(整型数): 多图匹配时的图片索引,从0开始Angle
(双精度浮点数): 匹配到的图像旋转角度MatchPoint
: 匹配位置的坐标x
(整型数): X坐标y
(整型数): Y坐标
注意:
- DLL调用返回字符串指针地址,需要调用 FreeStringPtr 接口释放内存