Helios++
Helios software for LiDAR simulations
|
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... | |
Handle plane fitting operations.
|
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.
T | Type of number |
M | Matrix of coordinates. Following format is mandatory: M[0] := Row with X coordinates M[1] := Row with Y coordinates M[2] := Row with Z coordinates |
center | If 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. |
std::vector<T> PlaneFitter::bestFittingPlaneOrthoNormal | ( | Mat< T > & | M, |
bool | center | ||
) |
Compute the best fitting plane and its orto normal vector.
M | Matrix which best fitting plane ortho normal shall be obtained |
center | Specify 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. |
|
static |
Modify coordinates at matrix M so it is centered at originWaypoint.
Center given coordinates matrix to 0 (origin)
T | Type of number |
M | Matrix of coordinates. Following format is mandatory: M[0] := Row with X coordinates M[1] := Row with Y coordinates M[2] := Row with Z coordinates |
M | Matrix of coordinates to be centered |