Main MRPT website > C++ reference for MRPT 1.5.6
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-2017, 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 href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
13  */
14 
15 #ifndef __SUBGRAPHMATCHER_H
16 #define __SUBGRAPHMATCHER_H
17 
18 #include <mrpt/config.h>
19 #if MRPT_HAS_PCL
20 
21 #include <mrpt/utils/utils_defs.h>
23 
25 #include <mrpt/pbmap/PbMap.h>
26 #include <mrpt/pbmap/Subgraph.h>
27 
28 namespace mrpt {
29 namespace pbmap {
30 
31 
32  /*!This class finds the best correspondence between the planes of two subgraphs (i.e. sets of neighbor planes).
33  * It relies on an interpretation tree employing geometric restrictions that are represented as a set of unary and binary constraints.
34  *
35  * \ingroup mrpt_pbmap_grp
36  */
38  {
39  public:
40 
42 
43  /*!Check if the two input planes fulfill a set of geometric constraints, and so, if they are candidates to be the same plane.*/
44  bool evalUnaryConstraints(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure = false);
45  bool evalUnaryConstraints2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure = false);
46  bool evalUnaryConstraintsOdometry(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure = false);
47  bool evalUnaryConstraintsOdometry2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure = false);
48 
49  /*!Check if the two pair of planes plane1-plane2 ans planeA-planeB fulfill the same geometric relationship, and so,
50  if they are candidates to be the same planes.*/
51  bool evalBinaryConstraints(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB);
52  bool evalBinaryConstraintsOdometry(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB);
53 
54  /*!List of combinations that have been explored in the interpretation tree.*/ // Cambiar nombre
55  std::vector<std::map<unsigned,unsigned> > alreadyExplored;
56 
57  /*!Find the best combination of planes correspondences given two subgraphs represeting local neighborhoods of planes.*/ // Cambiar nombre o Quitar!
58  void exploreSubgraphTreeR(std::set<unsigned> &evalRef, std::set<unsigned> &evalCheck, std::map<unsigned, unsigned> &matched);
59  void exploreSubgraphTreeR_Area(std::set<unsigned> &evalRef, std::set<unsigned> &evalCheck, std::map<unsigned, unsigned> &matched);
60 
61  /*!Set source (current) subgraph.*/
62  void inline setSourceSubgraph(Subgraph &subgSrc){subgraphSrc = &subgSrc;}
63 
64  /*!Set target subgraph.*/
65  void inline setTargetSubgraph(Subgraph &subgTrg){subgraphTrg = &subgTrg;}
66 
67  /*!Returns a list with plane matches from subgraphSrc to subgraphTrg.*/
68 // std::map<unsigned,unsigned> compareSubgraphs(Subgraph &subgraphSource, Subgraph &subgraphTarget);
69  std::map<unsigned,unsigned> compareSubgraphs(Subgraph &subgraphSource, Subgraph &subgraphTarget, const int option=0); // Options are
70 
71  /*!One subgraph to be matched.*/
73 
74  /*!The other subgraph to be matched.*/
76 
78 
82 
83  /*!Return the total area of the matched planes in the frame source.*/
84  float calcAreaMatched(std::map<unsigned,unsigned> &matched_planes);
85 
86  /*!Set of thresholds for PbMap matching.*/
88 
89  private:
90 
91  /*!List of planes correspondences.*/
92  std::map<unsigned, unsigned> winnerMatch;
94 
95  /*!Hash table for unary constraints.*/
96  std::vector<std::vector<int8_t> > hashUnaryConstraints;
97 
98  float calcAreaUnmatched(std::set<unsigned> &unmatched_planes);
99 
100  };
101 
102 } } // End of namespaces
103 
104 #endif
105 #endif
std::vector< std::vector< int8_t > > hashUnaryConstraints
bool evalUnaryConstraints2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
void exploreSubgraphTreeR_Area(std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
A class used to store a planar feature (Plane for short).
Definition: Plane.h:48
bool evalBinaryConstraintsOdometry(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
JCOPY_OPTION option
Definition: transupp.h:121
bool evalUnaryConstraintsOdometry(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
void setTargetSubgraph(Subgraph &subgTrg)
std::map< unsigned, unsigned > winnerMatch
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool evalUnaryConstraintsOdometry2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
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...
config_heuristics configLocaliser
std::map< unsigned, unsigned > compareSubgraphs(Subgraph &subgraphSource, Subgraph &subgraphTarget, const int option=0)
float calcAreaMatched(std::map< unsigned, unsigned > &matched_planes)
A class used to define the heuristic parameters and thresholds used to match sets of planes...
bool evalUnaryConstraints(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
! Check if the two input planes could be the same
bool evalBinaryConstraints(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
! Compares the relation between Ref-neigRef with the relation between Check-neigCheck.
float calcAreaUnmatched(std::set< unsigned > &unmatched_planes)
void setSourceSubgraph(Subgraph &subgSrc)
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:45
std::vector< std::map< unsigned, unsigned > > alreadyExplored



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019