[PCL]ApproximateVoxelGrid

点云滤波继承自Filter模板类

注意Filter类的filter 方法调用了虚方法applyFilter:

 1 inline void  filter (PointCloud &output)
 2       {
 3         if (!initCompute ())
 4           return;
 5 
 6         if (input_.get () == &output)  // cloud_in = cloud_out
 7         {
 8           PointCloud output_temp;
 9           applyFilter (output_temp);
10           output_temp.header = input_->header;
11           output_temp.sensor_origin_ = input_->sensor_origin_;
12           output_temp.sensor_orientation_ = input_->sensor_orientation_;
13           pcl::copyPointCloud (output_temp, output);
14         }
15         else
16         {
17           output.header = input_->header;
18           output.sensor_origin_ = input_->sensor_origin_;
19           output.sensor_orientation_ = input_->sensor_orientation_;
20           applyFilter (output);
21         }
22 
23         deinitCompute ();
24       }

 

 

ApproximateVoxelGrid进行点云Filter

效果图:

原始点云66901个点,点云平均距离0.038253,采样参数(Grid size 0.2)后点云数目11924

 

posted @ 2016-06-12 17:43  太一吾鱼水  阅读(3293)  评论(0编辑  收藏  举报