gtsam_points
Loading...
Searching...
No Matches
normal_estimation.hpp
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2021 Kenji Koide (k.koide@aist.go.jp)
3
4#pragma once
5
6#include <vector>
7#include <Eigen/Core>
8#include <gtsam_points/types/point_cloud.hpp>
9
10namespace gtsam_points {
11
20std::vector<Eigen::Vector4d> estimate_normals(const Eigen::Vector4d* points, const Eigen::Matrix4d* covs, int num_points, int num_threads = 1);
21
30std::vector<Eigen::Vector4d> estimate_normals(const Eigen::Vector4d* points, int num_points, int k_neighbors = 10, int num_threads = 1);
31
32template <template <typename> typename Alloc>
33std::vector<Eigen::Vector4d> estimate_normals(
34 const std::vector<Eigen::Vector4d, Alloc<Eigen::Vector4d>>& points,
35 const std::vector<Eigen::Matrix4d, Alloc<Eigen::Matrix4d>>& covs,
36 int k_neighbors = 10,
37 int num_threads = 1) {
38 return estimate_normals(points.data(), covs.data(), points.size(), k_neighbors, num_threads);
39}
40
41template <typename Alloc>
42std::vector<Eigen::Vector4d> estimate_normals(const std::vector<Eigen::Vector4d, Alloc>& points, int k_neighbors = 10, int num_threads = 1) {
43 return estimate_normals(points.data(), points.size(), k_neighbors, num_threads);
44}
45
46std::vector<Eigen::Vector4d> estimate_normals(const PointCloud& points, int k_neighbors = 10, int num_threads = 1);
47
48} // namespace gtsam_points