SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
FeatureExtractorFactory Class Reference

#include <FeatureExtractorFactory.h>

Public Member Functions

 FeatureExtractorFactory ()
 
std::unique_ptr< ORB_SLAM2::KPextractor > make (ExtractorType id, const cv::Size &videoFrameSize, int nLevels)
 
std::unique_ptr< ORB_SLAM2::KPextractor > make (std::string extractorType, const cv::Size &videoFrameSize, int nLevels)
 
const std::vector< std::string > & getExtractorIdToNames () const
 

Private Member Functions

std::unique_ptr< ORB_SLAM2::KPextractor > orbExtractor (int nf, int nLevels)
 
std::unique_ptr< ORB_SLAM2::KPextractor > briefExtractor (int nf, int nLevels)
 
std::unique_ptr< ORB_SLAM2::KPextractor > glslExtractor (const cv::Size &videoFrameSize, int nbKeypointsBigSigma, int nbKeypointsSmallSigma, float highThrs, float lowThrs, float bigSigma, float smallSigma)
 

Private Attributes

std::vector< std::string > _extractorIdToNames
 

Detailed Description

Definition at line 23 of file FeatureExtractorFactory.h.

Constructor & Destructor Documentation

◆ FeatureExtractorFactory()

FeatureExtractorFactory::FeatureExtractorFactory ( )

Definition at line 9 of file FeatureExtractorFactory.cpp.

10 {
20 }
@ ExtractorType_FAST_ORBS_2000
@ ExtractorType_FAST_ORBS_3000
@ ExtractorType_FAST_BRIEF_4000
@ ExtractorType_FAST_ORBS_1000
@ ExtractorType_FAST_ORBS_4000
@ ExtractorType_FAST_BRIEF_1000
@ ExtractorType_FAST_BRIEF_2000
@ ExtractorType_FAST_BRIEF_3000
@ ExtractorType_Last
std::vector< std::string > _extractorIdToNames

Member Function Documentation

◆ briefExtractor()

std::unique_ptr< KPextractor > FeatureExtractorFactory::briefExtractor ( int  nf,
int  nLevels 
)
private

Definition at line 87 of file FeatureExtractorFactory.cpp.

89 {
90  float fScaleFactor = 1.2f;
91  int fIniThFAST = 20;
92  int fMinThFAST = 7;
93  return std::make_unique<ORB_SLAM2::BRIEFextractor>(nf,
94  fScaleFactor,
95  nLevels,
96  fIniThFAST,
97  fMinThFAST);
98 }

◆ getExtractorIdToNames()

const std::vector<std::string>& FeatureExtractorFactory::getExtractorIdToNames ( ) const
inline

Definition at line 30 of file FeatureExtractorFactory.h.

31  {
32  return _extractorIdToNames;
33  }

◆ glslExtractor()

std::unique_ptr< KPextractor > FeatureExtractorFactory::glslExtractor ( const cv::Size &  videoFrameSize,
int  nbKeypointsBigSigma,
int  nbKeypointsSmallSigma,
float  highThrs,
float  lowThrs,
float  bigSigma,
float  smallSigma 
)
private

Definition at line 101 of file FeatureExtractorFactory.cpp.

109 {
110  // int nbKeypointsBigSigma, int nbKeypointsSmallSigma, float highThrs, float lowThrs, float bigSigma, float smallSigma
111  return std::make_unique<GLSLextractor>(videoFrameSize.width,
112  videoFrameSize.height,
113  nbKeypointsBigSigma,
114  nbKeypointsSmallSigma,
115  highThrs,
116  lowThrs,
117  bigSigma,
118  smallSigma);
119 }

◆ make() [1/2]

std::unique_ptr< KPextractor > FeatureExtractorFactory::make ( ExtractorType  id,
const cv::Size &  videoFrameSize,
int  nLevels 
)

Definition at line 22 of file FeatureExtractorFactory.cpp.

25 {
26  switch (id)
27  {
29  return orbExtractor(1000, nLevels);
31  return orbExtractor(2000, nLevels);
33  return orbExtractor(3000, nLevels);
35  return orbExtractor(4000, nLevels);
37  return briefExtractor(1000, nLevels);
39  return briefExtractor(2000, nLevels);
41  return briefExtractor(3000, nLevels);
43  return briefExtractor(4000, nLevels);
44  /*
45  #ifndef TARGET_OS_IOS
46  case ExtractorType_GLSL_1:
47  return glslExtractor(videoFrameSize, 16, 16, 0.5f, 0.10f, 1.9f, 1.3f);
48  case ExtractorType_GLSL:
49  return glslExtractor(videoFrameSize, 16, 16, 0.5f, 0.10f, 1.9f, 1.4f);
50  #endif
51  */
52  default:
53  return orbExtractor(1000, nLevels);
54  }
55 }
std::unique_ptr< ORB_SLAM2::KPextractor > orbExtractor(int nf, int nLevels)
std::unique_ptr< ORB_SLAM2::KPextractor > briefExtractor(int nf, int nLevels)

◆ make() [2/2]

std::unique_ptr< KPextractor > FeatureExtractorFactory::make ( std::string  extractorType,
const cv::Size &  videoFrameSize,
int  nLevels 
)

Definition at line 57 of file FeatureExtractorFactory.cpp.

60 {
61  std::unique_ptr<KPextractor> result = nullptr;
62 
63  for (int i = 0; i < _extractorIdToNames.size(); i++)
64  {
65  if (_extractorIdToNames[i] == extractorType)
66  {
67  result = make((ExtractorType)i, videoFrameSize, nLevels);
68  break;
69  }
70  }
71 
72  return result;
73 }
std::unique_ptr< ORB_SLAM2::KPextractor > make(ExtractorType id, const cv::Size &videoFrameSize, int nLevels)

◆ orbExtractor()

std::unique_ptr< KPextractor > FeatureExtractorFactory::orbExtractor ( int  nf,
int  nLevels 
)
private

Definition at line 75 of file FeatureExtractorFactory.cpp.

76 {
77  float fScaleFactor = 1.2f;
78  int fIniThFAST = 20;
79  int fMinThFAST = 7;
80  return std::make_unique<ORB_SLAM2::ORBextractor>(nf,
81  fScaleFactor,
82  nLevels,
83  fIniThFAST,
84  fMinThFAST);
85 }

Member Data Documentation

◆ _extractorIdToNames

std::vector<std::string> FeatureExtractorFactory::_extractorIdToNames
private

Definition at line 49 of file FeatureExtractorFactory.h.


The documentation for this class was generated from the following files: