$search
00001 00060 #include <cob_env_model/field_of_view_segmentation.h> 00061 #include <pcl/point_types.h> 00062 #include <pcl/io/pcd_io.h> 00063 #include <pcl/filters/extract_indices.h> 00064 #include <cob_env_model/cpc_point.h> 00065 #include <tf/transform_listener.h> 00066 00067 #include <boost/timer.hpp> 00068 00069 int main() 00070 { 00071 ipa_env_model::FieldOfViewSegmentation<pcl::PointXYZ> seg; 00072 Eigen::Vector3d n_up; 00073 Eigen::Vector3d n_down; 00074 Eigen::Vector3d n_right; 00075 Eigen::Vector3d n_left; 00076 double maxRange = 6; 00077 double fovHor = 0.3; 00078 double fovVer = 0.7; 00079 00080 pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ> ()), cloud_filtered (new pcl::PointCloud<pcl::PointXYZ> ()); 00081 pcl::PCDReader reader; 00082 reader.read ("tof.pcd", *cloud); 00083 pcl::PointIndices indices; 00084 seg.setInputCloud(cloud); 00085 boost::timer t; 00086 seg.computeFieldOfView(); 00087 std::cout << "compute FOV: " << t.elapsed() << std::endl; 00088 t.restart(); 00089 //seg.segment(indices,n_up,n_down,n_right,n_left,maxRange); 00090 std::cout << "segment: " << t.elapsed() << std::endl; 00091 00092 pcl::PointCloud<pcl::PointXYZ> frustum; 00093 pcl::ExtractIndices<pcl::PointXYZ> extractIndices; 00094 //extractIndices.setInputCloud(cloud); 00095 //extractIndices.setIndices(boost::make_shared<pcl::PointIndices>(indices)); 00096 //extractIndices.filter(frustum); 00097 pcl::io::savePCDFileASCII ("frustum.pcd", frustum); 00098 return 0; 00099 }