|
4 | 4 | #include <nanobind/nanobind.h> |
5 | 5 | #include <nanobind/ndarray.h> |
6 | 6 |
|
7 | | - |
8 | 7 | #include <algorithm> |
9 | 8 | #include <cmath> |
10 | 9 | #include <cstdio> |
@@ -74,9 +73,10 @@ static inline void flush() { std::cout << std::endl; }; |
74 | 73 | * @return the geometric features associated with each point's neighborhood in a (num_points, features_count) nd::array. |
75 | 74 | */ |
76 | 75 | template <typename real_t = float, const size_t feature_count = 11> |
77 | | -static nb::ndarray<nb::numpy, real_t, nb::shape<-1, static_cast<nb::ssize_t>(feature_count)>> compute_geometric_features( |
78 | | - RefCloud<real_t> xyz, nb::ndarray<const uint32_t, nb::ndim<1>> nn, nb::ndarray<const uint32_t, nb::ndim<1>> nn_ptr, |
79 | | - const size_t k_min, const bool verbose) |
| 76 | +static nb::ndarray<nb::numpy, real_t, nb::shape<-1, static_cast<nb::ssize_t>(feature_count)>> |
| 77 | + compute_geometric_features( |
| 78 | + RefCloud<real_t> xyz, nb::ndarray<const uint32_t, nb::ndim<1>> nn, |
| 79 | + nb::ndarray<const uint32_t, nb::ndim<1>> nn_ptr, const size_t k_min, const bool verbose) |
80 | 80 | { |
81 | 81 | if (k_min < 1) { throw std::invalid_argument("k_min should be > 1"); } |
82 | 82 | // Each point can be treated in parallel |
@@ -330,7 +330,7 @@ static nb::ndarray<nb::numpy, real_t, nb::shape<-1, -1>> compute_geometric_featu |
330 | 330 | using kd_tree_t = nanoflann::KDTreeEigenMatrixAdaptor<RefCloud<real_t>, 3, nanoflann::metric_L2_Simple>; |
331 | 331 | // TODO: where knn < num of points |
332 | 332 |
|
333 | | - kd_tree_t kd_tree(3, xyz, 10); |
| 333 | + kd_tree_t kd_tree(3, xyz, 10, 0); |
334 | 334 | const size_t feature_count = selected_features.size(); |
335 | 335 | const Eigen::Index n_points = xyz.rows(); |
336 | 336 | real_t sq_search_radius = search_radius * search_radius; |
|
0 commit comments