Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //alloca un vettore con tutti gli indici
- pcl::IndicesPtr keypointsIndices_1(new std::vector<int>);
- keypointsIndices_1->resize(cloud_1->width * cloud_1->height);
- for(int id=0; id<keypointsIndices_1->size(); id++)
- {
- (*keypointsIndices_1)[id] = id;
- }
- //li disordina
- unsigned int nSamples = 10000;
- std::random_shuffle(keypointsIndices_1->begin(), keypointsIndices_1->end());
- //ne prende i primi nSamples
- keypointsIndices_1->resize(nSamples);
- pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_keypoints_1 (new pcl::PointCloud<pcl::PointXYZ> ());
- pcl::copyPointCloud(*cloud_1, *keypointsIndices_1, *cloud_keypoints_1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement