Main MRPT website > C++ reference for MRPT 1.9.9
SubgraphMatcher.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /* Plane-based Map (PbMap) library
11  * Construction of plane-based maps and localization in it from RGBD Images.
12  * Writen by Eduardo Fernandez-Moral. See docs for <a
13  * href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
14  */
15 
16 #ifndef __SUBGRAPHMATCHER_H
17 #define __SUBGRAPHMATCHER_H
18 
19 #include <mrpt/config.h>
20 #if MRPT_HAS_PCL
21 
23 #include <mrpt/pbmap/PbMap.h>
24 #include <mrpt/pbmap/Subgraph.h>
25 
26 namespace mrpt
27 {
28 namespace pbmap
29 {
30 /*!This class finds the best correspondence between the planes of two subgraphs
31  * (i.e. sets of neighbor planes).
32  * It relies on an interpretation tree employing geometric restrictions that are
33  * represented as a set of unary and binary constraints.
34  *
35  * \ingroup mrpt_pbmap_grp
36  */
38 {
39  public:
41 
42  /*!Check if the two input planes fulfill a set of geometric constraints, and
43  * so, if they are candidates to be the same plane.*/
45  Plane& plane1, Plane& plane2, PbMap& trgPbMap,
46  bool useStructure = false);
48  Plane& plane1, Plane& plane2, PbMap& trgPbMap,
49  bool useStructure = false);
51  Plane& plane1, Plane& plane2, PbMap& trgPbMap,
52  bool useStructure = false);
54  Plane& plane1, Plane& plane2, PbMap& trgPbMap,
55  bool useStructure = false);
56 
57  /*!Check if the two pair of planes plane1-plane2 ans planeA-planeB fulfill
58  the same geometric relationship, and so,
59  if they are candidates to be the same planes.*/
61  Plane& plane1, Plane& plane2, Plane& planeA, Plane& planeB);
63  Plane& plane1, Plane& plane2, Plane& planeA, Plane& planeB);
64 
65  /*!List of combinations that have been explored in the interpretation tree.*/ // Cambiar nombre
66  std::vector<std::map<unsigned, unsigned>> alreadyExplored;
67 
68  /*!Find the best combination of planes correspondences given two subgraphs represeting local neighborhoods of planes.*/ // Cambiar nombre o Quitar!
70  std::set<unsigned>& evalRef, std::set<unsigned>& evalCheck,
71  std::map<unsigned, unsigned>& matched);
73  std::set<unsigned>& evalRef, std::set<unsigned>& evalCheck,
74  std::map<unsigned, unsigned>& matched);
75 
76  /*!Set source (current) subgraph.*/
77  void inline setSourceSubgraph(Subgraph& subgSrc) { subgraphSrc = &subgSrc; }
78  /*!Set target subgraph.*/
79  void inline setTargetSubgraph(Subgraph& subgTrg) { subgraphTrg = &subgTrg; }
80  /*!Returns a list with plane matches from subgraphSrc to subgraphTrg.*/
81  // std::map<unsigned,unsigned> compareSubgraphs(Subgraph &subgraphSource,
82  // Subgraph &subgraphTarget);
83  std::map<unsigned, unsigned> compareSubgraphs(
84  Subgraph& subgraphSource, Subgraph& subgraphTarget,
85  const int option = 0); // Options are
86 
87  /*!One subgraph to be matched.*/
89 
90  /*!The other subgraph to be matched.*/
92 
94 
98 
99  /*!Return the total area of the matched planes in the frame source.*/
100  float calcAreaMatched(std::map<unsigned, unsigned>& matched_planes);
101 
102  /*!Set of thresholds for PbMap matching.*/
104 
105  private:
106  /*!List of planes correspondences.*/
107  std::map<unsigned, unsigned> winnerMatch;
109 
110  /*!Hash table for unary constraints.*/
111  std::vector<std::vector<int8_t>> hashUnaryConstraints;
112 
113  float calcAreaUnmatched(std::set<unsigned>& unmatched_planes);
114 };
115 }
116 } // End of namespaces
117 
118 #endif
119 #endif
mrpt::pbmap::SubgraphMatcher::semanticPair
int semanticPair
Definition: SubgraphMatcher.h:96
mrpt::pbmap::SubgraphMatcher::exploreSubgraphTreeR
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 plan...
Definition: SubgraphMatcher.cpp:1015
mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D
bool evalUnaryConstraintsOdometry2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
Definition: SubgraphMatcher.cpp:572
mrpt::pbmap::SubgraphMatcher::configLocaliser
config_heuristics configLocaliser
Definition: SubgraphMatcher.h:103
mrpt::pbmap::SubgraphMatcher::subgraphSrc
Subgraph * subgraphSrc
Definition: SubgraphMatcher.h:88
mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints
bool evalBinaryConstraints(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
! Compares the relation between Ref-neigRef with the relation between Check-neigCheck.
Definition: SubgraphMatcher.cpp:778
mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints
bool evalUnaryConstraints(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
! Check if the two input planes could be the same
Definition: SubgraphMatcher.cpp:48
mrpt::pbmap::Subgraph
Definition: Subgraph.h:34
mrpt::pbmap::SubgraphMatcher::calcAreaMatched
float calcAreaMatched(std::map< unsigned, unsigned > &matched_planes)
Definition: SubgraphMatcher.cpp:1347
mrpt::pbmap::SubgraphMatcher::nCheckConditions
int nCheckConditions
Definition: SubgraphMatcher.h:93
mrpt::pbmap::SubgraphMatcher::compareSubgraphs
std::map< unsigned, unsigned > compareSubgraphs(Subgraph &subgraphSource, Subgraph &subgraphTarget, const int option=0)
Definition: SubgraphMatcher.cpp:1403
Subgraph.h
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::pbmap::SubgraphMatcher::alreadyExplored
std::vector< std::map< unsigned, unsigned > > alreadyExplored
Definition: SubgraphMatcher.h:66
mrpt::pbmap::SubgraphMatcher::calcAreaUnmatched
float calcAreaUnmatched(std::set< unsigned > &unmatched_planes)
Definition: SubgraphMatcher.cpp:1358
mrpt::pbmap::config_heuristics
A class used to define the heuristic parameters and thresholds used to match sets of planes.
Definition: heuristicParams.h:32
mrpt::pbmap::SubgraphMatcher::areaWinnerMatch
float areaWinnerMatch
Definition: SubgraphMatcher.h:108
heuristicParams.h
mrpt::pbmap::SubgraphMatcher::hashUnaryConstraints
std::vector< std::vector< int8_t > > hashUnaryConstraints
Definition: SubgraphMatcher.h:111
mrpt::pbmap::SubgraphMatcher
Definition: SubgraphMatcher.h:37
mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D
bool evalUnaryConstraints2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
Definition: SubgraphMatcher.cpp:396
mrpt::pbmap::SubgraphMatcher::evalBinaryConstraintsOdometry
bool evalBinaryConstraintsOdometry(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
mrpt::pbmap::SubgraphMatcher::SubgraphMatcher
SubgraphMatcher()
Definition: SubgraphMatcher.cpp:40
mrpt::pbmap::Plane
A class used to store a planar feature (Plane for short).
Definition: Plane.h:46
mrpt::pbmap::SubgraphMatcher::setSourceSubgraph
void setSourceSubgraph(Subgraph &subgSrc)
Definition: SubgraphMatcher.h:77
mrpt::pbmap::PbMap
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:47
mrpt::pbmap::SubgraphMatcher::exploreSubgraphTreeR_Area
void exploreSubgraphTreeR_Area(std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
Definition: SubgraphMatcher.cpp:1186
mrpt::pbmap::SubgraphMatcher::subgraphTrg
Subgraph * subgraphTrg
Definition: SubgraphMatcher.h:91
mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry
bool evalUnaryConstraintsOdometry(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
Definition: SubgraphMatcher.cpp:210
mrpt::pbmap::SubgraphMatcher::totalUnary
int totalUnary
Definition: SubgraphMatcher.h:95
PbMap.h
mrpt::pbmap::SubgraphMatcher::rejectSemantic
int rejectSemantic
Definition: SubgraphMatcher.h:97
mrpt::pbmap::SubgraphMatcher::winnerMatch
std::map< unsigned, unsigned > winnerMatch
Definition: SubgraphMatcher.h:107
mrpt::pbmap::SubgraphMatcher::setTargetSubgraph
void setTargetSubgraph(Subgraph &subgTrg)
Definition: SubgraphMatcher.h:79



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST