Helios++
Helios software for LiDAR simulations
PlaneFitter Class Reference

Handle plane fitting operations. More...

#include <PlaneFitter.h>

Public Member Functions

template<typename T >
std::vector< T > bestFittingPlaneOrthoNormal (Mat< T > &M, bool center)
 Compute the best fitting plane and its orto normal vector. More...
 

Static Public Member Functions

template<typename T >
static void centerCoordinatesMatrix (Mat< T > &M)
 Modify coordinates at matrix M so it is centered at originWaypoint. More...
 
template<typename T >
static vector< T > bestFittingPlaneOrthoNormal (Mat< T > &M, bool center=true)
 Compute the orthonormal of best fitting plane for given Matrix of coordinates. More...
 

Detailed Description

Handle plane fitting operations.

Author
Alberto M. Esmoris Pena
Version
1.0

Member Function Documentation

◆ bestFittingPlaneOrthoNormal() [1/2]

template<typename T >
std::vector<T> PlaneFitter::bestFittingPlaneOrthoNormal ( Mat< T > &  M,
bool  center 
)

Compute the best fitting plane and its orto normal vector.

Parameters
MMatrix which best fitting plane ortho normal shall be obtained
centerSpecify if the matrix must be centered (true) or not (false). To obtain best fitting plane for a given coordinates matrix using SVD, it is recommended to center the matrix of coordinates. Otherwise, unexpected outputs might be obtained.
Returns
Components of ortho normal vector of best fitting plane

◆ bestFittingPlaneOrthoNormal() [2/2]

template<typename T >
static vector<T> PlaneFitter::bestFittingPlaneOrthoNormal ( Mat< T > &  M,
bool  center = true 
)
static

Compute the orthonormal of best fitting plane for given Matrix of coordinates.

Best fitting plane orthonormal is computed through singular value decomposition

\[ M_{3_{x}n} = U_{3_{x}r} \Sigma_{r_{x}r} V^{T}_{r_{x}n} \]

Then \((U_{1_{x}3} , U_{2_{x}3} , U_{3_{x}3})\) it is the orthonormal of best fitting plane.

Template Parameters
TType of number
Parameters
MMatrix of coordinates. Following format is mandatory:
M[0] := Row with X coordinates
M[1] := Row with Y coordinates
M[2] := Row with Z coordinates
centerIf true, then coordinates will be translated to have originWaypoint as center. Otherwise, they will used as they come.
NOTICE reliable orthonormal computation requires coordinates to be centered at originWaypoint. Hence, center should only be setted to False when input matrix is already centered.
Returns
Orthonormal of best fitting plane

◆ centerCoordinatesMatrix()

template<typename T >
void PlaneFitter::centerCoordinatesMatrix ( Mat< T > &  M)
static

Modify coordinates at matrix M so it is centered at originWaypoint.

Center given coordinates matrix to 0 (origin)

Template Parameters
TType of number
Parameters
MMatrix of coordinates. Following format is mandatory:
M[0] := Row with X coordinates
M[1] := Row with Y coordinates
M[2] := Row with Z coordinates
MMatrix of coordinates to be centered

The documentation for this class was generated from the following file: