MRPT
1.9.9
|
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 35 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 |
Subgraph * | subgraphSrc |
Subgraph * | subgraphTrg |
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 |
SubgraphMatcher::SubgraphMatcher | ( | ) |
Definition at line 40 of file SubgraphMatcher.cpp.
float SubgraphMatcher::calcAreaMatched | ( | std::map< unsigned, unsigned > & | matched_planes | ) |
Return the total area of the matched planes in the frame source.
Definition at line 1347 of file SubgraphMatcher.cpp.
|
private |
Definition at line 1358 of file SubgraphMatcher.cpp.
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 1403 of file SubgraphMatcher.cpp.
References mrpt::pbmap::Subgraph::subgraphPlanesIdx.
Referenced by mrpt::pbmap::PbMapLocaliser::searchPlaneContext().
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 778 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().
bool mrpt::pbmap::SubgraphMatcher::evalBinaryConstraintsOdometry | ( | Plane & | plane1, |
Plane & | plane2, | ||
Plane & | planeA, | ||
Plane & | planeB | ||
) |
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 48 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().
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 396 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.
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 210 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.
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 572 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.
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 1015 of file SubgraphMatcher.cpp.
References min.
void SubgraphMatcher::exploreSubgraphTreeR_Area | ( | std::set< unsigned > & | evalRef, |
std::set< unsigned > & | evalCheck, | ||
std::map< unsigned, unsigned > & | matched | ||
) |
Definition at line 1186 of file SubgraphMatcher.cpp.
References min.
Set source (current) subgraph.
Definition at line 75 of file SubgraphMatcher.h.
References subgraphSrc.
std::vector<std::map<unsigned, unsigned> > mrpt::pbmap::SubgraphMatcher::alreadyExplored |
List of combinations that have been explored in the interpretation tree.
Definition at line 64 of file SubgraphMatcher.h.
|
private |
Definition at line 106 of file SubgraphMatcher.h.
config_heuristics mrpt::pbmap::SubgraphMatcher::configLocaliser |
Set of thresholds for PbMap matching.
Definition at line 101 of file SubgraphMatcher.h.
Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors(), mrpt::pbmap::PbMapLocaliser::PbMapLocaliser(), mrpt::pbmap::PbMapLocaliser::run(), and mrpt::pbmap::PbMapLocaliser::searchPlaneContext().
|
private |
Hash table for unary constraints.
Definition at line 109 of file SubgraphMatcher.h.
int mrpt::pbmap::SubgraphMatcher::nCheckConditions |
Definition at line 91 of file SubgraphMatcher.h.
Referenced by mrpt::pbmap::PbMapLocaliser::run().
int mrpt::pbmap::SubgraphMatcher::rejectSemantic |
Definition at line 95 of file SubgraphMatcher.h.
int mrpt::pbmap::SubgraphMatcher::semanticPair |
Definition at line 94 of file SubgraphMatcher.h.
Subgraph* mrpt::pbmap::SubgraphMatcher::subgraphSrc |
One subgraph to be matched.
Definition at line 86 of file SubgraphMatcher.h.
Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors(), and setSourceSubgraph().
Subgraph* mrpt::pbmap::SubgraphMatcher::subgraphTrg |
The other subgraph to be matched.
Definition at line 89 of file SubgraphMatcher.h.
Referenced by mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors(), and setTargetSubgraph().
int mrpt::pbmap::SubgraphMatcher::totalUnary |
Definition at line 93 of file SubgraphMatcher.h.
|
private |
List of planes correspondences.
Definition at line 105 of file SubgraphMatcher.h.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020 |