Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef PCL_KDTREE_IO_IMPL_HPP_
00041 #define PCL_KDTREE_IO_IMPL_HPP_
00042
00043 #include <pcl/kdtree/io.h>
00044 #include <pcl/kdtree/kdtree_flann.h>
00045
00047 template <typename Point1T, typename Point2T> void
00048 pcl::getApproximateIndices (
00049 const typename pcl::PointCloud<Point1T>::Ptr &cloud_in,
00050 const typename pcl::PointCloud<Point2T>::Ptr &cloud_ref,
00051 std::vector<int> &indices)
00052 {
00053 pcl::KdTreeFLANN<Point2T> tree;
00054 tree.setInputCloud (cloud_ref);
00055
00056 std::vector<int> nn_idx (1);
00057 std::vector<float> nn_dists (1);
00058 indices.resize (cloud_in->points.size ());
00059 for (size_t i = 0; i < cloud_in->points.size (); ++i)
00060 {
00061 tree.nearestKSearch (*cloud_in, i, 1, nn_idx, nn_dists);
00062 indices[i] = nn_idx[0];
00063 }
00064 }
00065
00067 template <typename PointT> void
00068 pcl::getApproximateIndices (
00069 const typename pcl::PointCloud<PointT>::Ptr &cloud_in,
00070 const typename pcl::PointCloud<PointT>::Ptr &cloud_ref,
00071 std::vector<int> &indices)
00072 {
00073 pcl::KdTreeFLANN<PointT> tree;
00074 tree.setInputCloud (cloud_ref);
00075
00076 std::vector<int> nn_idx (1);
00077 std::vector<float> nn_dists (1);
00078 indices.resize (cloud_in->points.size ());
00079 for (size_t i = 0; i < cloud_in->points.size (); ++i)
00080 {
00081 tree.nearestKSearch (*cloud_in, i, 1, nn_idx, nn_dists);
00082 indices[i] = nn_idx[0];
00083 }
00084 }
00085
00086 #endif // PCL_KDTREE_IO_IMPL_H_
00087