4 #include "load_clouds.h"
5 #include "solution/filters.h"
6 #include "solution/segmentation.h"
7 #include "solution/feature_estimation.h"
8 #include "solution/registration.h"
10 #include <pcl/io/pcd_io.h>
11 #include <pcl/kdtree/kdtree_flann.h>
64 std::size_t n = filenames.size ();
67 for (std::size_t i = 0; i < n; ++i)
69 const std::string & filename = filenames[i];
70 if (filename.compare (filename.size ()-4, 4,
".pcd") == 0)
81 models_[i].points = loadPointCloud<PointT> (filename,
"_points.pcd");
82 models_[i].keypoints = loadPointCloud<PointT> (filename,
"_keypoints.pcd");
83 models_[i].local_descriptors = loadPointCloud<LocalDescriptorT> (filename,
"_localdesc.pcd");
84 models_[i].global_descriptor = loadPointCloud<GlobalDescriptorT> (filename,
"_globaldesc.pcd");
99 std::vector<int> nn_index (1);
100 std::vector<float> nn_sqr_distance (1);
101 kdtree_->nearestKSearch (query_descriptor, 1, nn_index, nn_sqr_distance);
102 const int & best_match = nn_index[0];
114 std::vector<int> nn_index (1);
115 std::vector<float> nn_sqr_distance (1);
116 kdtree_->nearestKSearch (query_descriptor, 1, nn_index, nn_sqr_distance);
117 const int & best_match = nn_index[0];
129 SurfaceNormalsPtr normals;
145 std::vector<pcl::PointIndices> cluster_indices;
149 PointCloudPtr largest_cluster (
new PointCloud);
152 return (largest_cluster);
158 SurfaceNormalsPtr & normals_out, PointCloudPtr & keypoints_out,
159 LocalDescriptorsPtr & local_descriptors_out, GlobalDescriptorsPtr & global_descriptor_out)
const
166 local_descriptors_out = computeLocalDescriptors (points, normals_out, keypoints_out,
169 global_descriptor_out = computeGlobalDescriptor (points, normals_out);
177 Eigen::Matrix4f tform;
184 tform = refineAlignment (source.
points, target.
points, tform,
195 std::vector<ObjectModel>
models_;