00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2011 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef COccupancyGridMapFeatureExtractor_H 00029 #define COccupancyGridMapFeatureExtractor_H 00030 00031 #include <mrpt/slam/COccupancyGridMap2D.h> 00032 #include <mrpt/slam/CLandmarksMap.h> 00033 #include <mrpt/vision/CFeatureExtraction.h> 00034 00035 #include <mrpt/utils/CObserver.h> 00036 00037 #include <mrpt/slam/link_pragmas.h> 00038 00039 namespace mrpt 00040 { 00041 namespace slam 00042 { 00043 using namespace mrpt::math; 00044 00045 /** A class for detecting features from occupancy grid maps. 00046 * The main method is "COccupancyGridMapFeatureExtractor::extractFeatures()", which makes use 00047 * of an advanced cache mechanism to avoid redoing work when applied several times on the same 00048 * occupancy grid maps (unless they changed in the meanwhile). 00049 * 00050 * For an uncached version (which is a static method that can be called without instantiating COccupancyGridMapFeatureExtractor) 00051 * see COccupancyGridMapFeatureExtractor::uncached_extractFeatures() 00052 * 00053 */ 00054 class SLAM_IMPEXP COccupancyGridMapFeatureExtractor : public mrpt::utils::CObserver 00055 { 00056 public: 00057 COccupancyGridMapFeatureExtractor(); //!< Default ctor 00058 ~COccupancyGridMapFeatureExtractor(); //!< Destructor 00059 00060 /** Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is not erased!) into the given landmarks map. 00061 * Landmarks type can be any declared in mrpt::vision::CFeatureExtraction::TOptions 00062 * 00063 * \note See the paper "..." 00064 * \sa uncached_extractFeatures 00065 */ 00066 void extractFeatures( 00067 const mrpt::slam::COccupancyGridMap2D &grid, 00068 mrpt::slam::CLandmarksMap &outMap, 00069 const size_t number_of_features, 00070 const mrpt::vision::TDescriptorType descriptors, 00071 const mrpt::vision::CFeatureExtraction::TOptions &feat_options 00072 ); 00073 00074 /** Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is not erased!) into the given landmarks map. 00075 * Landmarks type can be any declared in mrpt::vision::CFeatureExtraction::TOptions 00076 * 00077 * \note See the paper "..." 00078 * \sa uncached_extractFeatures 00079 */ 00080 static void uncached_extractFeatures( 00081 const mrpt::slam::COccupancyGridMap2D &grid, 00082 mrpt::slam::CLandmarksMap &outMap, 00083 const size_t number_of_features, 00084 const mrpt::vision::TDescriptorType descriptors, 00085 const mrpt::vision::CFeatureExtraction::TOptions &feat_options 00086 ); 00087 00088 protected: 00089 void OnEvent(const mrptEvent &e); //!< This will receive the events from maps in order to purge the cache. 00090 typedef std::map<const mrpt::slam::COccupancyGridMap2D*,mrpt::slam::CLandmarksMapPtr> TCache; 00091 TCache m_cache; //!< A cache of already computed maps. 00092 00093 00094 }; // End of class def. 00095 00096 } // End of namespace 00097 } // End of namespace 00098 00099 #endif
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011 |