栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

【三维点云数据处理】ISS特征点提取算法

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【三维点云数据处理】ISS特征点提取算法

1 算法原理

           Yu Zhong提出了一种识别表示为3D点云的3D对象的新方法。引入了一种称为内在形状签名(Intrinsic Shape Signature,ISS)的新3D形状描述符,以表征点云的局部/半局部区域。固有形状签名使用与视图无关的 3D 形状表示来直接匹配来自不同视图的形状斑块,并使用编码查看几何图形的视图相关变换来促进快速姿态估计。

        特征点是图像点云中那些可以通过定义检测标准提取的稳定、独特的点集,其数量远小于原始点数。ISS 特征点是一种通过与邻域信息建立联系,并利用特征值之间的关系来表示点特征程度的方法。其主要步骤如下:

  1. 对每个查询点 设定一个搜索半径 r。
  2. 计算查询点 pi与邻域内各点的欧氏距离,并设定权值 。
  3.  计算每个查询点 pi与邻域内所有点的协方差矩阵 cov() 

  4.  计算协方差矩阵  cov()  的所有特征值{ ,,} ,并将其按照从大到小排序。

  5. 设定阈值 和 ,若其满足式(3) 即为ISS 特征点。

2 代码实现
#include 
#include 
#include 
#include 
#include 
#include 


typedef  pcl::PointCloud PointCloud;

//点云可视化
// 显示model+scene以及他们的keypoints
void
visualize_pcd(PointCloud::Ptr model, pcl::PointCloud::Ptr scene_keypoints)
{
    pcl::visualization::PCLVisualizer viewer("registration Viewer");
    pcl::visualization::PointCloudColorHandlerCustom model_color(model, 0, 255, 0);
    pcl::visualization::PointCloudColorHandlerCustom scene_keypoint_color(scene_keypoints, 0, 0, 255);
    viewer.setBackgroundColor(255, 255, 255);
    viewer.addPointCloud(model, model_color, "model");
    viewer.addPointCloud(scene_keypoints, scene_keypoint_color, "scene_keypoints");
    viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "scene_keypoints");

    while(!viewer.wasStopped())
    {
        viewer.spinOnce(100);
        boost::this_thread::sleep(boost::posix_time::microseconds(100000));
    }
}



// 你的文件地址
const std::string filename = "D:\clouddata\dragonStandRight_0.pcd";

int
main(int, char** argv)
{

    pcl::PointCloud::Ptr cloud(new pcl::PointCloud);

if (pcl::io::loadPCDFile(filename, *cloud) == -1) // load the file
{
    pcl::console::print_error("Couldn't read file %s!n", argv[1]);
    return (-1);
}
  std::cout << "points: " << cloud->points.size () < iss_detector;

      pcl::PointCloud::Ptr keypoints (new pcl::PointCloud ());
      pcl::search::KdTree::Ptr tree (new pcl::search::KdTree ());

      iss_detector.setSearchMethod (tree);
      iss_detector.setSalientRadius (0.007f);
      iss_detector.setNonMaxRadius (0.005f);
      iss_detector.setThreshold21 (0.65); //for resolution 0.004f
      iss_detector.setThreshold32 (0.1);  //for resolution 0.004f
      iss_detector.setMinNeighbors (4); //for resolution 0.004f
      iss_detector.setNumberOfThreads (4); //for resolution 0.004f
      iss_detector.setInputCloud (cloud); //
      iss_detector.compute (*keypoints); //

   std::cout << "N of ISS_3D points in the result are " << (*keypoints).points.size () << std::endl;
   pcl::io::savePCDFile("keypoints_iss_3d.pcd", *keypoints, true);

   // Visualization
    visualize_pcd(cloud, keypoints);
  return 0;

}
3 结果展示

 

上述用到的pcd点云文件

 

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/942164.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号