SaDVIO
afeaturematcher.h
Go to the documentation of this file.
1 #ifndef AFEATUREMATCHER_H
2 #define AFEATUREMATCHER_H
3 
4 #include "isaeslam/typedefs.h"
5 #include <type_traits>
6 
10 
11 namespace isae {
12 
14 typedef std::unordered_map<std::shared_ptr<AFeature>, std::vector<std::shared_ptr<AFeature>>> vec_feat_matches;
15 
17 typedef std::unordered_map<std::shared_ptr<AFeature>, std::vector<double>> vec_feat_matches_scores;
18 
26  public:
28  AFeatureMatcher(std::shared_ptr<AFeatureDetector> detector) : _detector(detector) {}
29 
43  virtual uint match(std::vector<std::shared_ptr<AFeature>> &features1,
44  std::vector<std::shared_ptr<AFeature>> &features2,
45  std::vector<std::shared_ptr<AFeature>> &features_init,
46  vec_match &matches,
47  vec_match &matches_with_ldmks,
48  int searchAreaWidth = 51,
49  int searchAreaHeight = 51);
60  virtual uint ldmk_match(std::shared_ptr<ImageSensor> &sensor1,
61  std::vector<std::shared_ptr<ALandmark>> &ldmks,
62  int searchAreaWidth = 51,
63  int searchAreaHeight = 51);
64 
65  protected:
79  virtual void getPossibleMatchesBetween(const std::vector<std::shared_ptr<AFeature>> &features1,
80  const std::vector<std::shared_ptr<AFeature>> &features2,
81  const std::vector<std::shared_ptr<AFeature>> &features_init,
82  const uint &searchAreaWidth,
83  const uint &searchAreaHeight,
84  vec_feat_matches &matches,
85  vec_feat_matches_scores &all_scores);
99  vec_feat_matches &matches21,
100  vec_feat_matches_scores &all_scores12,
101  vec_feat_matches_scores &all_scores21);
102 
103  std::shared_ptr<AFeatureDetector> _detector;
105  0.9;
106  std::string _feature_label;
107 };
108 
109 } // namespace isae
110 #endif // AFEATUREMATCHER_H
isae::AFeatureMatcher::_first_second_match_score_ratio
double _first_second_match_score_ratio
ratio between the first and second best match score to consider a match valid
Definition: afeaturematcher.h:104
isae::AFeatureMatcher::match
virtual uint match(std::vector< std::shared_ptr< AFeature >> &features1, std::vector< std::shared_ptr< AFeature >> &features2, std::vector< std::shared_ptr< AFeature >> &features_init, vec_match &matches, vec_match &matches_with_ldmks, int searchAreaWidth=51, int searchAreaHeight=51)
Match features between two sets of features.
Definition: afeaturematcher.cpp:111
isae::AFeatureMatcher::_feature_label
std::string _feature_label
label for the features being matched
Definition: afeaturematcher.h:106
isae::AFeatureMatcher
Class for matching features between two sets of features.
Definition: afeaturematcher.h:25
AFeature2D.h
typedefs.h
isae::vec_match
std::vector< feature_pair > vec_match
A vector of feature pairs i.e. matches.
Definition: typedefs.h:24
aFeatureDetector.h
isae
Definition: AFeature2D.h:8
isae::AFeatureMatcher::filterMatches
vec_match filterMatches(vec_feat_matches &matches12, vec_feat_matches &matches21, vec_feat_matches_scores &all_scores12, vec_feat_matches_scores &all_scores21)
Filter matches based on the first and second best match scores.
Definition: afeaturematcher.cpp:63
Camera.h
isae::AFeatureMatcher::AFeatureMatcher
AFeatureMatcher()
Definition: afeaturematcher.h:27
isae::vec_feat_matches
std::unordered_map< std::shared_ptr< AFeature >, std::vector< std::shared_ptr< AFeature > > > vec_feat_matches
Unordered map to store matches between two feature lists.
Definition: afeaturematcher.h:14
isae::AFeatureMatcher::AFeatureMatcher
AFeatureMatcher(std::shared_ptr< AFeatureDetector > detector)
Definition: afeaturematcher.h:28
isae::AFeatureMatcher::_detector
std::shared_ptr< AFeatureDetector > _detector
feature detector for distance measurement
Definition: afeaturematcher.h:103
isae::AFeatureMatcher::getPossibleMatchesBetween
virtual void getPossibleMatchesBetween(const std::vector< std::shared_ptr< AFeature >> &features1, const std::vector< std::shared_ptr< AFeature >> &features2, const std::vector< std::shared_ptr< AFeature >> &features_init, const uint &searchAreaWidth, const uint &searchAreaHeight, vec_feat_matches &matches, vec_feat_matches_scores &all_scores)
Get possible matches between two sets of features.
Definition: afeaturematcher.cpp:6
isae::AFeatureMatcher::ldmk_match
virtual uint ldmk_match(std::shared_ptr< ImageSensor > &sensor1, std::vector< std::shared_ptr< ALandmark >> &ldmks, int searchAreaWidth=51, int searchAreaHeight=51)
Match landmarks with features in a given sensor.
Definition: afeaturematcher.cpp:152
isae::vec_feat_matches_scores
std::unordered_map< std::shared_ptr< AFeature >, std::vector< double > > vec_feat_matches_scores
Unordered map to store scores of matches between two feature lists.
Definition: afeaturematcher.h:17