Advertisement

PCL octree compute nearest neighbors and distances

阅读量:
复制代码
    #include<pcl/point_cloud.h>
    #include<pcl/octree/octree_search.h>
    #include<iostream>
    #include<vector>
    #include<ctime>
    #include<math.h>
    
    
    int
    main(int argc, char** argv)
    {
    	srand((unsigned int)time(NULL));
    
    	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud < pcl::PointXYZ>);
    	cloud->width = 1000;
    	cloud->height = 1;
    
    	cloud->resize(cloud->width * cloud->height);
    
    	for (auto& p : *cloud)
    	{
    		p.x = 1024 * rand() / (RAND_MAX + 1.0f);
    		p.y = 1024 * rand() / (RAND_MAX + 1.0f);
    		p.z = 10

全部评论 (0)

还没有任何评论哟~