include pclioply_ioh#include pclpoint_typesh#include pclfeaturesmoment_of_inertia_estimationh#include pclvisualizationpcl_visualizerhint main 加载点云数据 pclPointCloudpclPointXYZPtr cloudnew pclPoin
这个错误是因为你使用的函数或方法在你使用的版本中不存在或者参数不匹配。根据错误提示,需要对代码进行以下修改:
- 首先,关于
getOBB()函数的报错,根据pcl::MomentOfInertiaEstimation类的声明,该函数只接受两个参数,而你的代码中传入了三个参数。因此,你需要将getOBB()函数的调用从这样:
feature.getOBB(position, majorAxis, middleAxis);
修改为这样:
feature.getOBB(position, majorAxis);
- 关于
getEigenValues()函数的报错,根据pcl::MomentOfInertiaEstimation类的声明,该函数不接受参数。因此,你需要将两个调用getEigenValues()函数的地方修改为这样:
float width = feature.getEigenValues()[0];
float height = feature.getEigenValues()[1];
修改为:
std::vector<float> eigenValues;
feature.getEigenValues(eigenValues);
float width = eigenValues[0];
float height = eigenValues[1];
- 最后,关于
addEllipse()函数的报错,根据错误提示,该函数并不是pcl::visualization::PCLVisualizer类的成员。我建议你查看一下你所使用的 PCL 的版本文档,找到适合的方法来绘制椭圆。
通过以上修改,你应该能够解决这些错误。希望对你有帮助
原文地址: http://www.cveoy.top/t/topic/ivr4 著作权归作者所有。请勿转载和采集!