Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
23
25#include <mrpt/pbmap/PbMap.h>
26#include <mrpt/pbmap/Subgraph.h>
27
28namespace mrpt {
29namespace 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
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/pbmap.h:46
A class used to store a planar feature (Plane for short).
Definition: Plane.h:49
bool evalUnaryConstraintsOdometry2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
std::vector< std::vector< int8_t > > hashUnaryConstraints
std::map< unsigned, unsigned > winnerMatch
std::map< unsigned, unsigned > compareSubgraphs(Subgraph &subgraphSource, Subgraph &subgraphTarget, const int option=0)
void setSourceSubgraph(Subgraph &subgSrc)
bool evalUnaryConstraints2D(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
std::vector< std::map< unsigned, unsigned > > alreadyExplored
float calcAreaMatched(std::map< unsigned, unsigned > &matched_planes)
void exploreSubgraphTreeR_Area(std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
void exploreSubgraphTreeR(std::set< unsigned > &evalRef, std::set< unsigned > &evalCheck, std::map< unsigned, unsigned > &matched)
float calcAreaUnmatched(std::set< unsigned > &unmatched_planes)
bool evalUnaryConstraints(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
bool evalBinaryConstraintsOdometry(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
void setTargetSubgraph(Subgraph &subgTrg)
bool evalUnaryConstraintsOdometry(Plane &plane1, Plane &plane2, PbMap &trgPbMap, bool useStructure=false)
config_heuristics configLocaliser
bool evalBinaryConstraints(Plane &plane1, Plane &plane2, Plane &planeA, Plane &planeB)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to define the heuristic parameters and thresholds used to match sets of planes.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Tue Jan 17 22:27:43 UTC 2023