Ponca  045d6c276f3af384cb0ea094d76ed661278a034a
Point Cloud Analysis library
Loading...
Searching...
No Matches
curvatureEstimation.h
1/*
2 This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "./defines.h"
10
11namespace Ponca
12{
21 template < class DataPoint, class _WFunctor, int DiffType, typename T>
23 {
24 PONCA_FITTING_DECLARE_DEFAULT_TYPES
25 PONCA_FITTING_DECLARE_MATRIX_TYPE
26
27 protected:
28 enum
29 {
30 Check = Base::PROVIDES_NORMAL_DERIVATIVE && Base::PROVIDES_PRINCIPAL_CURVATURES
31 };
32
33 private:
34 typedef Eigen::Matrix<Scalar,3,2> Mat32;
35 typedef Eigen::Matrix<Scalar,2,2> Mat22;
37 public:
39 PONCA_FITTING_DECLARE_FINALIZE
40
41 private:
47 PONCA_MULTIARCH inline FIT_RESULT computeCurvature(bool useNormal = false);
48
49 protected:
55 PONCA_MULTIARCH inline Mat32 tangentPlane(bool useNormal = false) const;
56 };
57
58
74template < class DataPoint, class _WFunctor, int DiffType, typename T>
76{
77PONCA_FITTING_DECLARE_DEFAULT_TYPES
78PONCA_FITTING_DECLARE_MATRIX_TYPE
79PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
80
81protected:
82 enum
83 {
84 Check = Base::PROVIDES_PRINCIPAL_CURVATURES
85 };
86
87 //TODO(thib) check the curvature values that might be wrong
88 //TODO(thib) use weighting function
89 //TODO(thib) which eigenvectors should be selected ? extreme of maximal ?
90
91public:
93 typedef Eigen::SelfAdjointEigenSolver<MatrixType> Solver;
94
95protected:
100public:
102 PONCA_FITTING_DECLARE_INIT_ADDDER_FINALIZE
103};
104
105
121template < class DataPoint, class _WFunctor, int DiffType, typename T>
123{
124 //TODO(thib) check the curvature values that might be wrong
125 //TODO(thib) use weighting function
126
127PONCA_FITTING_DECLARE_DEFAULT_TYPES
128PONCA_FITTING_DECLARE_MATRIX_TYPE
129PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
130
131protected:
132 enum
133 {
134 Check = Base::PROVIDES_PRINCIPAL_CURVATURES &&
135 Base::PROVIDES_PLANE // \todo This class relies on the primitiveGradient, so update this
136 };
137
139 enum PASS : int
140 {
141 FIRST_PASS = 0,
142 SECOND_PASS,
143 PASS_COUNT
144 };
145
146public:
147 //TODO(thib) use of Eigen::RowAtCompileTime-1 ?
148 typedef Eigen::Matrix<Scalar,2,2> Mat22;
149 typedef Eigen::Matrix<Scalar,3,2> Mat32;
150 typedef Eigen::Matrix<Scalar,2,1> Vector2;
151 typedef typename VectorType::Index Index;
153 typedef Eigen::SelfAdjointEigenSolver<Mat22> Solver;
154
155protected:
156 Vector2 m_cog;
157 Mat22 m_cov;
160 Mat32 m_tframe;
162public:
164 PONCA_FITTING_DECLARE_INIT_ADDDER_FINALIZE
165};
166
167#include "curvatureEstimation.hpp"
168
169} //namespace Ponca
Extension to compute curvature values based on a covariance analysis of normal vectors of neighbors.
NormalCovarianceCurvatureEstimator< DataPoint, _WFunctor, DiffType, T > & normalCovarianceCurvatureEstimator()
Explicit conversion to NormalCovarianceCurvatureEstimator , to access methods potentially hidden by h...
MatrixType m_cov
Covariance matrix of the normal vectors.
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
Solver m_solver
Solver used to analyse the covariance matrix.
typename Base::VectorType VectorType
Alias to vector type.
Eigen::SelfAdjointEigenSolver< MatrixType > Solver
Solver used to analyse the covariance matrix.
VectorType m_cog
Gravity center of the normal vectors.
Extension to compute curvature values from the Weingarten map .
Mat32 tangentPlane(bool useNormal=false) const
Compute a tangent plane basis.
NormalDerivativesCurvatureEstimator< DataPoint, _WFunctor, DiffType, T > & normalDerivativesCurvatureEstimator()
Explicit conversion to NormalDerivativesCurvatureEstimator , to access methods potentially hidden by ...
Extension to compute curvature values based on a covariance analysis of normal vectors of neighbors p...
Solver m_solver
Solver used to analyse the covariance matrix.
Eigen::SelfAdjointEigenSolver< Mat22 > Solver
Solver used to analyse the covariance matrix.
ProjectedNormalCovarianceCurvatureEstimator< DataPoint, _WFunctor, DiffType, T > & projectedNormalCovarianceCurvature()
Explicit conversion to ProjectedNormalCovarianceCurvatureEstimator , to access methods potentially hi...
This Source Code Form is subject to the terms of the Mozilla Public License, v.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
Definition: enums.h:15