SaDVIO
alandmarkinitializer.h
Go to the documentation of this file.
1 #ifndef ALANDMARKINITIALIZER_H
2 #define ALANDMARKINITIALIZER_H
3 
4 #include <iostream>
5 #include <opencv2/core.hpp>
6 
8 #include "isaeslam/typedefs.h"
9 
10 namespace isae {
11 
12 class ImageSensor;
13 class AFeature;
14 class ALandmark;
15 
22 class ALandmarkInitializer : public std::enable_shared_from_this<ALandmarkInitializer> {
23  public:
24  ALandmarkInitializer() = default;
31  uint initFromMatch(feature_pair match);
32 
38  uint initFromMatches(vec_match matches);
39 
45  uint initFromFeatures(std::vector<std::shared_ptr<AFeature>> feats);
46 
47  protected:
54  std::shared_ptr<ALandmark> createNewLandmark(std::shared_ptr<AFeature> f1, std::shared_ptr<AFeature> f2);
55 
62  virtual bool initLandmark(std::vector<std::shared_ptr<AFeature>> features,
63  std::shared_ptr<ALandmark> &landmark) = 0;
64 
71  virtual bool initLandmarkWithDepth(std::vector<std::shared_ptr<AFeature>> features,
72  std::shared_ptr<ALandmark> &landmark) = 0;
73 
74  virtual std::shared_ptr<ALandmark> createNewLandmark(std::shared_ptr<AFeature> f) = 0;
75 };
76 
77 } // namespace isae
78 
79 #endif // ALANDMARKINITIALIZER_H
isae::ALandmarkInitializer::initFromMatch
uint initFromMatch(feature_pair match)
Initialize landmarks from a feature pair.
Definition: alandmarkinitializer.cpp:56
isae::ALandmarkInitializer::initFromMatches
uint initFromMatches(vec_match matches)
Initialize landmarks from a vector of feature matches.
Definition: alandmarkinitializer.cpp:7
isae::ALandmarkInitializer::createNewLandmark
std::shared_ptr< ALandmark > createNewLandmark(std::shared_ptr< AFeature > f1, std::shared_ptr< AFeature > f2)
Create a new landmark from a pair of features.
Definition: alandmarkinitializer.cpp:127
isae::ALandmarkInitializer::~ALandmarkInitializer
~ALandmarkInitializer()
Definition: alandmarkinitializer.h:25
typedefs.h
ALandmark.h
isae::vec_match
std::vector< feature_pair > vec_match
A vector of feature pairs i.e. matches.
Definition: typedefs.h:24
isae::ALandmarkInitializer::initFromFeatures
uint initFromFeatures(std::vector< std::shared_ptr< AFeature >> feats)
Initialize landmarks from a vector of feature tracks.
Definition: alandmarkinitializer.cpp:15
isae::ALandmarkInitializer::initLandmark
virtual bool initLandmark(std::vector< std::shared_ptr< AFeature >> features, std::shared_ptr< ALandmark > &landmark)=0
Initialize a landmark from a set of features.
isae
Definition: AFeature2D.h:8
isae::ALandmarkInitializer::initLandmarkWithDepth
virtual bool initLandmarkWithDepth(std::vector< std::shared_ptr< AFeature >> features, std::shared_ptr< ALandmark > &landmark)=0
Initialize a landmark from a set of features with depth information.
isae::feature_pair
std::pair< std::shared_ptr< isae::AFeature >, std::shared_ptr< isae::AFeature > > feature_pair
A pair of feature, useful to represent matches.
Definition: typedefs.h:22
isae::ALandmarkInitializer
Abstract class for initializing landmarks.
Definition: alandmarkinitializer.h:22
isae::ALandmarkInitializer::ALandmarkInitializer
ALandmarkInitializer()=default