Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1.         //alloca un vettore con tutti gli indici
  2.         pcl::IndicesPtr keypointsIndices_1(new std::vector<int>);
  3.         keypointsIndices_1->resize(cloud_1->width * cloud_1->height);
  4.         for(int id=0; id<keypointsIndices_1->size(); id++)
  5.         {
  6.             (*keypointsIndices_1)[id] = id;
  7.         }      
  8.        
  9.         //li disordina
  10.         unsigned int nSamples = 10000;
  11.         std::random_shuffle(keypointsIndices_1->begin(), keypointsIndices_1->end());
  12.        
  13.         //ne prende i primi nSamples
  14.         keypointsIndices_1->resize(nSamples);
  15.         pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_keypoints_1 (new pcl::PointCloud<pcl::PointXYZ> ());
  16.         pcl::copyPointCloud(*cloud_1, *keypointsIndices_1, *cloud_keypoints_1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement