filter.h
Go to the documentation of this file.
00001 
00002 /*
00003  * tools.h
00004  *
00005  *  Created on: Feb 6, 2012
00006  *      Author: hess
00007  */
00008 
00009 #ifndef TOOLS_H_
00010 #define TOOLS_H_
00011 
00012 #include <pcl/point_types.h>
00013 #include <pcl/filters/passthrough.h>
00014 
00015 template <typename PointT>
00016 void filterXYZ(pcl::PointCloud<PointT> &cloud, pcl::PointCloud<PointT> &cloud_filtered, double min_x,
00017                 double max_x, double min_y, double max_y, double min_z, double max_z) {
00018 
00019         pcl::PassThrough<PointT> pass;
00020 
00021         // filter x
00022         pass.setInputCloud(boost::make_shared<pcl::PointCloud<PointT> >(cloud));
00023         pass.setFilterFieldName("x");
00024         pass.setFilterLimits(min_x, max_x);
00025         pass.filter(cloud_filtered);
00026 
00027         // filter y
00028         pass.setInputCloud(boost::make_shared<pcl::PointCloud<PointT> >(cloud_filtered));
00029         pass.setFilterFieldName("y");
00030         pass.setFilterLimits(min_y, max_y);
00031         pass.filter(cloud_filtered);
00032 
00033         // filter z
00034         pass.setInputCloud(boost::make_shared<pcl::PointCloud<PointT> >(cloud_filtered));
00035         pass.setFilterFieldName("z");
00036         pass.setFilterLimits(min_z, max_z);
00037         pass.filter(cloud_filtered);
00038 
00039 }
00040 #endif /* TOOLS_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


coverage_3d_tools
Author(s): Juergen Hess
autogenerated on Wed Dec 26 2012 15:25:37