轮胎检测更新算法

This commit is contained in:
杰仔 2026-07-03 14:19:26 +08:00
parent a6d3bd240d
commit a5d5f6be78
17 changed files with 48 additions and 3 deletions

View File

@ -319,9 +319,8 @@ SG_APISHARED_EXPORT void wd_getXYVertialFeature_dirAngleMethod(
/// </summary>
SG_APISHARED_EXPORT void wd_getXYVertialFeature_perSeg_dirAngleMethod(
std::vector< SVzNL3DPosition>& lineData,
std::vector<SSG_RUN>& segs,
int lineIdx,
const double maxDistTh,
const double minSegSize,
const SSG_cornerParam cornerPara,
std::vector<int>& xyVerticalFlags
);
@ -338,6 +337,16 @@ SG_APISHARED_EXPORT void wd_getXYHorizontalFeature_dirAngleMethod(
std::vector<int>& xyHorizontalFlags
);
SG_APISHARED_EXPORT void wd_getRimConvexFeature(
std::vector< SVzNL3DPosition>& lineData,
std::vector<SSG_RUN>& segs,
int lineIdx,
const SWDRimEdgeParam rimPara_1,
const SWDRimEdgeParam rimPara_2,
const SVzNLRangeD rimWidth,
std::vector<SSG_RUN>& rimFeatures
);
/// 提取激光线上的拐点特征。是在PSM LVTypeFeature, BQ等拐点算法的基础上的版本。
/// 使用平均点距进行加速
/// nPointIdx被重新定义成Feature类型
@ -723,6 +732,14 @@ SG_APISHARED_EXPORT double fitCircleByLeastSquare_3(
const std::vector<SVzNL2DPointD>& pointArray,
SVzNL2DPointD& center,
double& radius);
// 加权迭代最小二乘圆拟合Huber权重或Tukey权重
SG_APISHARED_EXPORT double fitCircleRobust(
const std::vector<SVzNL3DPosition>& points,
SVzNL3DPoint& robustCenter,
double& robustRadius,
double outlierThreshold = 2.5, // 标准差倍数
int maxIter = 20,
double minPointsRatio = 0.5);
//抛物线最小二乘拟合 y=ax^2 + bx + c
SG_APISHARED_EXPORT bool leastSquareParabolaFitEigen(
@ -819,7 +836,7 @@ SG_APISHARED_EXPORT void SG_TwoPassLabel(
//计算面参数: z = Ax + By + C
//res: [0]=A, [1]= B, [2]=-1.0, [3]=C,
SG_APISHARED_EXPORT void vzCaculateLaserPlane(
std::vector<cv::Point3d> Points3ds,
std::vector<cv::Point3d>& Points3ds,
std::vector<double>& res);
SG_APISHARED_EXPORT Plane robustFitPlane(

View File

@ -41,6 +41,17 @@ typedef struct
double z;
}SWD3DPoint;
typedef struct
{
double cx, cy, r;
}SWD_Circle;
typedef struct
{
double rimEdgeAngleTh;
double rimCornerTh;
}SWDRimEdgeParam;
typedef struct
{
int lineIdx;

View File

@ -33,6 +33,13 @@ typedef struct
double thickness; //轮胎宽度
}WD_tireParam;
typedef struct
{
double len; //工件长
double width; //工件宽度
double thickness;
}WD_JiuruiWorkpieceParam;
typedef struct
{
SVzNL3DPoint center;
@ -43,6 +50,7 @@ typedef struct
typedef struct
{
double rotorDiameter;
double rotorH;
double removeGroundHOffset; //去除时的高度偏置,用于设置架子高度
double basket_L; //零件筐-长
double basket_W; //零件筐-宽
@ -112,3 +120,12 @@ SG_APISHARED_EXPORT void sx_getRotorCorePose(
const WD_rotorAppParam rotorParam,
std::vector<WD_HolePositionInfo>& rotorPositions,
int* errCode);
//北京玖瑞工件定位
SG_APISHARED_EXPORT void Jiurui_getWorkpiecePose(
std::vector< std::vector<SVzNL3DPosition>>& scanLinesInput,
const SSG_cornerParam cornerPara,
const SSG_planeCalibPara groundCalibPara,
const WD_JiuruiWorkpieceParam workpieceParam,
std::vector<SSG_pointPose>& tirePositions,
int* errCode);