【问题标题】:Setting normals for ISSKeypoint3D in Point Cloud Library (PCL)在点云库 (PCL) 中设置 ISSKeypoint3D 的法线
【发布时间】:2023-03-03 17:11:01
【问题描述】:

我正在尝试在 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;
}

我收到一个错误,setNormals 期待 const PointCloudNConstPtr&amp;。我试图将法线的指针转换为const pcl::PointCloud&lt;pcl::PointNormal&gt;::ConstPtr,但这不起作用。

如何设置法线?

【问题讨论】:

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

标签: pointers type-conversion point-cloud-library normals


【解决方案1】:

最后我设法像这样设置法线:

  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);

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-15
    • 1970-01-01
    • 2020-01-23
    • 2017-03-28
    • 1970-01-01
    • 2021-07-31
    • 1970-01-01
    相关资源
    最近更新 更多