10#include "../../defines.h"
11#include "../concepts.h"
13#include "../primitive/linePrimitive.h"
14#include "../tools/mean.h"
15#include "../tools/covariance.h"
19#define COVARIANCE_LINE_FIT_REQUIREMENTS ProvidesPositionCovariance<T>&& ProvidesLine<T>
37 template <
class DataPo
int,
class _NFilter,
typename T>
38 requires COVARIANCE_LINE_FIT_REQUIREMENTS
41 PONCA_FITTING_DECLARE_DEFAULT_TYPES
42 PONCA_FITTING_DECLARE_MATRIX_TYPE
46 PONCA_FITTING_APIDOC_FINALIZE
49 static const int smallestEigenValue = DataPoint::Dim - 1;
50 if (Base::finalize() ==
STABLE)
52 if (Base::line().isValid())
54 Base::setLine(Base::barycenterLocal(),
55 Base::m_solver.eigenvectors().col(smallestEigenValue).normalized());
57 return Base::m_eCurrentState;
59 PONCA_FITTING_IS_SIGNED(
false)
63 template <
class DataPo
int,
class _NFilter,
typename T>
Procedure that compute and decompose the covariance matrix of the neighbors positions.
Line fitting procedure that minimize the orthogonal distance between the samples and the fitted primi...
CovarianceLineFitImpl< DataPoint, _NFilter, T > & covarianceLineFit()
This Source Code Form is subject to the terms of the Mozilla Public License, v.
CovarianceLineFitImpl< DataPoint, _NFilter, CovarianceBase< DataPoint, _NFilter, MeanPosition< DataPoint, _NFilter, Line< DataPoint, _NFilter, T > > > > CovarianceLineFit
Helper alias for Line fitting on 3D points using CovarianceLineFitImpl.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns).
@ CONFLICT_ERROR_FOUND
Multiple classes of the fitting procedure initialize the primitive.
@ STABLE
The fitting is stable and ready to use.