Pointers 在点云库(PCL)中设置ISSKeypoint3D的法线

Pointers 在点云库(PCL)中设置ISSKeypoint3D的法线,pointers,type-conversion,point-cloud-library,normals,Pointers,Type Conversion,Point Cloud Library,Normals,我试图在PCL中计算点云上的ISS3D关键点。我想把它设置好 法线,因为我不确定ISS关键点估计是否会翻转它们 在正确的方向上。但是,当我尝试像这样设置法线时 typedef pcl::PointCloud<pcl::PointXYZRGB> > PointCloud; PointCloud::Ptr detecISSKeypoints(PointCloud::Ptr cloud, pcl::PointCloud<pcl::PointNormal>::Ptr no

我试图在PCL中计算点云上的ISS3D关键点。我想把它设置好 法线,因为我不确定ISS关键点估计是否会翻转它们 在正确的方向上。但是,当我尝试像这样设置法线时

typedef pcl::PointCloud<pcl::PointXYZRGB> > PointCloud;

PointCloud::Ptr detecISSKeypoints(PointCloud::Ptr cloud, pcl::PointCloud<pcl::PointNormal>::Ptr normals, float resolution) {
  pcl::PointCloud<pcl::PointXYZRGB>::Ptr keypoints(new pcl::PointCloud<pcl::PointXYZRGB>);
  pcl::ISSKeypoint3D<pcl::PointXYZRGB, pcl::PointXYZRGB> detector;
  detector.setInputCloud(cloud);
  detector.setNormals(normals);
  pcl::search::KdTree<pcl::PointXYZRGB>::Ptr kdtree(new pcl::search::KdTree<pcl::PointXYZRGB>);
  detector.setSearchMethod(kdtree);
  detector.setSalientRadius(6 * resolution);
  detector.setNonMaxRadius(6 * resolution);
  detector.setMinNeighbors(6);
  detector.setThreshold21(0.975);
  detector.setThreshold32(0.975);
  detector.setNumberOfThreads(4);
  detector.compute(*keypoints);
  return keypoints;
}
typedef pcl::PointCloud>PointCloud;
点云::Ptr检测关键点(点云::Ptr云,pcl::点云::Ptr法线,浮点分辨率){
pcl::PointCloud::Ptr关键点(新pcl::PointCloud);
pcl::ISSKeypoint3D探测器;
检测器。setInputCloud(cloud);
检测器。设置法线(法线);
pcl::search::KdTree::Ptr KdTree(新的pcl::search::KdTree);
检测器。设置搜索方法(kdtree);
探测器。设置校准中心(6*分辨率);
探测器。设置非最大半径(6*分辨率);
探测器。setMinNeighbors(6);
检测器。设置阈值21(0.975);
检测器。设置阈值32(0.975);
检测器。设置螺纹数(4);
检测器。计算(*关键点);
返回关键点;
}
我得到一个错误,
setNormals
需要一个
const pointcloudnconsttr&
。我试图将法线的指针转换为
constpcl::PointCloud::ConstPtr
,但这不起作用


如何设置法线?

最后,我成功地设置了如下法线:

  pcl::PointCloud<pcl::Normal>::Ptr normalsCopy (new pcl::PointCloud<pcl::Normal>);
  copyPointCloud(*normals, *normalsCopy);
  boost::shared_ptr<const pcl::PointCloud<pcl::Normal> > constNormals (normalsCopy);
  detector.setNormals(constNormals);
pcl::PointCloud::Ptr normalsCopy(新的pcl::PointCloud);
copyPointCloud(*法线,*法线);
boost::共享_ptr constNormals(normalsCopy);
检测器。设置法线(常量法线);

问题是
ISSKeypoint3D
只接受
pcl::Normal
,而不是
pcl::PointNormal
,指针必须指向常量pointlcoud。

我不确定是否可以为该检测器设置Normal。我使用了它,但没有放置法线,效果很好。我想他们会计算ISS代码内部的法线,但我不能告诉你估算翻转是否正确……谢谢,我找到了转换的解决方案,我会尽快发布。