Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
mrpt::pbmap::SubgraphMatcher Class Reference

Detailed Description

This class finds the best correspondence between the planes of two subgraphs (i.e. sets of neighbor planes). It relies on an interpretation tree employing geometric restrictions that are represented as a set of unary and binary constraints.

Definition at line 39 of file SubgraphMatcher.h.

#include <mrpt/pbmap/SubgraphMatcher.h>

Public Member Functions

 SubgraphMatcher ()
 
bool evalUnaryConstraints (Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
 ! Check if the two input planes could be the same More...
 
bool evalUnaryConstraints2D (Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
 
bool evalUnaryConstraintsOdometry (Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
 
bool evalUnaryConstraintsOdometry2D (Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
 
bool evalBinaryConstraints (Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
 ! Compares the relation between Ref-neigRef with the relation between Check-neigCheck. More...
 
bool evalBinaryConstraintsOdometry (Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
 
void exploreSubgraphTreeR (std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
 ! Recursive function that checks all the relations (direct and crossed) in the neighborhood of a plane. More...
 
void exploreSubgraphTreeR_Area (std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
 
void setSourceSubgraph (Subgraph &subgSrc)
 
void setTargetSubgraph (Subgraph &subgTrg)
 
std::map< unsigned, unsigned > compareSubgraphs (Subgraph &subgraphSource, Subgraph &subgraphTarget, const int option=0)
 
float calcAreaMatched (std::map< unsigned, unsigned > &matched_planes)
 

Public Attributes

std::vector< std::map< unsigned, unsigned > > alreadyExplored
 
SubgraphsubgraphSrc
 
SubgraphsubgraphTrg
 
int nCheckConditions
 
int totalUnary
 
int semanticPair
 
int rejectSemantic
 
config_heuristics configLocaliser
 

Private Member Functions

float calcAreaUnmatched (std::set< unsigned > &unmatched_planes)
 

Private Attributes

std::map< unsigned, unsigned > winnerMatch
 
float areaWinnerMatch
 
std::vector< std::vector< int8_t > > hashUnaryConstraints
 

Constructor & Destructor Documentation

◆ SubgraphMatcher()

SubgraphMatcher::SubgraphMatcher ( )

Definition at line 42 of file SubgraphMatcher.cpp.

Member Function Documentation

◆ calcAreaMatched()

float SubgraphMatcher::calcAreaMatched ( std::map< unsigned, unsigned > &  matched_planes)

Return the total area of the matched planes in the frame source.

Definition at line 1349 of file SubgraphMatcher.cpp.

◆ calcAreaUnmatched()

float SubgraphMatcher::calcAreaUnmatched ( std::set< unsigned > &  unmatched_planes)
private

Definition at line 1360 of file SubgraphMatcher.cpp.

◆ compareSubgraphs()

std::map< unsigned, unsigned > SubgraphMatcher::compareSubgraphs ( Subgraph subgraphSource,
Subgraph subgraphTarget,
const int  option = 0 
)

Returns a list with plane matches from subgraphSrc to subgraphTrg.

Definition at line 1405 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Subgraph::subgraphPlanesIdx.

Referenced by mrpt::pbmap::PbMapLocaliser::searchPlaneContext().

Here is the caller graph for this function:

◆ evalBinaryConstraints()

bool SubgraphMatcher::evalBinaryConstraints ( Plane Ref,
Plane neigRef,
Plane Check,
Plane neigCheck 
)

! Compares the relation between Ref-neigRef with the relation between Check-neigCheck.

Check if the two pair of planes plane1-plane2 ans planeA-planeB fulfill the same geometric relationship, and so, if they are candidates to be the same planes.

Returns true if both geometries are similar

Definition at line 780 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::areaVoxels, mrpt::pbmap::Plane::bFromStructure, mrpt::pbmap::Plane::bFullExtent, mrpt::pbmap::Plane::id, mrpt::math::norm(), RAD2DEG, mrpt::pbmap::Plane::v3center, and mrpt::pbmap::Plane::v3normal.

Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evalBinaryConstraintsOdometry()

bool mrpt::pbmap::SubgraphMatcher::evalBinaryConstraintsOdometry ( Plane plane1,
Plane plane2,
Plane planeA,
Plane planeB 
)

◆ evalUnaryConstraints()

bool SubgraphMatcher::evalUnaryConstraints ( Plane plane1,
Plane plane2,
PbMap trgPbMap,
bool  useStructure = false 
)

! Check if the two input planes could be the same

Check if the two input planes fulfill a set of geometric constraints, and so, if they are candidates to be the same plane.

fabs(plane1.v3colorNrgb[2] - plane2.v3colorNrgb[2]) > configLocaliser.color_threshold ||//)

Definition at line 50 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::bFromStructure, mrpt::pbmap::Plane::bFullExtent, BhattacharyyaDist_(), mrpt::pbmap::Plane::elongation, mrpt::pbmap::Plane::hist_H, and mrpt::pbmap::Plane::id.

Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evalUnaryConstraints2D()

bool SubgraphMatcher::evalUnaryConstraints2D ( Plane plane1,
Plane plane2,
PbMap trgPbMap,
bool  useStructure = false 
)

fabs(plane1.v3colorNrgb[2] - plane2.v3colorNrgb[2]) > configLocaliser.color_threshold ||//)

Definition at line 398 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::bFromStructure, mrpt::pbmap::Plane::bFullExtent, BhattacharyyaDist_(), mrpt::pbmap::Plane::d, mrpt::pbmap::Plane::elongation, mrpt::pbmap::Plane::hist_H, mrpt::pbmap::Plane::id, and mrpt::pbmap::Plane::v3normal.

Here is the call graph for this function:

◆ evalUnaryConstraintsOdometry()

bool SubgraphMatcher::evalUnaryConstraintsOdometry ( Plane plane1,
Plane plane2,
PbMap trgPbMap,
bool  useStructure = false 
)

fabs(plane1.v3colorNrgb[2] - plane2.v3colorNrgb[2]) > configLocaliser.color_threshold ||//)

Definition at line 212 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::bFromStructure, mrpt::pbmap::Plane::bFullExtent, BhattacharyyaDist_(), mrpt::pbmap::Plane::d, mrpt::pbmap::Plane::elongation, mrpt::pbmap::Plane::hist_H, mrpt::pbmap::Plane::id, and mrpt::pbmap::Plane::v3normal.

Here is the call graph for this function:

◆ evalUnaryConstraintsOdometry2D()

bool SubgraphMatcher::evalUnaryConstraintsOdometry2D ( Plane plane1,
Plane plane2,
PbMap trgPbMap,
bool  useStructure = false 
)

fabs(plane1.v3colorNrgb[2] - plane2.v3colorNrgb[2]) > configLocaliser.color_threshold ||//)

Definition at line 574 of file SubgraphMatcher.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::bFromStructure, mrpt::pbmap::Plane::bFullExtent, BhattacharyyaDist_(), mrpt::pbmap::Plane::d, mrpt::pbmap::Plane::elongation, mrpt::pbmap::Plane::hist_H, mrpt::pbmap::Plane::id, and mrpt::pbmap::Plane::v3normal.

Here is the call graph for this function:

◆ exploreSubgraphTreeR()

void SubgraphMatcher::exploreSubgraphTreeR ( std::set< unsigned > &  evalRef,
std::set< unsigned > &  evalCheck,
std::map< unsigned, unsigned > &  matched 
)

! Recursive function that checks all the relations (direct and crossed) in the neighborhood of a plane.

Find the best combination of planes correspondences given two subgraphs represeting local neighborhoods of planes.

This function make redundant checks and therefore is NOT efficient at all

static_cast<int>(targetPlanes.size() ) < requiredMatches ) // New condition to speed up the search when there are not a minimum number of candidates
cout << "End branch recursive search. matched " << matched.size() << " prev winner " << winnerMatch.size() << endl;

Definition at line 1017 of file SubgraphMatcher.cpp.

References min.

◆ exploreSubgraphTreeR_Area()

void SubgraphMatcher::exploreSubgraphTreeR_Area ( std::set< unsigned > &  evalRef,
std::set< unsigned > &  evalCheck,
std::map< unsigned, unsigned > &  matched 
)

Definition at line 1188 of file SubgraphMatcher.cpp.

References min.

◆ setSourceSubgraph()

void mrpt::pbmap::SubgraphMatcher::setSourceSubgraph ( Subgraph subgSrc)
inline

Set source (current) subgraph.

Definition at line 79 of file SubgraphMatcher.h.

References subgraphSrc.

◆ setTargetSubgraph()

void mrpt::pbmap::SubgraphMatcher::setTargetSubgraph ( Subgraph subgTrg)
inline

Set target subgraph.

Definition at line 81 of file SubgraphMatcher.h.

References subgraphTrg.

Member Data Documentation

◆ alreadyExplored

std::vector<std::map<unsigned, unsigned> > mrpt::pbmap::SubgraphMatcher::alreadyExplored

List of combinations that have been explored in the interpretation tree.

Definition at line 68 of file SubgraphMatcher.h.

◆ areaWinnerMatch

float mrpt::pbmap::SubgraphMatcher::areaWinnerMatch
private

Definition at line 110 of file SubgraphMatcher.h.

◆ configLocaliser

config_heuristics mrpt::pbmap::SubgraphMatcher::configLocaliser

◆ hashUnaryConstraints

std::vector<std::vector<int8_t> > mrpt::pbmap::SubgraphMatcher::hashUnaryConstraints
private

Hash table for unary constraints.

Definition at line 113 of file SubgraphMatcher.h.

◆ nCheckConditions

int mrpt::pbmap::SubgraphMatcher::nCheckConditions

Definition at line 95 of file SubgraphMatcher.h.

Referenced by mrpt::pbmap::PbMapLocaliser::run().

◆ rejectSemantic

int mrpt::pbmap::SubgraphMatcher::rejectSemantic

Definition at line 99 of file SubgraphMatcher.h.

◆ semanticPair

int mrpt::pbmap::SubgraphMatcher::semanticPair

Definition at line 98 of file SubgraphMatcher.h.

◆ subgraphSrc

Subgraph* mrpt::pbmap::SubgraphMatcher::subgraphSrc

One subgraph to be matched.

Definition at line 90 of file SubgraphMatcher.h.

Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors(), and setSourceSubgraph().

◆ subgraphTrg

Subgraph* mrpt::pbmap::SubgraphMatcher::subgraphTrg

The other subgraph to be matched.

Definition at line 93 of file SubgraphMatcher.h.

Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors(), and setTargetSubgraph().

◆ totalUnary

int mrpt::pbmap::SubgraphMatcher::totalUnary

Definition at line 97 of file SubgraphMatcher.h.

◆ winnerMatch

std::map<unsigned, unsigned> mrpt::pbmap::SubgraphMatcher::winnerMatch
private

List of planes correspondences.

Definition at line 109 of file SubgraphMatcher.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019