fix:rodAndBarDetection:没有棒材的情况不需要再计算料框信息

This commit is contained in:
杰仔 2026-10-06 14:33:40 +08:00
parent a0054f7d50
commit 5df9b7b628
2 changed files with 11 additions and 2 deletions

View File

@ -180,7 +180,8 @@ double fitCircleByLeastSquare(
double r2 = radius * radius;
for (int pId = 0; pId < N; ++pId) {
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;
}
#else

View File

@ -32,7 +32,8 @@
//version 1.4.0 : 矩森棒材抓取算法改进:(1)修正了两个棒材被识别成一根的问题(2)增强了对噪点的容忍度,增强了鲁棒性
//version 1.5.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)
{
return m_strVersion.c_str();
@ -3916,6 +3917,13 @@ void sx_rodPositioning(
}
}
}
if (rodInfo.empty())
{
*errCode = SX_ERR_ZERO_OBJECTS;
return;
}
//(2)遮挡判断
//按高度排序
std::sort(rodInfo.begin(), rodInfo.end(), _commpareByCenterZ);