edges.hpp
Go to the documentation of this file.
00001 
00065 template<typename Point>
00066 void Feature_Edges<Point>::extractFeatures(const pcl::PointCloud<Point>& point_cloud, pcl::PointCloud<Point> &edges) {
00067   pcl::PointCloud<Normal>::Ptr n(new pcl::PointCloud<Normal>);
00068   pcl::PointCloud<InterestPoint>::Ptr ip(new pcl::PointCloud<InterestPoint>);
00069 
00070   ROS_INFO("normals...");
00071 
00072   pcl::IntegralImageNormalEstimation<Point, pcl::Normal> ne;
00073 
00074   ne.setNormalEstimationMethod (ne.COVARIANCE_MATRIX);
00075   ne.setMaxDepthChangeFactor(0.2f);
00076   ne.setRectSize(10,10);
00077   ne.setNormalSmoothingSize(10.0f);
00078   ne.setDepthDependentSmoothing(true);
00079   ne.setInputCloud(point_cloud.makeShared());
00080 
00081   ne.compute(*n);
00082 
00083   ROS_INFO("edges...");
00084 #ifdef GICP_ENABLE
00085   boost::shared_ptr<pcl::search::OrganizedNeighbor<Point> > oTree (new pcl::search::OrganizedNeighbor<Point> );
00086 #else
00087   #ifdef PCL_VERSION_COMPARE
00088     boost::shared_ptr<search::OrganizedNeighbor<Point> > oTree (new search::OrganizedNeighbor<Point> );
00089   #else
00090     boost::shared_ptr<pcl::OrganizedDataIndex<Point> > oTree (new pcl::OrganizedDataIndex<Point> );
00091   #endif
00092 
00093 #endif
00094   cob_3d_features::FastEdgeEstimation3DOMP<Point, Normal, InterestPoint> ee;
00095   /*ee.setRadiusSearch(radius_);
00096   ee.dist_threshold_ = dist_threshold_;
00097   ee.setSearchMethod(oTree);*/
00098   ee.setInputCloud(point_cloud.makeShared());
00099   ee.setInputNormals(n);
00100   ee.compute(*ip);
00101 
00102   edges.points.clear();
00103   for (size_t i = 0; i < ip->points.size(); i++)
00104   {
00105     if(ip->points[i].strength>thr_ && ip->points[i].strength<=1.f) {
00106       edges.points.push_back(point_cloud.points[i]);
00107     }
00108   }
00109 
00110   edges.width=edges.size();
00111   edges.height=1;
00112 }


cob_3d_registration
Author(s): Joshua Hampp
autogenerated on Wed Aug 26 2015 11:02:36