Go to the documentation of this file.
14 #include <CGAL/boost/graph/properties.h>
18 #include <pcl/kdtree/kdtree_flann.h>
46 typedef boost::read_write_property_map_tag
category;
71 enriched_point.x = point[0];
72 enriched_point.y = point[1];
73 enriched_point.z = point[2];
144 typedef boost::read_write_property_map_tag
category;
165 enriched_point.normal_y,
166 enriched_point.normal_z);
170 throw std::runtime_error(
171 "FEVV::PCLPointCloudNormalMap: invalid use of un-initialized map");
183 enriched_point.normal_x = normal[0];
184 enriched_point.normal_y = normal[1];
185 enriched_point.normal_z = normal[2];
189 throw std::runtime_error(
"Invalid un-initialized PCLPointCloudNormalMap");
227 typedef boost::read_write_property_map_tag
category;
253 throw std::runtime_error(
254 "FEVV::PCLPointCloudColorMap: invalid use of un-initialized map");
266 enriched_point.r = color[0];
267 enriched_point.g = color[1];
268 enriched_point.b = color[2];
272 throw std::runtime_error(
"Invalid un-initialized PCLPointCloudNormalMap");
305 struct property_traits<
FEVV::PCLPointCloudPointMap >
320 typedef pcl::KdTreeFLANN< FEVV::PCLEnrichedPoint >
KdTree;
337 KdTreePtr kd_tree(
new KdTree);
340 kd_tree->setInputCloud(pc.makeShared());
360 std::pair< std::vector<
typename boost::graph_traits<
362 std::vector< double > >
374 search_point.x = query[0];
375 search_point.y = query[1];
376 search_point.z = query[2];
379 std::vector< int > nn_ids_tmp(k);
380 std::vector< float > nn_distances_tmp(k);
382 kd_tree.nearestKSearch(search_point, k, nn_ids_tmp, nn_distances_tmp);
391 std::vector< vertex_descriptor > nn_ids(nn_nbr);
392 std::vector< double > nn_distances(nn_nbr);
393 for(
int i = 0; i < nn_nbr; i++)
396 nn_distances[i] = std::sqrt(nn_distances_tmp[i]);
400 return make_pair(nn_ids, nn_distances);
414 std::pair< std::vector<
typename boost::graph_traits<
416 std::vector< double > >
428 search_point.x = query[0];
429 search_point.y = query[1];
430 search_point.z = query[2];
433 std::vector< int > nn_ids_tmp;
434 std::vector< float > nn_distances_tmp;
436 kd_tree.radiusSearch(search_point, radius, nn_ids_tmp, nn_distances_tmp);
439 std::vector< vertex_descriptor > nn_ids(nn_nbr);
440 std::vector< double > nn_distances(nn_nbr);
441 for(
int i = 0; i < nn_nbr; i++)
444 nn_distances[i] = std::sqrt(nn_distances_tmp[i]);
448 return make_pair(nn_ids, nn_distances);
boost::read_write_property_map_tag category
PCLPointCloudNNSearch::KdTreePtr create_kd_tree(const FEVV::PCLPointCloud &pc)
Initialize a k-d tree with all cloud points.
index_type vertex_descriptor
boost::graph_traits< FEVV::PCLPointCloud >::vertex_descriptor key_type
std::pair< std::vector< typename boost::graph_traits< FEVV::PCLPointCloud >::vertex_descriptor >, std::vector< double > > radius_search(const PCLPointCloudNNSearch::KdTree &kd_tree, double radius, const FEVV::PCLPoint &query, const FEVV::PCLPointCloud &)
Search for the nearest neighbors of a geometric point in the given radius.
PCLPointCloudNormalMap(FEVV::PCLPointCloud &pc)
pcl::KdTreeFLANN< FEVV::PCLEnrichedPoint > KdTree
FEVV::PCLPointCloud * m_pc
PCLPointCloudPointMap(const FEVV::PCLPointCloudPointMap &pm)
value_type operator[](key_type k) const
FEVV::PCLVector value_type
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
PCLPointCloudPointMap(FEVV::PCLPointCloud &pc)
PCLPointCloudPointMap & operator=(const PCLPointCloudPointMap &)=default
boost::read_write_property_map_tag category
void set(key_type k, const FEVV::PCLPoint &point)
FEVV::PCLPoint value_type
PCLPointCloudColorMap & operator=(const PCLPointCloudColorMap &)=default
std::pair< std::vector< typename boost::graph_traits< FEVV::PCLPointCloud >::vertex_descriptor >, std::vector< double > > kNN_search(const PCLPointCloudNNSearch::KdTree &kd_tree, unsigned int k, const FEVV::PCLPoint &query, const FEVV::PCLPointCloud &)
Search the k nearest neighbors of a geometric point.
PCLPointCloudNormalMap & operator=(const PCLPointCloudNormalMap &)=default
FEVV::PCLColor value_type
FEVV::PCLVector & reference
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
value_type operator[](key_type k) const
Interfaces for plugins These interfaces will be used for different plugins.
PCLPointCloudNormalMap(const FEVV::PCLPointCloudNormalMap &nm)
void set(key_type k, const FEVV::PCLVector &normal)
PCLPointCloudColorMap(const FEVV::PCLPointCloudColorMap &cm)
FEVV::PCLPointCloudPointMap::value_type value_type
FEVV::PCLPoint & reference
value_type operator[](key_type k) const
void set(key_type k, const FEVV::PCLColor &color)
boost::read_write_property_map_tag category
FEVV::PCLColor & reference
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
FEVV::PCLPointCloud * m_pc
FEVV::PCLPointCloudPointMap::reference reference
void put(FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key, const FEVV::PCLPointCloudPointMap::value_type &value)
Specialization of put(point_map, key, value) for PCLPointCloud.
boost::graph_traits< FEVV::PCLPointCloud >::vertex_descriptor key_type
Eigen::Vector3f PCLVector
Eigen::Matrix< PCLColorType, 3, 1 > PCLColor
boost::graph_traits< FEVV::PCLPointCloud >::vertex_descriptor key_type
std::unique_ptr< KdTree > KdTreePtr
FEVV::PCLPointCloud * m_pc
PCLPointCloudColorMap(FEVV::PCLPointCloud &pc)
FEVV::PCLPointCloudPointMap get(const boost::vertex_point_t, FEVV::PCLPointCloud &pc)
Returns the points property map (aka the geometry) of the mesh.
pcl::PointXYZRGBNormal PCLEnrichedPoint