我有一个关于PCL structure SACSegmentationFromNormals的问题。我想用C++做一个圆柱体分割。一个类似的平面分割工作得很好,但这里我得到了错误消息:
未提供"PCL::SACSegmentationFromNormals::initSACModell输入数据!无法继续。“
不过,我使用的是PointXYZRGBA和pcl::Normal。有谁有主意吗?到目前为止,我的代码如下:
`pcl::ModelCoefficients::Ptr ProMaTFC::fitting() {
...
pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients);
pcl::SACSegmentationFromNormals<pcl::PointXYZRGBA, pcl::Normal> seg;
seg.setOptimizeCoefficients(true);
seg.setModelType(pcl::SACMODEL_CYLINDER);
seg.setMethodType(pcl::SAC_RANSAC);
seg.setDistanceThreshold(0.1);
seg.setInputCloud(cloud->makeShared());
seg.setRadiusLimits(0, 5);
pcl::PointIndices inlierIndices;
segmentation.segment(inlierIndices, *coefficients_cylinder);
...
return coefficients_cylinder;
}`我正在使用下面的库(如果你想知道的话):
`#include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/passthrough.h>
#include <pcl/features/normal_3d.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h> `发布于 2018-05-10 17:27:53
如果您希望使用正常信息来估计参数,则应调用函数setInputNormals()。
https://stackoverflow.com/questions/47943586
复制相似问题