Skip to content

Instantly share code, notes, and snippets.

@Kyungpyo-Kim
Created May 1, 2018 05:52
Show Gist options
  • Save Kyungpyo-Kim/02368d331ad812bad7801d3a7f2a05c4 to your computer and use it in GitHub Desktop.
Save Kyungpyo-Kim/02368d331ad812bad7801d3a7f2a05c4 to your computer and use it in GitHub Desktop.
PCL, Random sample
#include <pcl/filters/random_sample.h>
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr track_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::RandomSample <pcl::PointXYZRGB> random;
random.setInputCloud(cloud_);
random.setSeed (std::rand ());
random.setSample((unsigned int)(100));
random.filter(*track_cloud);
@Kyungpyo-Kim
Copy link
Author

cloud_ 의 point 숫자가 setSample 숫자보다 적으면 모두다 나옴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment