DGtal 2.2.0
Loading...
Searching...
No Matches
DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder > Class Template Reference

Aim: Implements a functor to detect feature points from normal tensor voting strategy. More...

#include <DGtal/geometry/surfaces/estimation/estimationFunctors/TensorVotingFeatureExtraction.h>

Public Types

typedef TSurfel Surfel
typedef TEmbedder SCellEmbedder
typedef SCellEmbedder::RealPoint RealPoint
typedef double Quantity

Public Member Functions

 TensorVotingFeatureExtraction (ConstAlias< SCellEmbedder > anEmbedder, const double h)
void pushSurfel (const Surfel &aSurf, const double aDistance)
Quantity eval ()
void reset ()

Private Attributes

bool myFirstSurfel
 First surfel flag.
const SCellEmbedder * myEmbedder
 Alias of the geometrical embedder.
double myH
RealPoint myReceiver
 Receiver (embedding of the starting surfel).
SimpleMatrix< double, 3, 3 > myAccum
 Covariance accumulator.
SimpleMatrix< double, 3, 3 > myId
SimpleMatrix< double, 3, 3 > myVote
double myArea
 Convolution kernel area.

Detailed Description

template<typename TSurfel, typename TEmbedder>
class DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >

Aim: Implements a functor to detect feature points from normal tensor voting strategy.

Description of template class 'TensorVotingFeatureExtraction'

More precisely, the functor accumulates tensor votes \(I - vv^T/\|vv^T\|\) for each surfel added during the scan ( \(v\) being the vector from the center of the neighborhood to the added surfel). Then, the eval() method returns the ratio \(\frac{\lambda_1+\lambda_2}{\lambda_3}\) of the eigenvalues ( \( \lambda_1\leq\lambda_2\leq\lambda_3\)) of the accumulated tensor votes.

(see [94])

model of concepts::CLocalEstimatorFromSurfelFunctor

Template Parameters
TSurfeltype of surfels
TEmbeddertype of functors which embed surfel to \( \mathbb{R}^3\)

Definition at line 81 of file TensorVotingFeatureExtraction.h.

Member Typedef Documentation

◆ Quantity

template<typename TSurfel, typename TEmbedder>
typedef double DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::Quantity

Definition at line 88 of file TensorVotingFeatureExtraction.h.

◆ RealPoint

template<typename TSurfel, typename TEmbedder>
typedef SCellEmbedder::RealPoint DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::RealPoint

Definition at line 87 of file TensorVotingFeatureExtraction.h.

◆ SCellEmbedder

template<typename TSurfel, typename TEmbedder>
typedef TEmbedder DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::SCellEmbedder

Definition at line 86 of file TensorVotingFeatureExtraction.h.

◆ Surfel

template<typename TSurfel, typename TEmbedder>
typedef TSurfel DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::Surfel

Definition at line 85 of file TensorVotingFeatureExtraction.h.

Constructor & Destructor Documentation

◆ TensorVotingFeatureExtraction()

template<typename TSurfel, typename TEmbedder>
DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::TensorVotingFeatureExtraction ( ConstAlias< SCellEmbedder > anEmbedder,
const double h )
inline

Constructor.

Parameters
anEmbedderembedder to map surfel to R^n.
hgrid step

Definition at line 96 of file TensorVotingFeatureExtraction.h.

97 :
99 {
100 myId.identity();
101 myArea = 0.0;
102 myFirstSurfel = true;
103 myAccum.constant(0.0);
104 }
Aim: Implements a functor to detect feature points from normal tensor voting strategy.
const SCellEmbedder * myEmbedder
Alias of the geometrical embedder.
SimpleMatrix< double, 3, 3 > myAccum
Covariance accumulator.

References DGtal::SimpleMatrix< TComponent, TM, TN >::constant(), DGtal::SimpleMatrix< TComponent, TM, TN >::identity(), myAccum, myArea, myEmbedder, myFirstSurfel, myH, and myId.

Member Function Documentation

◆ eval()

template<typename TSurfel, typename TEmbedder>
Quantity DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::eval ( )
inline

Evaluate the feature score.

I.e. (l_1+l_2)/l_3 of the tensor eigenvalues (l_1<l_2<l_3).

Returns
the feature score

Definition at line 154 of file TensorVotingFeatureExtraction.h.

