Main MRPT website > C++ reference
MRPT logo
COccupancyGridMapFeatureExtractor.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef COccupancyGridMapFeatureExtractor_H
29 #define COccupancyGridMapFeatureExtractor_H
30 
34 
35 #include <mrpt/utils/CObserver.h>
36 
37 #include <mrpt/slam/link_pragmas.h>
38 
39 namespace mrpt
40 {
41  namespace slam
42  {
43  using namespace mrpt::math;
44 
45  /** A class for detecting features from occupancy grid maps.
46  * The main method is "COccupancyGridMapFeatureExtractor::extractFeatures()", which makes use
47  * of an advanced cache mechanism to avoid redoing work when applied several times on the same
48  * occupancy grid maps (unless they changed in the meanwhile).
49  *
50  * For an uncached version (which is a static method that can be called without instantiating COccupancyGridMapFeatureExtractor)
51  * see COccupancyGridMapFeatureExtractor::uncached_extractFeatures()
52  *
53  * \ingroup mrpt_slam_grp
54  */
56  {
57  public:
58  COccupancyGridMapFeatureExtractor(); //!< Default ctor
59  ~COccupancyGridMapFeatureExtractor(); //!< Destructor
60 
61  /** Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is not erased!) into the given landmarks map.
62  * Landmarks type can be any declared in mrpt::vision::CFeatureExtraction::TOptions
63  *
64  * \note See the paper "..."
65  * \sa uncached_extractFeatures
66  */
67  void extractFeatures(
70  const size_t number_of_features,
71  const mrpt::vision::TDescriptorType descriptors,
73  );
74 
75  /** Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is not erased!) into the given landmarks map.
76  * Landmarks type can be any declared in mrpt::vision::CFeatureExtraction::TOptions
77  *
78  * \note See the paper "..."
79  * \sa uncached_extractFeatures
80  */
81  static void uncached_extractFeatures(
84  const size_t number_of_features,
85  const mrpt::vision::TDescriptorType descriptors,
87  );
88 
89  protected:
90  void OnEvent(const mrptEvent &e); //!< This will receive the events from maps in order to purge the cache.
91  typedef std::map<const mrpt::slam::COccupancyGridMap2D*,mrpt::slam::CLandmarksMapPtr> TCache;
92  TCache m_cache; //!< A cache of already computed maps.
93 
94 
95  }; // End of class def.
96 
97  } // End of namespace
98 } // End of namespace
99 
100 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013