| 1014 | } |
| 1015 | |
| 1016 | pcl::PointCloud<PointL>::Ptr |
| 1017 | random_downsample_pl(pcl::PointCloud<PointL>::Ptr cloud_ori, int ratio) { |
| 1018 | pcl::PointCloud<PointL>::Ptr sampled_pc(new pcl::PointCloud<PointL>); |
| 1019 | |
| 1020 | for (int i = 0; i < cloud_ori->points.size(); ++i) { |
| 1021 | if (i % ratio == 0) { |
| 1022 | sampled_pc->points.push_back(cloud_ori->points[i]); |
| 1023 | } |
| 1024 | } |
| 1025 | |
| 1026 | return sampled_pc; |
| 1027 | } |
| 1028 | |
| 1029 | void ds_point_cloud(pcl::PointCloud<PointType>::Ptr &pc_in, |
| 1030 | pcl::PointCloud<PointType>::Ptr &pc_out) { |