155 {
158
159 myAccum /= myArea;
161
162#ifdef DEBUG
163 for( Dimension i_dim = 1; i_dim < 3; ++i_dim )
165#endif
166
167 return ((eigenvalues[0] + eigenvalues[1])/(eigenvalues[2]));
168 }
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.

References DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition(), myAccum, and myArea.

◆ pushSurfel()

template<typename TSurfel, typename TEmbedder>
void DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::pushSurfel ( const Surfel & aSurf,
const double aDistance )
inline

Add the geometrical embedding of a surfel to the point list and update the tensor voting.

Parameters
aSurfa surfel to add
aDistancedistance of aSurf to the neighborhood boundary

Definition at line 113 of file TensorVotingFeatureExtraction.h.

115 {
116 if (myFirstSurfel)
117 {
118 myReceiver = myEmbedder->operator()(aSurf);
119 myFirstSurfel = false;
120 }
121 else
122 {
124 const RealPoint p = myEmbedder->operator()(aSurf);
125 const RealPoint v = p - myReceiver;
126
127 double maxcol = 0.0;
128 double matnorm = 0.0;
129
130 // I - vv^t/||vv^t||
131 for(DGtal::Dimension i= 0; i <3; i++)
132 {
133 maxcol = 0.0;
134 for(DGtal::Dimension j=0; j < 3; j++)
135 {
136 myVote.setComponent(i,j, v(i)*v(j));
137 if (std::abs(v(i)*v(j)) > maxcol)
138 maxcol = std::abs(v(i)*v(j));
139 }
140 matnorm += maxcol;
141 }
142
144 }
145 }
RealPoint myReceiver
Receiver (embedding of the starting surfel).

References myAccum, myArea, myEmbedder, myFirstSurfel, myId, myReceiver, myVote, and DGtal::SimpleMatrix< TComponent, TM, TN >::setComponent().

◆ reset()

template<typename TSurfel, typename TEmbedder>
void DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::reset ( )
inline

Reset the point list.

Definition at line 174 of file TensorVotingFeatureExtraction.h.

175 {
176 myArea = 0.0;
177 myFirstSurfel = true;
178 myAccum.constant(0.0);
179 }

References DGtal::SimpleMatrix< TComponent, TM, TN >::constant(), myAccum, myArea, and myFirstSurfel.

Field Documentation

◆ myAccum

template<typename TSurfel, typename TEmbedder>
SimpleMatrix<double, 3, 3> DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myAccum
private

Covariance accumulator.

Definition at line 197 of file TensorVotingFeatureExtraction.h.

Referenced by eval(), pushSurfel(), reset(), and TensorVotingFeatureExtraction().

◆ myArea

template<typename TSurfel, typename TEmbedder>
double DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myArea
private

Convolution kernel area.

Definition at line 200 of file TensorVotingFeatureExtraction.h.

Referenced by eval(), pushSurfel(), reset(), and TensorVotingFeatureExtraction().

◆ myEmbedder

template<typename TSurfel, typename TEmbedder>
const SCellEmbedder* DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myEmbedder
private

Alias of the geometrical embedder.

Definition at line 188 of file TensorVotingFeatureExtraction.h.

Referenced by pushSurfel(), and TensorVotingFeatureExtraction().

◆ myFirstSurfel

template<typename TSurfel, typename TEmbedder>
bool DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myFirstSurfel
private

First surfel flag.

Definition at line 185 of file TensorVotingFeatureExtraction.h.

Referenced by pushSurfel(), reset(), and TensorVotingFeatureExtraction().

◆ myH

template<typename TSurfel, typename TEmbedder>
double DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myH
private

Definition at line 191 of file TensorVotingFeatureExtraction.h.

Referenced by TensorVotingFeatureExtraction().

◆ myId

template<typename TSurfel, typename TEmbedder>
SimpleMatrix<double, 3, 3> DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myId
private

Definition at line 197 of file TensorVotingFeatureExtraction.h.

Referenced by pushSurfel(), and TensorVotingFeatureExtraction().

◆ myReceiver

template<typename TSurfel, typename TEmbedder>
RealPoint DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myReceiver
private

Receiver (embedding of the starting surfel).

Definition at line 194 of file TensorVotingFeatureExtraction.h.

Referenced by pushSurfel().

◆ myVote

template<typename TSurfel, typename TEmbedder>
SimpleMatrix<double, 3, 3> DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::myVote
private

Definition at line 197 of file TensorVotingFeatureExtraction.h.

Referenced by pushSurfel().


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