Git Product home page Git Product logo

pydbow3's Introduction

Documentation Status https://travis-ci.org/foxis/pyDBoW3.svg?branch=master https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social

pyDBoW3

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()
voc.load("/slamdoom/libs/orbslam2/Vocabulary/ORBvoc.txt")
db = bow.Database()
db.setVocabulary(voc)
del voc
# extract features using OpenCV
...
# add features to database
for features in features_list:
  db.add(features)

# 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.

Note

Tested on these platforms:
  • OpenCV 3.4.2.16
  • 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

Windows

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.

Unix

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

Check .travis.yml for environment variables.

Mac OSX

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

Check .travis.yml for environment variables.

Note

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

Using under a conda environment (to use pre-installed version of OpenCV)

Build a conda environment, adding boost and cmake to it, something like:

conda create -n test_env python=3.5 opencv=3.3.1 cmake boost matplotlib numpy

## Unlink system boost installed by brew
brew unlink boost

Use build_under_conda.sh to build build/pyDBoW.dylink which is symlinked to build/pyDBoW.so. Add this to your conda environment by creating a .PTH file under /Users/<user_name>/anaconda3/envs/test_env/lib/python3.5/site-packages/pydbow3.pth containing /Users/<user_name>/pyDBoW3/build

pydbow3's People

Contributors

foxis avatar chrispjcc avatar schroederdewitt avatar vik748 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.