伍[5],旋转中心标定,函数FitCircleContourXld/GenContourPolygonXld

本文介绍了Halcon库中的两个功能函数:FitCircleContourXld用于根据类圆轮廓拟合圆,支持多种算法;GenContourPolygonXld则用于生成多边形的XLD轮廓。这两个函数在图像处理和中心标定中应用广泛,特别关注异常值处理和轮廓点的有效性。
摘要由CSDN通过智能技术生成

函数FitCircleContourXld

函数功能

根据类圆轮廓最佳拟合圆

C++形式

LIntExport void FitCircleContourXld(
const HObject& Contours, 
const HTuple& Algorithm, 
const HTuple& MaxNumPoints, 
const HTuple& MaxClosureDist, 
const HTuple& ClippingEndPoints, 
const HTuple& Iterations, 
const HTuple& ClippingFactor, 
HTuple* Row, 
HTuple* Column, 
HTuple* Radius, 
HTuple* StartPhi, 
HTuple* EndPhi, 
HTuple* PointOrder);

//参数1:类圆轮廓
//参数2:拟合圆算法
//参数3:参与运算轮廓点上最大数目,默认-1,全部点位
//参数4:如果轮廓是关闭,给出与结束点之间最大距离,默认0,完全闭合,此参数>=0
//参数5:结束点到起始位置之间线段点数,默认0,同一点,此参数>=0
//参数6:输入重复运算次数,默认3,此参数>=0
//参数7:输入比例因子的标准偏差,默认2.0,参考:1.0,1.5,2.0,2.5,3.0,此参数>=0
//参数8:输出圆心Row/X 注:X和OpenCV是反的
//参数9:输出圆心Column/Y
//参数10:输出圆心半径
//参数11:输出圆弧起始角度
//参数12:输出圆弧终止角度
//参数13:输出圆弧终止角度
//参数14:旋转方向,默认"positive","positive"逆时针,"negative"顺时针

//拟合圆算法,可使用参数
//"algebraic"这种方法使轮廓点和生成的圆之间的代数距离最小化
//"ahuber"对轮廓点进行加权,以减少异常值的影响
//"atukey"对轮廓点进行加权,并忽略异常值
//"geometric"使轮廓点和生成的圆之间的几何距离最小化。距离度量在统计上是最优的,但需要更多的计算时间。如果轮廓点被噪声严重扭曲,建议使用此选项
//"geohuber"对轮廓点进行加权,以减少异常值的影响
//"geotukey"对轮廓点进行加权,并忽略异常值

C#形式

public static void FitCircleContourXld(
HObject contours, 
HTuple algorithm, 
HTuple maxNumPoints, 
HTuple maxClosureDist, 
HTuple clippingEndPoints, 
HTuple iterations, 
HTuple clippingFactor, 
out HTuple row, 
out HTuple column, 
out HTuple radius, 
out HTuple startPhi, 
out HTuple endPhi, 
out HTuple pointOrder);

错误处理

错误1:HALCON error #3274: Not enough valid points for fitting the model in operator fit_circle_contour_xld

没有足够的有效点来拟合运算符中的模型

点位输入异常,或者没有传入点位信息

函数GenContourPolygonXld

函数功能

根据多边形点位生成XLD轮廓

C++形式

LIntExport void GenContourPolygonXld
HObject* Contour, 
const HTuple& Row, 
const HTuple& Col);

//参数1:输出轮廓
//参数2:图像Row/X数组
//参数3:图像Column/Y数组

C#形式

public static void GenContourPolygonXld(
out HObject contour, 
HTuple row, 
HTuple col)

附注

可用于旋转中心标定。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值