提交 13e06440 编写于 作者: R Radu B. Rusu

moved away from make_shared completely


git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@525 a9d63959-f2ad-4865-b262-bf0e56cfafb6
上级 715b0a7f
......@@ -38,7 +38,6 @@
#include <gtest/gtest.h>
#include <boost/make_shared.hpp>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/kdtree/kdtree_flann.h>
......@@ -949,7 +948,8 @@ TEST (PCL, IntensityGradientEstimation)
PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ());
NormalEstimation<PointXYZI, Normal> norm_est;
norm_est.setInputCloud (cloud_ptr);
norm_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZI> > (false));
KdTreeFLANN<PointXYZI>::Ptr treept1 (new KdTreeFLANN<PointXYZI> (false));
norm_est.setSearchMethod (treept1);
norm_est.setRadiusSearch (0.25);
norm_est.compute (*normals);
......@@ -958,7 +958,8 @@ TEST (PCL, IntensityGradientEstimation)
IntensityGradientEstimation<PointXYZI, Normal, IntensityGradient> grad_est;
grad_est.setInputCloud (cloud_ptr);
grad_est.setInputNormals (normals);
grad_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZI> > (false));
KdTreeFLANN<PointXYZI>::Ptr treept2 (new KdTreeFLANN<PointXYZI> (false));
grad_est.setSearchMethod (treept2);
grad_est.setRadiusSearch (0.25);
grad_est.compute (gradient);
......@@ -1024,7 +1025,8 @@ TEST (PCL, IntensitySpinEstimation)
// Compute the intensity-domain spin features
typedef Histogram<20> IntensitySpin;
IntensitySpinEstimation<PointXYZI, IntensitySpin> ispin_est;
ispin_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZI> > (false));
KdTreeFLANN<PointXYZI>::Ptr treept3 (new KdTreeFLANN<PointXYZI> (false));
ispin_est.setSearchMethod (treept3);
ispin_est.setRadiusSearch (10.0);
ispin_est.setNrDistanceBins (4);
ispin_est.setNrIntensityBins (5);
......@@ -1110,7 +1112,8 @@ TEST (PCL, RIFTEstimation)
// Compute the RIFT features
typedef Histogram<32> RIFTDescriptor;
RIFTEstimation<PointXYZI, IntensityGradient, RIFTDescriptor> rift_est;
rift_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZI> > (false));
KdTreeFLANN<PointXYZI>::Ptr treept4 (new KdTreeFLANN<PointXYZI> (false));
rift_est.setSearchMethod (treept4);
rift_est.setRadiusSearch (10.0);
rift_est.setNrDistanceBins (4);
rift_est.setNrGradientBins (8);
......
......@@ -46,7 +46,6 @@ using namespace std;
#include <pcl/common/time.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <boost/make_shared.hpp>
using namespace pcl;
......
......@@ -229,15 +229,15 @@ TEST (PCL, SampleConsensusInitialAlignment)
cloud_target_ptr = cloud_target.makeShared ();
// Initialize estimators for surface normals and FPFH features
KdTreeFLANN<PointXYZ> tree;
KdTreeFLANN<PointXYZ>::Ptr tree (new KdTreeFLANN<PointXYZ>);
NormalEstimation<PointXYZ, Normal> norm_est;
norm_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZ> > (tree));
norm_est.setSearchMethod (tree);
norm_est.setRadiusSearch (0.05);
PointCloud<Normal> normals;
FPFHEstimation<PointXYZ, Normal, FPFHSignature33> fpfh_est;
fpfh_est.setSearchMethod (boost::make_shared<KdTreeFLANN<PointXYZ> > (tree));
fpfh_est.setSearchMethod (tree);
fpfh_est.setRadiusSearch (0.05);
PointCloud<FPFHSignature33> features_source, features_target;
......
......@@ -835,10 +835,11 @@ int
// Estimate surface normals
NormalEstimation<PointXYZ, Normal> n;
KdTree<PointXYZ>::Ptr tree = boost::make_shared<KdTreeFLANN<PointXYZ> > ();
KdTree<PointXYZ>::Ptr tree (new KdTreeFLANN<PointXYZ>);
tree->setInputCloud (cloud_);
n.setInputCloud (cloud_);
n.setIndices (boost::make_shared <vector<int> > (indices_));
boost::shared_ptr<vector<int> > indicesptr (new vector<int> (indices_));
n.setIndices (indicesptr);
n.setSearchMethod (tree);
n.setRadiusSearch (0.02); // Use 2cm radius to estimate the normals
n.compute (*normals_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册