This commit is contained in:
jerryzeng 2026-10-07 10:22:09 +08:00
commit 7a3d9538bf
2 changed files with 11 additions and 2 deletions

View File

@ -180,7 +180,8 @@ double fitCircleByLeastSquare(
double r2 = radius * radius; double r2 = radius * radius;
for (int pId = 0; pId < N; ++pId) { for (int pId = 0; pId < N; ++pId) {
e = abs(pow(pointArray[pId].x - center.x, 2) + pow(pointArray[pId].y - center.y, 2) - r2); e = abs(pow(pointArray[pId].x - center.x, 2) + pow(pointArray[pId].y - center.y, 2) - r2);
#if 0 if (e > err) { #if 0
if (e > err) {
err = e; err = e;
} }
#else #else

View File

@ -32,7 +32,8 @@
//version 1.4.0 : 矩森棒材抓取算法改进:(1)修正了两个棒材被识别成一根的问题(2)增强了对噪点的容忍度,增强了鲁棒性 //version 1.4.0 : 矩森棒材抓取算法改进:(1)修正了两个棒材被识别成一根的问题(2)增强了对噪点的容忍度,增强了鲁棒性
//version 1.5.0 : 矩森棒材抓取算法改进:加强了对强噪声点云的处理 //version 1.5.0 : 矩森棒材抓取算法改进:加强了对强噪声点云的处理
//version 1.6.0 : 矩森棒材抓取算法改进:添加了料筐信息提取和对边缘工件的判断 //version 1.6.0 : 矩森棒材抓取算法改进:添加了料筐信息提取和对边缘工件的判断
std::string m_strVersion = "RodAndBarDetection_1.6.0"; //version 1.6.1 : 矩森棒材抓取算法崩溃修复:没有棒材的情况不需要再计算料框信息
std::string m_strVersion = "RodAndBarDetection_1.6.1";
const char* wd_rodAndBarDetectionVersion(void) const char* wd_rodAndBarDetectionVersion(void)
{ {
return m_strVersion.c_str(); return m_strVersion.c_str();
@ -3916,6 +3917,13 @@ void sx_rodPositioning(
} }
} }
} }
if (rodInfo.empty())
{
*errCode = SX_ERR_ZERO_OBJECTS;
return;
}
//(2)遮挡判断 //(2)遮挡判断
//按高度排序 //按高度排序
std::sort(rodInfo.begin(), rodInfo.end(), _commpareByCenterZ); std::sort(rodInfo.begin(), rodInfo.end(), _commpareByCenterZ);