伍[5],函数FitCircleContourXld/GenContourPolygonXld

函数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)

附注

可用于旋转中心标定。

你可能感兴趣的:(c++,c#)