1 #ifndef _SURFACEINSPECTOR_MATHS_SINGULARCONTEXTCOMPUTER_HPP_
2 #define _SURFACEINSPECTOR_MATHS_SINGULARCONTEXTCOMPUTER_HPP_
7 #include <util/Object.hpp>
8 #include <maths/SingularContextDescriptors.hpp>
16 namespace SurfaceInspector {
namespace maths{
110 template <
typename T>
200 {
init(
true,
true, 1, 1, 1, 1);}
274 vector<size_t>
alpha(arma::vec
const &v,
size_t const a)
const;
281 vector<size_t>
beta(arma::vec
const &v,
size_t const b)
const;
291 vector<size_t> indices
429 #include <maths/SingularContextComputer.tpp>
Handle singular context descriptors computation.
Definition: SingularContextComputer.hpp:111
vector< size_t > beta(arma::vec const &v, size_t const b) const
Extract indices for maximum values of .
bool normalizeFlag
Flag which specifies if the singular context computer must normalize when computing descriptors (true...
Definition: SingularContextComputer.hpp:119
void init(bool normalize, bool center, size_t aWorst, size_t aBest, size_t bWorst, size_t bBest)
Initialize the singular context computer.
void normalizeGdCd(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are GdCd (Ground-distance and Ceiling-distanc...
vector< T > deltaNorm
Definition: SingularContextComputer.hpp:191
void normalizeHSO(Mat< T > &M) const
Normalize given matrix assuming each first 3 components are HSO (Horizontality, Sum and Omnivariance)...
size_t bBest
How many maximum values consider when computing the function for the best fitting vector.
Definition: SingularContextComputer.hpp:144
void normalizeLP(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are LP (Linearity and Planarity)
void normalizeVR(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are VR (Verticality and Roughness)
void normalizeVC(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are VC (Verticality and Curvature)
SingularContextComputer(bool normalize, bool center)
Non default constructor for singular context computer.
Definition: SingularContextComputer.hpp:205
void normalizePC(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are PC (Planarity and Curvature)
SingularContextDescriptors< T > describe(Mat< T > &M) const
Obtain singular context descriptors from given matrix.
vector< T > extractComponents(arma::vec const &v, vector< size_t > indices) const
Extract components of given vector corresponding to given indices.
void centerDefault(Mat< T > &M) const
Center given matrix by default criteria.
SingularContextComputer(bool normalize, bool center, size_t aWorst, size_t aBest, size_t bWorst, size_t bBest)
Non default constructor for singular context computer.
Definition: SingularContextComputer.hpp:222
void normalizeSO(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are SO (Sum and Omnivariance)
void normalizeLC(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are LC (Linearity and Curvature)
void normalizeHLI(Mat< T > &M) const
Normalize given matrix assuming each first 3 components are HLI (Horizontality, Linearity and Intensi...
void(SingularContextComputer< T >::* normalize)(Mat< T > &M) const
Function which normalizes the matrix if necessary. A default implementation is provided as the normal...
Definition: SingularContextComputer.hpp:160
vector< T > aNorm
The vector must contain the start of normalization interval if the normalization strategy requires i...
Definition: SingularContextComputer.hpp:178
void normalizeGdCdI(Mat< T > &M) const
Normalize given matrix assuming each first 3 components are GdCdI (Ground-distance,...
void(SingularContextComputer< T >::* center)(Mat< T > &M) const
Function which centers the matrix if necessary. A default implementation is provided as the centerDef...
Definition: SingularContextComputer.hpp:170
size_t aWorst
How many minimum values consider when computing the function for the worst fitting vector.
Definition: SingularContextComputer.hpp:129
void normalizeCone(Mat< T > &M) const
Normalize given matrix assuming (X,Y,Z) components for a cone.
SingularContextComputer()
Default constructor for singular context computer.
Definition: SingularContextComputer.hpp:199
vector< T > bNorm
The vector must contain the end of normalization interval if the normalization strategy requires it.
Definition: SingularContextComputer.hpp:185
size_t aBest
How many minimum values consider when computing the function for the best fitting vector.
Definition: SingularContextComputer.hpp:134
void configureNorm(vector< T > const &a, vector< T > const &b)
Configure normalization vectors from given ones.
size_t bWorst
How many minimum values consider when computing the function for the worst fitting vector.
Definition: SingularContextComputer.hpp:139
void configureNorm(vector< vector< T >> const &X)
Configure normalization vectors from given matrix.
void normalizeHyperbolicParaboloid(Mat< T > &M) const
Normalize given matrix assuming (X,Y,Z) components for a hyperbolic paraboloid.
void normalizeRGB(Mat< T > &M) const
Normalize given matrix assuming each first 3 components are RGB so they must be inside interval.
bool absoluteComponents
Specify if use absolute values of the singular vector components (true) or consider their signed vers...
Definition: SingularContextComputer.hpp:150
SingularContextComputer(size_t aWorst, size_t aBest, size_t bWorst, size_t bBest)
Non default constructor for singular context computer.
Definition: SingularContextComputer.hpp:211
vector< size_t > alpha(arma::vec const &v, size_t const a) const
Extract indices for minimum values of .
void normalizeHV(Mat< T > &M) const
Normalize given matrix assuming each first 2 components are HV (Horizontality and Verticality)
bool centerFlag
Flag which specifies if the singular context computer must center when computing descriptors (true) o...
Definition: SingularContextComputer.hpp:124
void normalizeDefault(Mat< T > &M) const
Normalize given matrix by default criteria.
Class representing singular context descriptors.
Definition: SingularContextDescriptors.hpp:20
Class representing an object. All surface inspector classes must extend Object.
Definition: Object.hpp:12