Ponca  bab7704293a2c36e5bed9dea40def7ba839bfe08
Point Cloud Analysis library
Loading...
Searching...
No Matches
sphereFit.h
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3License, v. 2.0. If a copy of the MPL was not distributed with this
4file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "./algebraicSphere.h"
10
11namespace Ponca
12{
13
56 template <class DataPoint, class _NFilter, typename T>
57 class SphereFitImpl : public T
58 {
59 PONCA_FITTING_DECLARE_DEFAULT_TYPES
60
61 protected:
62 enum
63 {
64 Check = Base::PROVIDES_ALGEBRAIC_SPHERE
65 };
66
67 protected:
68 typedef Eigen::Matrix<Scalar, DataPoint::Dim + 2, 1> VectorA;
69 typedef Eigen::Matrix<Scalar, DataPoint::Dim + 2, DataPoint::Dim + 2> MatrixA;
70
71 public:
72 using Solver = Eigen::EigenSolver<MatrixA>;
73
74 protected:
75 // computation data
76 MatrixA m_matA{MatrixA::Zero()};
78 Solver m_solver;
79
80 public:
81 PONCA_EXPLICIT_CAST_OPERATORS(SphereFitImpl, sphereFit)
82 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
83 PONCA_FITTING_IS_SIGNED(false)
84
85 PONCA_MULTIARCH inline const Solver& solver() const { return m_solver; }
86
87 }; // class SphereFit
88
90 template <class DataPoint, class _NFilter, typename T>
92
93#include "sphereFit.hpp"
94
95} // namespace Ponca
Algebraic Sphere fitting procedure on point set without normals.
Definition sphereFit.h:58
MatrixA m_matA
Covariance matrix of [1, p, p^2].
Definition sphereFit.h:76
SphereFitImpl< DataPoint, _NFilter, T > & sphereFit()
Explicit conversion to SphereFitImpl , to access methods potentially hidden by heritage.
Definition sphereFit.h:81
This Source Code Form is subject to the terms of the Mozilla Public License, v.