This class provides a strategy to estimate the overlap percentage of two range maps/point clouds. More...
#include <overlap_estimation.h>
Classes | |
class | Parameters |
Public class to hold parameters. Used to avoid endless list of parameters inside functions. More... | |
class | VertexPointerSampler |
Public Types | |
typedef MeshType::CoordType | CoordType |
typedef MeshType::FaceType | FaceType |
typedef tri::VertTmark< MeshType > | MarkerVertex |
typedef GridStaticPtr < VertexType, ScalarType > | MeshGrid |
typedef MESH_TYPE | MeshType |
typedef MeshType::ScalarType | ScalarType |
typedef MeshType::VertexIterator | VertexIterator |
typedef MeshType::VertexPointer | VertexPointer |
typedef vector< VertexPointer > ::iterator | VertexPointerIterator |
typedef MeshType::VertexType | VertexType |
Public Member Functions | |
int | Check (Parameters ¶m) |
float | Compute (Parameters ¶m) |
bool | Init (Parameters ¶m) |
OverlapEstimation () | |
void | Paint () |
void | SetFix (MeshType &m) |
void | SetMove (MeshType &m) |
~OverlapEstimation () | |
Private Member Functions | |
vector< vector< int > > * | BucketVertexNormal (typename MESH_TYPE::VertContainer &vert, int bucketDim=30) |
bool | SampleVertNormalEqualized (vector< typename MESH_TYPE::VertexPointer > &vert, int SampleNum) |
void | SampleVertUniform (MESH_TYPE &m, vector< typename MESH_TYPE::VertexPointer > &vert, int sampleNum) |
void | SetupGrid () |
Static Private Member Functions | |
static int | LocRnd (int n) |
static math::SubtractiveRingRNG & | LocRnd () |
Private Attributes | |
MeshGrid * | gridFix |
MarkerVertex | markerFunctorFix |
MeshType * | mFix |
MeshType * | mMov |
vector< vector< int > > * | normBuckets |
This class provides a strategy to estimate the overlap percentage of two range maps/point clouds.
This class can be used, for exemple, into an automatic alignment process to check the quality of the transformation found; the idea is that bad alignments should have a small overlap. Two points are considered 'overlapping in the righ way' if they are close (i.e distance is less then consensusDist
) and at the same time points' normals match quite well (i.e the angle between them is less then consensusNormalsAngle
). The test to compute the overlap is perfomed on a given number of points (2500 is the default) sampled in a normal equalized way (default) or uniformly.
Definition at line 48 of file overlap_estimation.h.
typedef MeshType::CoordType OverlapEstimation< MESH_TYPE >::CoordType |
Definition at line 54 of file overlap_estimation.h.
typedef MeshType::FaceType OverlapEstimation< MESH_TYPE >::FaceType |
Definition at line 56 of file overlap_estimation.h.
typedef tri::VertTmark<MeshType> OverlapEstimation< MESH_TYPE >::MarkerVertex |
Definition at line 61 of file overlap_estimation.h.
typedef GridStaticPtr<VertexType, ScalarType > OverlapEstimation< MESH_TYPE >::MeshGrid |
Definition at line 60 of file overlap_estimation.h.
typedef MESH_TYPE OverlapEstimation< MESH_TYPE >::MeshType |
Definition at line 52 of file overlap_estimation.h.
typedef MeshType::ScalarType OverlapEstimation< MESH_TYPE >::ScalarType |
Definition at line 53 of file overlap_estimation.h.
typedef MeshType::VertexIterator OverlapEstimation< MESH_TYPE >::VertexIterator |
Definition at line 58 of file overlap_estimation.h.
typedef MeshType::VertexPointer OverlapEstimation< MESH_TYPE >::VertexPointer |
Definition at line 57 of file overlap_estimation.h.
typedef vector<VertexPointer>::iterator OverlapEstimation< MESH_TYPE >::VertexPointerIterator |
Definition at line 59 of file overlap_estimation.h.
typedef MeshType::VertexType OverlapEstimation< MESH_TYPE >::VertexType |
Definition at line 55 of file overlap_estimation.h.
OverlapEstimation< MESH_TYPE >::OverlapEstimation | ( | ) | [inline] |
Default constructor.
Definition at line 119 of file overlap_estimation.h.
OverlapEstimation< MESH_TYPE >::~OverlapEstimation | ( | ) | [inline] |
Default destructor. Deallocates structures.
Definition at line 121 of file overlap_estimation.h.
vector<vector<int> >* OverlapEstimation< MESH_TYPE >::BucketVertexNormal | ( | typename MESH_TYPE::VertContainer & | vert, | |
int | bucketDim = 30 | |||
) | [inline, private] |
Buckets normals of the vertexes contained in vert
.
vert
. Definition at line 261 of file overlap_estimation.h.
int OverlapEstimation< MESH_TYPE >::Check | ( | Parameters & | param | ) | [inline] |
Compute the overlap estimation between mFix
and mMov
.
param | A reference to a Parameter class containing all the desidered options to estimate overlap. |
[0..param.samples] . Definition at line 178 of file overlap_estimation.h.
float OverlapEstimation< MESH_TYPE >::Compute | ( | Parameters & | param | ) | [inline] |
Compute the overlap estimation between mFix
and mMov
.
param | A reference to a Parameter class containing all the desidered options to estimate overlap. |
[0..1] . Definition at line 168 of file overlap_estimation.h.
bool OverlapEstimation< MESH_TYPE >::Init | ( | Parameters & | param | ) | [inline] |
Initializes structures.
param | A reference to a Parameter class containing all the desidered options to estimate overlap. |
true
if everything goes right. Definition at line 149 of file overlap_estimation.h.
static int OverlapEstimation< MESH_TYPE >::LocRnd | ( | int | n | ) | [inline, static, private] |
Gets a random number in the interval [0..n] . Number is produced by a
SubtractiveRingRNG
object initialized once for all.
[0..n] . Definition at line 316 of file overlap_estimation.h.
static math::SubtractiveRingRNG& OverlapEstimation< MESH_TYPE >::LocRnd | ( | ) | [inline, static, private] |
Function to retrieve a static random number generator object.
SubtractiveRingRNG
object. Definition at line 308 of file overlap_estimation.h.
void OverlapEstimation< MESH_TYPE >::Paint | ( | ) | [inline] |
Paint mMov
according to the overlap estimation result. Works only if Compute()
or Check()
have been previously called with Parameters.paint=true
.
Legend:
Definition at line 134 of file overlap_estimation.h.
bool OverlapEstimation< MESH_TYPE >::SampleVertNormalEqualized | ( | vector< typename MESH_TYPE::VertexPointer > & | vert, | |
int | SampleNum | |||
) | [inline, private] |
Samples the vert
vector in a normal equalized way.
SampleNum
pointers to vertexes sampled in a normal equalized way. Pointers are stored in the vert
(i.e it is an in/out
parameter). Definition at line 280 of file overlap_estimation.h.
void OverlapEstimation< MESH_TYPE >::SampleVertUniform | ( | MESH_TYPE & | m, | |
vector< typename MESH_TYPE::VertexPointer > & | vert, | |||
int | sampleNum | |||
) | [inline, private] |
Fill the vector vert
with sampleNum
pointers to vertexes sampled uniformly from mesh m
.
m | Source mesh. | |
vert | Destination vector. | |
sampleNum | Requested number of vertexes. |
Definition at line 252 of file overlap_estimation.h.
void OverlapEstimation< MESH_TYPE >::SetFix | ( | MeshType & | m | ) | [inline] |
Set the fix mesh mFix
.
Definition at line 126 of file overlap_estimation.h.
void OverlapEstimation< MESH_TYPE >::SetMove | ( | MeshType & | m | ) | [inline] |
Set the move mesh mMov
.
Definition at line 128 of file overlap_estimation.h.
void OverlapEstimation< MESH_TYPE >::SetupGrid | ( | ) | [inline, private] |
Put mFix
into a grid.
Definition at line 320 of file overlap_estimation.h.
MeshGrid* OverlapEstimation< MESH_TYPE >::gridFix [private] |
Definition at line 114 of file overlap_estimation.h.
MarkerVertex OverlapEstimation< MESH_TYPE >::markerFunctorFix [private] |
Definition at line 115 of file overlap_estimation.h.
MeshType* OverlapEstimation< MESH_TYPE >::mFix [private] |
Definition at line 111 of file overlap_estimation.h.
MeshType* OverlapEstimation< MESH_TYPE >::mMov [private] |
Pointer to mesh mFix
.
Definition at line 112 of file overlap_estimation.h.
vector<vector<int> >* OverlapEstimation< MESH_TYPE >::normBuckets [private] |
Pointer to mesh mMov
.
Definition at line 113 of file overlap_estimation.h.