ScoringObject.h
Go to the documentation of this file.
1 
10 #ifndef __D_T_SCORING_OBJECT__
11 #define __D_T_SCORING_OBJECT__
12 
13 #include "BowVector.h"
14 
15 namespace DBoW2 {
16 
19 {
20 public:
28  virtual double score(const BowVector &v, const BowVector &w) const = 0;
29 
36  virtual bool mustNormalize(LNorm &norm) const = 0;
37 
39  static const double LOG_EPS;
40  // If you change the type of WordValue, make sure you change also the
41  // epsilon value (this is needed by the KL method)
42 
43  virtual ~GeneralScoring() {}
44 
45 };
46 
53 #define __SCORING_CLASS(NAME, MUSTNORMALIZE, NORM) \
54  NAME: public GeneralScoring \
55  { public: \
56  \
62  virtual double score(const BowVector &v, const BowVector &w) const; \
63  \
64  \
69  virtual inline bool mustNormalize(LNorm &norm) const \
70  { norm = NORM; return MUSTNORMALIZE; } \
71  }
72 
74 class __SCORING_CLASS(L1Scoring, true, L1);
75 
77 class __SCORING_CLASS(L2Scoring, true, L2);
78 
80 class __SCORING_CLASS(ChiSquareScoring, true, L1);
81 
83 class __SCORING_CLASS(KLScoring, true, L1);
84 
86 class __SCORING_CLASS(BhattacharyyaScoring, true, L1);
87 
89 class __SCORING_CLASS(DotProductScoring, false, L1);
90 
91 #undef __SCORING_CLASS
92 
93 } // namespace DBoW2
94 
95 #endif
96 
virtual ~GeneralScoring()
Required for virtual base classes.
Definition: ScoringObject.h:43
virtual double score(const BowVector &v, const BowVector &w) const =0
virtual bool mustNormalize(LNorm &norm) const =0
Base class of scoring functions.
Definition: ScoringObject.h:18
class __SCORING_CLASS(L1Scoring, true, L1)
L1 Scoring object.
LNorm
L-norms for normalization.
Definition: BowVector.h:29
Vector of words to represent images.
Definition: BowVector.h:56
static const double LOG_EPS
Log of epsilon.
Definition: ScoringObject.h:39
TFSIMD_FORCE_INLINE const tfScalar & w() const


orb_slam2_ros
Author(s):
autogenerated on Wed Apr 21 2021 02:53:05