📖
Wiki
Back to my personal website
  • Home
  • Equipment and Devices
    • 3D Printer
    • Laser Cutter
    • Motion Capture System
    • Sensors
      • RGB-D Cameras
      • Velodyne LiDAR
      • Zed Camera
      • RealSense D435i
      • IMU
    • eGPU
    • Nvidia AGX Xavier
    • CPU Benchmark
    • Installation Checklist
  • Development
    • Linux
      • Shell
      • GDB
      • Git
      • Tmux
      • Network
      • Tricks
      • Debug FAQ
    • CMake
      • Catkin Tools
      • CMakeLists
      • CMake Variables
      • CMake Commands
      • CMake: find_package()
    • ROS
      • Gazebo
      • wstool
      • roslaunch
      • rosbag
      • multi-threaded spinner
    • ROS2
      • Convert ROS1 bag to ROS2 bag
    • C++
      • C++ 11
      • C++ Examples
      • C++ Debug
      • Factory Method
      • Timing
    • Google Tools
      • GLog
      • GFlags
      • GTest
      • Style Guide
      • Clang Format
    • PCL
      • Point Type
      • Methods
      • Architecture
      • Code Explained
    • Open3D
      • Python API
      • Registration
      • Visualization
      • Tools
    • OpenCV
      • Documentation
      • Modules
    • Other Libraries
      • Eigen
      • Ceres
      • g2o
      • GTSAM
    • Website
  • Algorithm
    • SLAM
      • K-D Tree
      • Octree
      • Bag of Words
      • Distance Measures
      • Coordinate Systems
      • LOAM
      • Iterative Closest Point
      • Generalized ICP
      • Mahalanobis Distance
    • Computer Science
      • Computational Model
      • Sorting
      • Analysis
      • Complexity Classes (P, NP)
      • Divide and Conquer
      • Greedy Algorithm
      • Dynamic Programming
      • Tree
      • Graph
    • Computer Vision
      • Camera Models
      • Distortion
      • Motion Models
      • Shutter
      • Image Sensors
      • Epipolar Geometry
      • Multiple-View Geometry
    • Datasets
      • RGB-D Datasets
      • Point Cloud Datasets
      • LiDAR SLAM Datasets
  • Math
    • Optimization
      • Convex Optimization
      • Descent Methods
    • Probability
      • Moment
      • Covariance Matrix
      • Stochastic Process
    • Topology
      • References
      • Concepts
      • Topological Spaces
      • Representation of Rotations
      • Representation of 3-sphere
    • Algebra
      • Linear Algebra
      • Matrix Factorization
      • Condition Number
      • Matrix Lie Group
    • Differential Geometry
      • Manifold
      • Submanifold
      • Quotient Manifolds
      • Tangent Space
  • Quadrotor
    • PX4 Development
    • Companion Computer
    • Drone Hardware
    • Propeller Lock
    • Debug
  • Favorites
    • Bookmarks
Powered by GitBook
On this page
  • DBoW Library
  • References

Was this helpful?

  1. Algorithm
  2. SLAM

Bag of Words

PreviousOctreeNextDistance Measures

Last updated 3 years ago

Was this helpful?

DBoW Library

The library is composed of two main classes: Vocabulary and Database. The former is trained offline with numerous images, whereas the latter can be established/expanded online. Both structures can be saved in binary or text format.

Weighting

Words in the vocabulary and in bag-of-words vectors are weighted. There are four weighting measures implemented to set a word weight wi:

  • Term frequency (tf): , : number of occurrences of word i in document d, : number of words in document d.

  • Inverse document frequency (idf): , : number of documents, : number of documents containing word i.

  • Term frequency -- inverse document frequency (tf-idf): .

  • Binary:

DBow calculates N and Ni according to the number of images provided when the vocabulary is created. These values are not changed and are independent of how many entries a Database object contains.

Scoring

A score is calculated when two vectors are compared by means of a Vocabulary or when a Database is queried. These are the metrics implemented to calculate the score s between two vectors v and w (from now on, v* and w* denote vectors normalized with the L1-norm):

  • Dot product:

  • L1-norm:

  • L2-norm:

  • Bhattacharyya coefficient:

  • χ² (chi-square) distance:

  • KL-divergence:

The default configuration when creating a vocabulary is tf-idf, L1-norm.

References

dorian3d/DBow
dorian3d/DBoW2
rmsalinas/DBow3
rmsalinas/fbow
w_i = log(\frac{N}{N_i})
N_i
w_i = \frac{n_{id}}{n_d}
n_{id}
n_d
N
w_i = \frac{n_{id}}{n_d} log(\frac{N}{N_i}
L2-norm
L1-norm
Dot product
Bhattacharyya coefficient
w_i = 1 if word i is present; 0 otherwise
Chi square distance
KL-divergence