Skip to main content

Python wrappers for DBoW3 library.

Project description

Documentation Status!--None.svg?style=social


Ultra-fast Boost.Python interface for DBoW3

This repo was created in order to interface DBoW algorithm from python in another project EasyVision. It is being used for a simple topological SLAM implementation since OpenCV BowKMeansTrainer doesn’t work with binary features.

If you wish you use it on your own it is as easy as:

import pyDBoW3 as bow
voc = bow.Vocabulary()
db = bow.Database()
del voc
# extract features using OpenCV
# add features to database
for features in features_list:

# query features
feature_to_query = 1
results = db.query(features_list[feature_to_query])

del db

This repository was created based on pyORBSLAM2 and ndarray to cv::Mat conversion on numpy-opencv-converter.


Tested on these platforms:
  • OpenCV
  • Windows 10 msvc 2017 x64
  • xenial with Python 2.7, libboost 1.54 (autobuild with travis)
  • xenial with Python 3.5, libboost 1.54 (autobuild with travis)

Get started


Prerequisites: * OpenCV * Python with Numpy and opencv-contrib-python * Boost >1.54 * cmake * Microsoft Visual Studio

To build Boost.Python, go to Boost root and run:

bootstrap.bat --prefix=/dir/to/Boost.Build

Then build Boost.Python like this:

/dir/to/Boost.Build/b2 --with-python threading=multi variant=release link=static

To build DBoW3, simply run build.bat file and then build solution folder in install/DBoW3/build and then the solution in build folder.

Currently there is no python package generation, so you could simply copy pyDBoW3.pyd and opencv_world*.dll files to your virtual environment.


Use to build build/, which you should then put on your PYTHONPATH.

Check .travis.yml for environment variables.


You will probably need to run sudo make install for install/opencv/build to install it on your system.

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyDBoW3, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size pyDBoW3-0.2-cp37-cp37m-win_amd64.whl (24.0 MB) File type Wheel Python version cp37 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page