MRPT
2.0.3
mrpt
slam
COccupancyGridMapFeatureExtractor.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <
mrpt/maps/CLandmarksMap.h
>
12
#include <
mrpt/maps/COccupancyGridMap2D.h
>
13
#include <
mrpt/vision/CFeatureExtraction.h
>
14
15
#include <
mrpt/system/CObserver.h
>
16
17
namespace
mrpt::slam
18
{
19
/** A class for detecting features from occupancy grid maps.
20
* The main method is "COccupancyGridMapFeatureExtractor::extractFeatures()",
21
* which makes use
22
* of an advanced cache mechanism to avoid redoing work when applied several
23
* times on the same
24
* occupancy grid maps (unless they changed in the meanwhile).
25
*
26
* For an uncached version (which is a static method that can be called
27
* without instantiating COccupancyGridMapFeatureExtractor)
28
* see COccupancyGridMapFeatureExtractor::uncached_extractFeatures()
29
*
30
* \ingroup mrpt_slam_grp
31
*/
32
class
COccupancyGridMapFeatureExtractor
:
public
mrpt::system::CObserver
33
{
34
public
:
35
/** Computes a set of distinctive landmarks from an occupancy grid, and
36
* store them (previous content is not erased!) into the given landmarks
37
* map.
38
* Landmarks type can be any declared in
39
* mrpt::vision::CFeatureExtraction::TOptions
40
*
41
* \note See the paper "..."
42
* \sa uncached_extractFeatures
43
*/
44
void
extractFeatures
(
45
const
mrpt::maps::COccupancyGridMap2D
& grid,
46
mrpt::maps::CLandmarksMap
& outMap,
const
size_t
number_of_features,
47
const
mrpt::vision::TDescriptorType
descriptors,
48
const
mrpt::vision::CFeatureExtraction::TOptions
& feat_options);
49
50
/** Computes a set of distinctive landmarks from an occupancy grid, and
51
* store them (previous content is not erased!) into the given landmarks
52
* map.
53
* Landmarks type can be any declared in
54
* mrpt::vision::CFeatureExtraction::TOptions
55
*
56
* \note See the paper "..."
57
* \sa uncached_extractFeatures
58
*/
59
static
void
uncached_extractFeatures
(
60
const
mrpt::maps::COccupancyGridMap2D
& grid,
61
mrpt::maps::CLandmarksMap
& outMap,
const
size_t
number_of_features,
62
const
mrpt::vision::TDescriptorType
descriptors,
63
const
mrpt::vision::CFeatureExtraction::TOptions
& feat_options);
64
65
protected
:
66
/** This will receive the events from maps in order to purge the cache. */
67
void
OnEvent
(
const
mrpt::system::mrptEvent
& e)
override
;
68
using
TCache
= std::map<
69
const
mrpt::maps::COccupancyGridMap2D
*,
mrpt::maps::CLandmarksMap::Ptr
>;
70
/** A cache of already computed maps. */
71
TCache
m_cache
;
72
73
};
// End of class def.
74
75
}
// namespace mrpt::slam
mrpt::system::mrptEvent
The basic event type for the observer-observable pattern in MRPT.
Definition:
mrptEvent.h:31
COccupancyGridMap2D.h
mrpt::slam::COccupancyGridMapFeatureExtractor::m_cache
TCache m_cache
A cache of already computed maps.
Definition:
COccupancyGridMapFeatureExtractor.h:71
mrpt::slam::COccupancyGridMapFeatureExtractor
A class for detecting features from occupancy grid maps.
Definition:
COccupancyGridMapFeatureExtractor.h:32
mrpt::slam::COccupancyGridMapFeatureExtractor::TCache
std::map< const mrpt::maps::COccupancyGridMap2D *, mrpt::maps::CLandmarksMap::Ptr > TCache
Definition:
COccupancyGridMapFeatureExtractor.h:69
mrpt::slam::COccupancyGridMapFeatureExtractor::extractFeatures
void extractFeatures(const mrpt::maps::COccupancyGridMap2D &grid, mrpt::maps::CLandmarksMap &outMap, const size_t number_of_features, const mrpt::vision::TDescriptorType descriptors, const mrpt::vision::CFeatureExtraction::TOptions &feat_options)
Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is n...
Definition:
COccupancyGridMapFeatureExtractor.cpp:80
mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures
static void uncached_extractFeatures(const mrpt::maps::COccupancyGridMap2D &grid, mrpt::maps::CLandmarksMap &outMap, const size_t number_of_features, const mrpt::vision::TDescriptorType descriptors, const mrpt::vision::CFeatureExtraction::TOptions &feat_options)
Computes a set of distinctive landmarks from an occupancy grid, and store them (previous content is n...
Definition:
COccupancyGridMapFeatureExtractor.cpp:21
CLandmarksMap.h
mrpt::maps::CLandmarksMap::Ptr
std::shared_ptr< mrpt::maps ::CLandmarksMap > Ptr
Definition:
CLandmarksMap.h:76
CFeatureExtraction.h
mrpt::vision::CFeatureExtraction::TOptions
The set of parameters for all the detectors & descriptor algorithms.
Definition:
CFeatureExtraction.h:87
CObserver.h
mrpt::vision::TDescriptorType
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
Definition:
vision/include/mrpt/vision/types.h:76
mrpt::system::CObserver
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition:
CObserver.h:34
mrpt::maps::COccupancyGridMap2D
A class for storing an occupancy grid map.
Definition:
COccupancyGridMap2D.h:53
mrpt::maps::CLandmarksMap
A class for storing a map of 3D probabilistic landmarks.
Definition:
CLandmarksMap.h:74
mrpt::slam::COccupancyGridMapFeatureExtractor::OnEvent
void OnEvent(const mrpt::system::mrptEvent &e) override
This will receive the events from maps in order to purge the cache.
Definition:
COccupancyGridMapFeatureExtractor.cpp:116
mrpt::slam
Definition:
CMultiMetricMapPDF.h:26
Page generated by
Doxygen 1.8.17
for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020