未验证 提交 1d482d52 编写于 作者: M Markus Vieth 提交者: GitHub

Merge pull request #4574 from mvieth/indices_test

[test] Use more pcl::Indices and pcl::index_t
......@@ -106,7 +106,7 @@ TEST (PCL, copyPointCloud)
EXPECT_EQ (cloud_xyz_rgba[i].rgba, cloud_xyz_rgb_normal[i].rgba);
}
IndicesAllocator< Eigen::aligned_allocator<int> > indices_aligned;
IndicesAllocator< Eigen::aligned_allocator<pcl::index_t> > indices_aligned;
indices_aligned.push_back (1); indices_aligned.push_back (2); indices_aligned.push_back (3);
pcl::copyPointCloud (cloud_xyz_rgba, indices_aligned, cloud_xyz_rgb_normal);
ASSERT_EQ (int (cloud_xyz_rgb_normal.size ()), 3);
......
......@@ -49,7 +49,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -51,7 +51,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -49,7 +49,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -49,7 +49,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -51,7 +51,7 @@ using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
using CloudPtr = PointCloud<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
CloudPtr cloud_milk;
......
......@@ -164,7 +164,7 @@ main (int argc, char** argv)
sampled_cloud.reset (new pcl::PointCloud<pcl::PointXYZ> ());
std::vector<int> sampled_indices;
pcl::Indices sampled_indices;
for (float sa = 0.0f; sa < (float)cloud->size (); sa += sampling_incr)
sampled_indices.push_back (static_cast<int> (sa));
copyPointCloud (*cloud, sampled_indices, *sampled_cloud);
......
......@@ -49,7 +49,6 @@ using namespace pcl::io;
search::KdTree<PointXYZ>::Ptr tree (new search::KdTree<PointXYZ> ());
PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ> ());
std::vector<int> indices;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST (PCL, GRSDEstimation)
......
......@@ -48,7 +48,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -51,7 +51,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -192,7 +192,7 @@ template<typename PointT>
class DummySearch : public pcl::search::Search<PointT>
{
public:
virtual int nearestKSearch (const PointT &point, int k, std::vector<int> &k_indices,
virtual int nearestKSearch (const PointT &point, int k, pcl::Indices &k_indices,
std::vector<float> &k_sqr_distances ) const
{
pcl::utils::ignore(point);
......@@ -203,7 +203,7 @@ class DummySearch : public pcl::search::Search<PointT>
return k;
}
virtual int radiusSearch (const PointT& point, double radius, std::vector<int>& k_indices,
virtual int radiusSearch (const PointT& point, double radius, pcl::Indices& k_indices,
std::vector<float>& k_sqr_distances, unsigned int max_nn = 0 ) const
{
pcl::utils::ignore(point, radius, k_indices, k_sqr_distances);
......
......@@ -56,7 +56,7 @@ using KdTreePtr = pcl::search::KdTree<PointT>::Ptr;
using pcl::PointCloud;
static PointCloud<PointT>::Ptr cloud (new PointCloud<PointT> ());
static std::vector<int> indices;
static pcl::Indices indices;
static KdTreePtr tree;
///////////////////////////////////////////////////////////////////////////////////
......
......@@ -49,7 +49,6 @@ using namespace pcl::io;
search::KdTree<PointXYZ>::Ptr tree (new search::KdTree<PointXYZ> ());
PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ> ());
std::vector<int> indices;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST (PCL, RSDEstimation)
......
......@@ -53,12 +53,12 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
///////////////////////////////////////////////////////////////////////////////////
template<typename PointT> void
shotCopyPointCloud (const PointCloud<PointT> &cloud_in, const std::vector<int> &indices,
shotCopyPointCloud (const PointCloud<PointT> &cloud_in, const pcl::Indices &indices,
PointCloud<PointT> &cloud_out)
{
pcl::copyPointCloud<PointT>(cloud_in, indices, cloud_out);
......
......@@ -50,7 +50,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -50,7 +50,7 @@ using namespace pcl::io;
using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
KdTreePtr tree;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -159,7 +159,7 @@ TEST (CropBox, Filters)
cropBoxFilter.setMax (max_pt);
// Indices
std::vector<int> indices;
pcl::Indices indices;
cropBoxFilter.filter (indices);
// Cloud
......@@ -483,7 +483,7 @@ TEST (CropBox, Filters)
cropBoxFilter2.setMax (max_pt);
// Indices
std::vector<int> indices2;
pcl::Indices indices2;
cropBoxFilter2.filter (indices2);
// Cloud
......
......@@ -69,7 +69,6 @@ using namespace Eigen;
PCLPointCloud2::Ptr cloud_blob (new PCLPointCloud2);
PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ>);
std::vector<int> indices_;
PointCloud<PointXYZRGB>::Ptr cloud_organized (new PointCloud<PointXYZRGB>);
......@@ -2152,7 +2151,7 @@ TEST (NormalRefinement, Filters)
// Input without NaN
pcl::PointCloud<pcl::PointXYZRGB> cloud_organized_nonan;
std::vector<int> dummy;
pcl::Indices dummy;
pcl::removeNaNFromPointCloud<pcl::PointXYZRGB> (*cloud_organized, cloud_organized_nonan, dummy);
// Viewpoint
......@@ -2335,10 +2334,6 @@ main (int argc, char** argv)
loadPCDFile (file_name, *cloud_blob);
fromPCLPointCloud2 (*cloud_blob, *cloud);
indices_.resize (cloud->size ());
for (index_t i = 0; i < static_cast<index_t>(indices_.size ()); ++i)
indices_[i] = i;
loadPCDFile (argv[2], *cloud_organized);
......
......@@ -54,7 +54,7 @@ PointCloud<PointXYZ>::Ptr cloud_in (new PointCloud<PointXYZ>);
TEST (ModelOutlierRemoval, Model_Outlier_Filter)
{
PointCloud<PointXYZ>::Ptr cloud_filter_out (new PointCloud<PointXYZ>);
std::vector<int> ransac_inliers;
pcl::Indices ransac_inliers;
float thresh = 0.01;
//run ransac
Eigen::VectorXf model_coefficients;
......
......@@ -593,7 +593,7 @@ TEST (PCL, IO)
EXPECT_FLOAT_EQ (cloud[nr_p - 1].z, last.z); // test for fromPCLPointCloud2 ()
EXPECT_FLOAT_EQ (float (cloud[nr_p - 1].intensity), float (last.intensity)); // test for fromPCLPointCloud2 ()
std::vector<int> indices (cloud.width * cloud.height / 2);
pcl::Indices indices (cloud.width * cloud.height / 2);
for (int i = 0; i < static_cast<int> (indices.size ()); ++i) indices[i] = i;
// Save as ASCII
try
......
......@@ -99,7 +99,7 @@ TEST (PCL, KdTreeFLANN_radiusSearch)
for (std::size_t i=0; i < cloud.size(); ++i)
if (euclideanDistance(cloud[i], test_point) < max_dist)
brute_force_result.insert(i);
std::vector<int> k_indices;
pcl::Indices k_indices;
std::vector<float> k_distances;
kdtree.radiusSearch (test_point, max_dist, k_indices, k_distances, 100);
......@@ -178,7 +178,7 @@ TEST (PCL, KdTreeFLANN_nearestKSearch)
++counter;
}
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -243,7 +243,7 @@ TEST (PCL, KdTreeFLANN_setPointRepresentation)
// Find k nearest neighbors
const int k = 10;
std::vector<int> k_indices (k);
pcl::Indices k_indices (k);
std::vector<float> k_distances (k);
kdtree.nearestKSearch (p, k, k_indices, k_distances);
for (int i = 0; i < k; ++i)
......@@ -294,11 +294,11 @@ TEST (PCL, KdTreeFLANN_32_vs_64_bit)
KdTreeFLANN<PointXYZ> tree;
tree.setInputCloud (cloud_in);
std::vector<std::vector<int> > nn_indices_vector;
std::vector<pcl::Indices > nn_indices_vector;
for (std::size_t i = 0; i < cloud_in->size (); ++i)
if (isFinite ((*cloud_in)[i]))
{
std::vector<int> nn_indices;
pcl::Indices nn_indices;
std::vector<float> nn_dists;
tree.radiusSearch ((*cloud_in)[i], 0.02, nn_indices, nn_dists);
......
......@@ -147,7 +147,7 @@ TEST (PCL, SIFTKeypoint_radiusSearch)
}
Eigen::MatrixXf diff_of_gauss;
std::vector<int> nn_indices;
pcl::Indices nn_indices;
std::vector<float> nn_dist;
diff_of_gauss.resize (input.size (), scales.size () - 1);
......@@ -157,8 +157,8 @@ TEST (PCL, SIFTKeypoint_radiusSearch)
tree.radiusSearch (i_point, max_radius, nn_indices, nn_dist);
// Are they all unique?
std::set<int> unique_indices;
for (const int &nn_index : nn_indices)
std::set<pcl::index_t> unique_indices;
for (const auto &nn_index : nn_indices)
{
unique_indices.insert (nn_index);
}
......
......@@ -79,7 +79,7 @@ computeRmsE (const PointCloud<PointType>::ConstPtr &model, const PointCloud<Poin
double sqr_norm_sum = 0;
int found_points = 0;
std::vector<int> neigh_indices (1);
pcl::Indices neigh_indices (1);
std::vector<float> neigh_sqr_dists (1);
for (const auto &model : transformed_model)
{
......@@ -221,7 +221,7 @@ main (int argc, char** argv)
{
if ( std::isfinite( scene_descriptors_->at (i).descriptor[0] ) )
{
std::vector<int> neigh_indices (1);
pcl::Indices neigh_indices (1);
std::vector<float> neigh_sqr_dists (1);
int found_neighs = match_search.nearestKSearch (scene_descriptors_->at (i), 1, neigh_indices, neigh_sqr_dists);
if(found_neighs == 1 && neigh_sqr_dists[0] < 0.25f)
......
......@@ -78,11 +78,11 @@ TEST (SampleConsensusModelLine, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (2, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (8, inliers.size ());
......@@ -136,7 +136,7 @@ TEST (SampleConsensusModelLine, OnGroundPlane)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (6, inliers.size ());
......@@ -188,11 +188,11 @@ TEST (SampleConsensusModelParallelLine, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (2, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (6, inliers.size ());
......
......@@ -61,7 +61,7 @@ using SampleConsensusModelNormalParallelPlanePtr = SampleConsensusModelNormalPar
PointCloud<PointXYZ>::Ptr cloud_ (new PointCloud<PointXYZ> ());
PointCloud<Normal>::Ptr normals_ (new PointCloud<Normal> ());
std::vector<int> indices_;
pcl::Indices indices_;
float plane_coeffs_[] = {-0.8964f, -0.5868f, -1.208f};
template <typename ModelType, typename SacType>
......@@ -76,11 +76,11 @@ void verifyPlaneSac (ModelType& model,
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (3, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_LT (inlier_number, inliers.size ());
......@@ -276,7 +276,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus<PointXYZ> sac (model, 0.03);
sac.computeModel();
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
ASSERT_EQ (cloud.size (), inliers.size ());
}
......@@ -287,7 +287,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus<PointXYZ> sac (model, 0.03);
sac.computeModel ();
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
ASSERT_EQ (cloud.size (), inliers.size ());
}
......@@ -298,7 +298,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus<PointXYZ> sac (model, 0.03);
sac.computeModel ();
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
ASSERT_EQ (0, inliers.size ());
}
......@@ -327,7 +327,7 @@ TEST (SampleConsensusModelPlane, SIMD_countWithinDistance) // Test if all countW
{
// Generate a cloud with 1000 random points
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
cloud.resize (1000);
for (std::size_t idx = 0; idx < cloud.size (); ++idx)
{
......@@ -392,7 +392,7 @@ TEST (SampleConsensusModelNormalPlane, SIMD_countWithinDistance) // Test if all
// Generate a cloud with 10000 random points
PointCloud<PointXYZ> cloud;
PointCloud<Normal> normal_cloud;
std::vector<int> indices;
pcl::Indices indices;
cloud.resize (10000);
normal_cloud.resize (10000);
for (std::size_t idx = 0; idx < cloud.size (); ++idx)
......
......@@ -84,11 +84,11 @@ TEST (SampleConsensusModelSphere, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (4, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (9, inliers.size ());
......@@ -130,7 +130,7 @@ TEST (SampleConsensusModelSphere, SIMD_countWithinDistance) // Test if all count
{
// Generate a cloud with 1000 random points
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
cloud.resize (1000);
for (std::size_t idx = 0; idx < cloud.size (); ++idx)
{
......@@ -244,11 +244,11 @@ TEST (SampleConsensusModelNormalSphere, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (4, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (27, inliers.size ());
......@@ -353,11 +353,11 @@ TEST (SampleConsensusModelCone, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (3, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (31, inliers.size ());
......@@ -437,11 +437,11 @@ TEST (SampleConsensusModelCylinder, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (2, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (20, inliers.size ());
......@@ -496,11 +496,11 @@ TEST (SampleConsensusModelCircle2D, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (3, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (17, inliers.size ());
......@@ -542,7 +542,7 @@ TEST (SampleConsensusModelCircle2D, SIMD_countWithinDistance) // Test if all cou
{
// Generate a cloud with 1000 random points
PointCloud<PointXYZ> cloud;
std::vector<int> indices;
pcl::Indices indices;
cloud.resize (1000);
for (std::size_t idx = 0; idx < cloud.size (); ++idx)
{
......@@ -619,11 +619,11 @@ TEST (SampleConsensusModelCircle3D, RANSAC)
bool result = sac.computeModel ();
ASSERT_TRUE (result);
std::vector<int> sample;
pcl::Indices sample;
sac.getModel (sample);
EXPECT_EQ (3, sample.size ());
std::vector<int> inliers;
pcl::Indices inliers;
sac.getInliers (inliers);
EXPECT_EQ (18, inliers.size ());
......
......@@ -94,7 +94,7 @@ TEST (PCL, FlannSearch_nearestKSearch)
++counter;
}
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -146,12 +146,12 @@ TEST (PCL, FlannSearch_differentPointT)
std::vector< std::vector< int > > indices;
FlannSearch.nearestKSearchT (cloud_rgb, std::vector<int> (),no_of_neighbors,indices,dists);
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
//vector<int> k_indices_t;
//pcl::Indices k_indices_t;
//k_indices_t.resize (no_of_neighbors);
//vector<float> k_distances_t;
//k_distances_t.resize (no_of_neighbors);
......@@ -187,7 +187,7 @@ TEST (PCL, FlannSearch_multipointKnnSearch)
std::vector< std::vector< int > > indices;
FlannSearch.nearestKSearch (cloud_big, std::vector<int>(),no_of_neighbors,indices,dists);
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -225,7 +225,7 @@ TEST (PCL, FlannSearch_knnByIndex)
}
flann_search.nearestKSearch (cloud_big, query_indices,no_of_neighbors,indices,dists);
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -256,7 +256,7 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
{
int no_of_neighbors=3;
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -289,9 +289,9 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
kdtree_search->nearestKSearch (point, no_of_neighbors, k_indices, k_distances);
}
std::vector<std::vector<int> > indices_flann;
std::vector<pcl::Indices> indices_flann;
std::vector<std::vector<float> > dists_flann;
std::vector<std::vector<int> > indices_tree;
std::vector<pcl::Indices> indices_tree;
std::vector<std::vector<float> > dists_tree;
indices_flann.resize (cloud_big.size ());
dists_flann.resize (cloud_big.size ());
......@@ -332,7 +332,7 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
}
std::vector<int> query_indices;
pcl::Indices query_indices;
for (std::size_t i = 0; i<cloud_big.size (); i+=2)
query_indices.push_back (int (i));
......
......@@ -90,7 +90,7 @@ init ()
++counter;
}
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......@@ -140,12 +140,12 @@ TEST (PCL, KdTree_differentPointT)
std::vector< std::vector< int > > indices;
kdtree.nearestKSearchT (cloud_rgb, std::vector<int> (),no_of_neighbors,indices,dists);
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
std::vector<int> k_indices_t;
pcl::Indices k_indices_t;
k_indices_t.resize (no_of_neighbors);
std::vector<float> k_distances_t;
k_distances_t.resize (no_of_neighbors);
......@@ -178,7 +178,7 @@ TEST (PCL, KdTree_multipointKnnSearch)
std::vector< std::vector< int > > indices;
kdtree.nearestKSearch (cloud_big, std::vector<int> (),no_of_neighbors,indices,dists);
std::vector<int> k_indices;
pcl::Indices k_indices;
k_indices.resize (no_of_neighbors);
std::vector<float> k_distances;
k_distances.resize (no_of_neighbors);
......
......@@ -83,7 +83,7 @@ TEST (PCL, Octree_Pointcloud_Nearest_K_Neighbour_Search)
// create octree
pcl::search::Octree<PointXYZ> octree(0.1);
std::vector<int> k_indices;
pcl::Indices k_indices;
std::vector<float> k_sqr_distances;
std::vector<int> k_indices_bruteforce;
......@@ -259,7 +259,7 @@ TEST (PCL, Octree_RadiusSearch_GPU)
radiuses.push_back(radius);
radiuses.push_back(radius);
radiuses.push_back(radius);
std::vector<std::vector<int> > k_indices;
std::vector<pcl::Indices > k_indices;
std::vector<std::vector<float> > k_distances;
int max_nn = -1;
......
......@@ -294,7 +294,7 @@ testKNNSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector<se
if (!input_indices.empty ())
{
indices_mask.assign (point_cloud->size (), false);
for (const int &input_index : input_indices)
for (const auto &input_index : input_indices)
indices_mask [input_index] = true;
}
......@@ -322,7 +322,7 @@ testKNNSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector<se
for (unsigned knn = 1; knn <= 512; knn <<= 3)
{
// find nn for each point in the cloud
for (const int &query_index : query_indices)
for (const auto &query_index : query_indices)
{
#pragma omp parallel for \
shared(indices, input_indices, indices_mask, distances, knn, nan_mask, passed, point_cloud, query_index, search_methods) \
......@@ -372,7 +372,7 @@ testRadiusSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector
if (!input_indices.empty ())
{
indices_mask.assign (point_cloud->size (), false);
for (const int &input_index : input_indices)
for (const auto &input_index : input_indices)
indices_mask [input_index] = true;
}
......@@ -401,7 +401,7 @@ testRadiusSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector
{
//std::cout << radius << std::endl;
// find nn for each point in the cloud
for (const int &query_index : query_indices)
for (const auto &query_index : query_indices)
{
#pragma omp parallel for \
default(none) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册