![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include "TreeIso.h"#include "TreeIsoHelper.h"#include <ecvMainAppInterface.h>#include <ecvQtHelpers.h>#include <ecvPointCloud.h>#include <QCoreApplication>#include <QElapsedTimer>#include <QProgressDialog>#include <cmath>#include <fstream>#include <iomanip>#include <iostream>#include <sstream>#include <boost/geometry.hpp>#include <boost/geometry/geometries/point_xy.hpp>#include <boost/geometry/geometries/polygon.hpp>
Go to the source code of this file.
Typedefs | |
| typedef boost::geometry::model::d2::point_xy< double > | point_xy |
| typedef boost::geometry::model::polygon< point_xy > | polygon |
| typedef boost::geometry::model::multi_point< point_xy > | multi_point |
| typedef boost::geometry::model::multi_polygon< polygon > | multi_polygon |
| typedef std::vector< float > | Vec3d |
Functions | |
| template<class result_t = std::chrono::milliseconds, class clock_t = std::chrono::steady_clock, class duration_t = std::chrono::milliseconds> | |
| static auto | Since (std::chrono::time_point< clock_t, duration_t > const &start) |
| void | knn_cpp_build (knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> &kdtree, unsigned n_thread) |
| void | knn_cpp_query (knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> &kdtree, Eigen::MatrixXf &query_points, size_t k, std::vector< std::vector< size_t >> &res_idx, std::vector< Vec3d > &res_dists) |
| float | knn_cpp_query_min_d (knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> &kdtree, Eigen::MatrixXf &query_points, size_t k) |
| void | knn_cpp_nearest_neighbors (const std::vector< Vec3d > &dataset, size_t k, std::vector< std::vector< uint32_t >> &res_idx, std::vector< Vec3d > &res_dists, unsigned n_thread) |
| template<typename T > | |
| void | unique_group (std::vector< T > &arr, std::vector< std::vector< T >> &u_group, std::vector< T > &arr_unq, std::vector< T > &ui) |
| template<typename T > | |
| void | unique_group (std::vector< T > &arr, std::vector< std::vector< T >> &u_group, std::vector< T > &arr_unq) |
| template<typename T > | |
| void | unique_group (std::vector< T > &arr, std::vector< std::vector< T >> &u_group) |
| template<typename T1 , typename T2 > | |
| void | get_subset (std::vector< T1 > &arr, std::vector< T2 > &indices, std::vector< T1 > &arr_sub) |
| template<typename T1 , typename T2 > | |
| void | get_subset (const std::vector< std::vector< T1 >> &arr, const std::vector< T2 > &indices, Eigen::MatrixXf &arr_sub) |
| template<typename T1 , typename T2 > | |
| void | get_subset (const std::vector< std::vector< T1 >> &arr, const std::vector< T2 > &indices, std::vector< std::vector< T1 >> &arr_sub) |
| template<typename T1 , typename T2 > | |
| bool | get_subset (ccPointCloud *pcd, std::vector< T2 > &indices, std::vector< std::vector< T1 >> &arr_sub) |
| template<typename T > | |
| void | toTranslatedVector (const ccPointCloud *pc, std::vector< std::vector< T >> &y) |
| bool | perform_cut_pursuit (const uint32_t K, const float regStrength, const std::vector< Vec3d > &pc, std::vector< float > &edgeWeight, std::vector< uint32_t > &Eu, std::vector< uint32_t > &Ev, std::vector< uint32_t > &in_component, std::vector< std::vector< uint32_t >> &components) |
| void | perform_cut_pursuit2d (const uint32_t K, const float regStrength, const std::vector< Vec3d > &pc_vec, Vec3d &edgeWeight, std::vector< uint32_t > &Eu, std::vector< uint32_t > &Ev, std::vector< uint32_t > &in_component) |
| template<typename T > | |
| size_t | arg_min_col (std::vector< T > &arr) |
| template<typename T > | |
| size_t | arg_max_col (std::vector< T > &arr) |
| template<typename T > | |
| void | min_col (std::vector< std::vector< T >> &arr, std::vector< T > &min_vals) |
| template<typename T > | |
| T | min_col (std::vector< T > &arr) |
| template<typename T > | |
| T | mean_col (std::vector< T > &arr) |
| template<typename T > | |
| T | median_col (std::vector< T > &arr) |
| template<typename T > | |
| T | mode_col (std::vector< T > &arr) |
| template<typename T > | |
| void | max_col (std::vector< std::vector< T >> &arr, std::vector< T > &max_vals) |
| template<typename T > | |
| void | mean_col (std::vector< std::vector< T >> &arr, std::vector< T > &mean_vals) |
| template<typename T > | |
| void | decimate_vec (std::vector< std::vector< T >> &arr, T res, std::vector< std::vector< T >> &vec_dec) |
| template<typename T > | |
| void | sort_indexes_by_row (std::vector< std::vector< T >> &v, std::vector< size_t > &idx, std::vector< std::vector< T >> &v_sorted) |
| template<typename ValueType , typename IndexType > | |
| void | sort_indexes (std::vector< ValueType > &v, std::vector< IndexType > &idx, std::vector< ValueType > &v_sorted) |
| template<typename T > | |
| void | unique_index_by_rows (std::vector< std::vector< T >> &arr, std::vector< size_t > &ia, std::vector< size_t > &ic) |
Variables | |
| static const char | InitSegsSFName [] = "init_segs" |
| static const char | IntermedSegsSFName [] = "intermediate_segs" |
| static const char | FinalSegsSFName [] = "final_segs" |
| typedef boost::geometry::model::multi_point<point_xy> multi_point |
Definition at line 38 of file TreeIso.cpp.
| typedef boost::geometry::model::multi_polygon<polygon> multi_polygon |
Definition at line 39 of file TreeIso.cpp.
| typedef boost::geometry::model::d2::point_xy<double> point_xy |
Definition at line 36 of file TreeIso.cpp.
Definition at line 37 of file TreeIso.cpp.
| typedef std::vector<float> Vec3d |
Definition at line 41 of file TreeIso.cpp.
| size_t arg_max_col | ( | std::vector< T > & | arr | ) |
Definition at line 1393 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
| size_t arg_min_col | ( | std::vector< T > & | arr | ) |
Definition at line 1386 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
| void decimate_vec | ( | std::vector< std::vector< T >> & | arr, |
| T | res, | ||
| std::vector< std::vector< T >> & | vec_dec | ||
| ) |
Definition at line 1501 of file TreeIso.cpp.
References cloudViewer::utility::floor(), and min_col().
Referenced by TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| bool get_subset | ( | ccPointCloud * | pcd, |
| std::vector< T2 > & | indices, | ||
| std::vector< std::vector< T1 >> & | arr_sub | ||
| ) |
Definition at line 1201 of file TreeIso.cpp.
References cloudViewer::PointCloudTpl< T >::getPoint(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
| void get_subset | ( | const std::vector< std::vector< T1 >> & | arr, |
| const std::vector< T2 > & | indices, | ||
| Eigen::MatrixXf & | arr_sub | ||
| ) |
Definition at line 1165 of file TreeIso.cpp.
References size.
| void get_subset | ( | const std::vector< std::vector< T1 >> & | arr, |
| const std::vector< T2 > & | indices, | ||
| std::vector< std::vector< T1 >> & | arr_sub | ||
| ) |
Definition at line 1185 of file TreeIso.cpp.
| void get_subset | ( | std::vector< T1 > & | arr, |
| std::vector< T2 > & | indices, | ||
| std::vector< T1 > & | arr_sub | ||
| ) |
Definition at line 1155 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| void knn_cpp_build | ( | knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> & | kdtree, |
| unsigned | n_thread | ||
| ) |
Definition at line 947 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| void knn_cpp_nearest_neighbors | ( | const std::vector< Vec3d > & | dataset, |
| size_t | k, | ||
| std::vector< std::vector< uint32_t >> & | res_idx, | ||
| std::vector< Vec3d > & | res_dists, | ||
| unsigned | n_thread | ||
| ) |
Definition at line 995 of file TreeIso.cpp.
References knncpp::KDTreeMinkowski< _Scalar, _Dimension, _Distance >::build(), knncpp::KDTreeMinkowski< _Scalar, _Dimension, _Distance >::query(), knncpp::KDTreeMinkowski< _Scalar, _Dimension, _Distance >::setBucketSize(), knncpp::KDTreeMinkowski< _Scalar, _Dimension, _Distance >::setSorted(), knncpp::KDTreeMinkowski< _Scalar, _Dimension, _Distance >::setThreads(), and size.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Intermediate_seg_pcd(), perform_cut_pursuit(), and perform_cut_pursuit2d().
| void knn_cpp_query | ( | knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> & | kdtree, |
| Eigen::MatrixXf & | query_points, | ||
| size_t | k, | ||
| std::vector< std::vector< size_t >> & | res_idx, | ||
| std::vector< Vec3d > & | res_dists | ||
| ) |
Definition at line 957 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
| float knn_cpp_query_min_d | ( | knncpp::KDTreeMinkowskiX< float, knncpp::EuclideanDistance< float >> & | kdtree, |
| Eigen::MatrixXf & | query_points, | ||
| size_t | k | ||
| ) |
Definition at line 983 of file TreeIso.cpp.
Referenced by TreeIso::Intermediate_seg_pcd().
| void max_col | ( | std::vector< std::vector< T >> & | arr, |
| std::vector< T > & | max_vals | ||
| ) |
Definition at line 1464 of file TreeIso.cpp.
References max().
Referenced by TreeIso::Final_seg_pcd().
| void mean_col | ( | std::vector< std::vector< T >> & | arr, |
| std::vector< T > & | mean_vals | ||
| ) |
Definition at line 1480 of file TreeIso.cpp.
References size.
| T mean_col | ( | std::vector< T > & | arr | ) |
Definition at line 1423 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Intermediate_seg_pcd(), and toTranslatedVector().
| T median_col | ( | std::vector< T > & | arr | ) |
Definition at line 1437 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
| void min_col | ( | std::vector< std::vector< T >> & | arr, |
| std::vector< T > & | min_vals | ||
| ) |
Definition at line 1400 of file TreeIso.cpp.
References min().
Referenced by decimate_vec(), and TreeIso::Final_seg_pcd().
| T min_col | ( | std::vector< T > & | arr | ) |
Definition at line 1416 of file TreeIso.cpp.
References result.
| T mode_col | ( | std::vector< T > & | arr | ) |
Definition at line 1453 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
| bool perform_cut_pursuit | ( | const uint32_t | K, |
| const float | regStrength, | ||
| const std::vector< Vec3d > & | pc, | ||
| std::vector< float > & | edgeWeight, | ||
| std::vector< uint32_t > & | Eu, | ||
| std::vector< uint32_t > & | Ev, | ||
| std::vector< uint32_t > & | in_component, | ||
| std::vector< std::vector< uint32_t >> & | components | ||
| ) |
Definition at line 1245 of file TreeIso.cpp.
References knn_cpp_nearest_neighbors().
Referenced by TreeIso::Init_seg_pcd().
| void perform_cut_pursuit2d | ( | const uint32_t | K, |
| const float | regStrength, | ||
| const std::vector< Vec3d > & | pc_vec, | ||
| Vec3d & | edgeWeight, | ||
| std::vector< uint32_t > & | Eu, | ||
| std::vector< uint32_t > & | Ev, | ||
| std::vector< uint32_t > & | in_component | ||
| ) |
Definition at line 1319 of file TreeIso.cpp.
References knn_cpp_nearest_neighbors().
Referenced by TreeIso::Intermediate_seg_pcd().
|
static |
Definition at line 54 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| void sort_indexes | ( | std::vector< ValueType > & | v, |
| std::vector< IndexType > & | idx, | ||
| std::vector< ValueType > & | v_sorted | ||
| ) |
Definition at line 1576 of file TreeIso.cpp.
Referenced by TreeIso::Intermediate_seg_pcd(), and unique_group().
| void sort_indexes_by_row | ( | std::vector< std::vector< T >> & | v, |
| std::vector< size_t > & | idx, | ||
| std::vector< std::vector< T >> & | v_sorted | ||
| ) |
Definition at line 1531 of file TreeIso.cpp.
Referenced by unique_index_by_rows().
| void toTranslatedVector | ( | const ccPointCloud * | pc, |
| std::vector< std::vector< T >> & | y | ||
| ) |
Definition at line 1218 of file TreeIso.cpp.
References cloudViewer::PointCloudTpl< T >::getPoint(), mean_col(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| void unique_group | ( | std::vector< T > & | arr, |
| std::vector< std::vector< T >> & | u_group | ||
| ) |
Definition at line 1120 of file TreeIso.cpp.
References sort_indexes().
| void unique_group | ( | std::vector< T > & | arr, |
| std::vector< std::vector< T >> & | u_group, | ||
| std::vector< T > & | arr_unq | ||
| ) |
Definition at line 1079 of file TreeIso.cpp.
References sort_indexes().
| void unique_group | ( | std::vector< T > & | arr, |
| std::vector< std::vector< T >> & | u_group, | ||
| std::vector< T > & | arr_unq, | ||
| std::vector< T > & | ui | ||
| ) |
Definition at line 1034 of file TreeIso.cpp.
References sort_indexes().
Referenced by TreeIso::Final_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
| void unique_index_by_rows | ( | std::vector< std::vector< T >> & | arr, |
| std::vector< size_t > & | ia, | ||
| std::vector< size_t > & | ic | ||
| ) |
Definition at line 1601 of file TreeIso.cpp.
References sort_indexes_by_row().
Referenced by TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
|
static |
Definition at line 49 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd().
|
static |
Definition at line 47 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), TreeIso::Init_seg_pcd(), and TreeIso::Intermediate_seg_pcd().
|
static |
Definition at line 48 of file TreeIso.cpp.
Referenced by TreeIso::Final_seg_pcd(), and TreeIso::Intermediate_seg_pcd().