Skip to main content

Enhanced Python bindings for ORB-SLAM3 with hardware adaptation and performance monitoring

Project description

ORB-SLAM3

Python bindings for the ORB-SLAM3 visual SLAM library.

Installation online via pypi

pip install orbslam3-python

Installation locally

1. Basic installation (enhanced bindings by default)

pip install -e .

2. Legacy bindings only

BUILD_ENHANCED_BINDINGS=OFF pip install -e .

3. Enhanced bindings with CUDA support

BUILD_ENHANCED_BINDINGS=ON ENABLE_CUDA=ON pip install -e .

4. Development installation with all tools

pip install -e ".[dev]"

5. With custom Pangolin path

export Pangolin_DIR="/path/to/Pangolin/build"
pip install -e .

6. Debug build

CMAKE_BUILD_TYPE=Debug pip install -e .

7. Custom parallel build jobs

CMAKE_BUILD_PARALLEL_LEVEL=4 pip install -e .
TODO (Click me)

Changes from Original Version of ORB_SLAM2-PythonBindings

add method for retrieve the intrinsic parameter of camera

    get_camera_matrix //return a numpy array with the camera matrix
    get_dist_coef //return a tuple with the distortion coefficient

add method for retrieve the pose of the frame wrt initial frame

    get_frame_pose //return a numpy array with the pose

add method for retrieve the keypoint in the frame and it's world position

    get_current_points //return a list with a tuple pair ((world position),(2d keypoints))

add python 3.8 Support

ORB_SLAM2-PythonBindings

A python wrapper for ORB_SLAM2, which can be found at https://github.com/raulmur/ORB_SLAM2. This is designed to work with the base version of ORB_SLAM2, with a couple of minimal API changes to access the system output. It has been tested on ubuntu 14.04 and 16.04 and built against Python3, although it does not rely on any python3 features.

Installation

Prerequesities

  • ORBSLAM2 source code
  • ORBSLAM2 compiliation dependencies (Pangolin, Eigen, OpenCV)
  • Boost, specifically its python component (python38)
  • Numpy development headers (to represent images in python, automatically converted to cv::Mat)

Setup

Modifying ORBSLAM2

First, we need an additional API method from ORBSLAM to extract completed trajectories. Apply the patch file "orbslam-changes.diff" to the ORBSLAM2 source, which should create an additional method and add some installation instructions to the end of CMakeLists.txt. Build orbslam as normal, and then run make install. This will install the ORBSLAM2 headers and .so to /usr/local (if an alternative installation directory is desired, specify it to cmake using -DCMAKE_INSTALL_PREFIX=/your/desired/location).

Compilation

Return to the ORBSLAM-Python source, build and install it by running

mkdir build
cd build
cmake ..
make
make install

This will install the .so file to /usr/local/lib/python3.5/dist-packages, such that it should If you have changed the install location of ORBSLAM2, you need to indicate where it is installed using -DORB_SLAM2_DIR=/your/desired/location, which should be the same as the install prefix above (and contain 'include' and 'lib' folders).

Verify your installation by typing

python3
>>> import orbslam2

And there should be no errors.

Examples

ORBSLAM2's examples have been re-implemented in python in the examples folder. Run them with the same parameters as the ORBSLAM examples, i.e.:

python3 orbslam_mono_kitti.py [PATH_TO_ORBSLAM]/Vocabulary/ORBvoc.txt [PATH_TO_ORBSLAM]/Examples/Monocular/KITTI00-02.yaml [PATH_TO_KITTI]/sequences/00/

Alternative Python Versions

At the moment, CMakeLists is hard-coded to use python 3.5. If you wish to use a different version, simply change the boost component used (python-35) to the desired version (say, python-27), on line 38 of CMakeLists.txt. You will also need to change the install location on line 73 of CMakeLists.txt to your desired dist/site packages directory.

License

This code is licensed under the BSD Simplified license, although it requires and links to ORB_SLAM2, which is available under the GPLv3 license

It uses pyboostcvconverter (https://github.com/Algomorph/pyboostcvconverter) by Gregory Kramida under the MIT licence (see pyboostcvconverter-LICENSE).

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (40.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_aarch64.whl (24.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (40.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_aarch64.whl (24.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (40.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_aarch64.whl (24.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_x86_64.whl (40.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_aarch64.whl (24.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_x86_64.whl (40.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_aarch64.whl (24.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

File details

Details for the file orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a1252c9e52dd4d3488062af9ff9abf175870e47cc579a7eab72b917d9258884a
MD5 48eba31cb81c7a6395e134865d41cf8e
BLAKE2b-256 bab262cfdc98980e1506a08c116734af44541634c3785c43a601d8a516e225de

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7aac6256d87d156b0414f00b2c40cf994cddc7617b5f5114690f2bb7d5d04d48
MD5 66895deceb3f933a6f6f5d0dfa51b310
BLAKE2b-256 0e80c8a8d4041b06749d736c6fbade6f8f92f62a73e8962eabf25d4df6f8757e

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 700624a2eeb39773c4f3d3d4d192af4429971328bddc530a1f6ab8ab1c0980f6
MD5 9a77ba377b5f3ee405e5d4eb30c204e0
BLAKE2b-256 b76b1a9962a51808b09636acb3aa4512a9362f86af93d765dd94874bfae1a74b

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7871e13755df247a96b800f1c3e2a4cfeed127577dd4fcfece019c33c72145f4
MD5 4fc823ad56c98e7db2549fbfad1d60c9
BLAKE2b-256 d96611045796cf8f1fccb88bb109e48f23f6ad7eec1ceb70c60151750a601307

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fd9f5f421f96f322a22caacdfc7443c79f369bc4f9790a8360ad912501806f93
MD5 13893b979247b00a89fad10a17fb68fb
BLAKE2b-256 4577cb5f4de22eaa3da5290a7315ec7d389a3cb86b7e73cfe8f613277de8ce62

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1ef2983f49303825c50ace647f877c434d97a6b28e66a82d131ee0beaf840d67
MD5 5d6748f3b906cbed117a81ac9bc3bdcb
BLAKE2b-256 d2673c9d223e695fab6727df0c353cb68a43cd6ff9b779fef825cc7df079d5cf

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 473c26ce234d3f80d89e65c8f282d6c5b6ab07599bcc89522f7610ba5a760f0b
MD5 b814e63fabbd7b99e212a6ed71fe24b2
BLAKE2b-256 332ba857366270216024fd43d3945056f1445581a89ce0b3cf76bb2017691352

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 095e1f139c698f3ff0fa21c01ea7741b2c5778b80b89ebf8a272eedc3f85c9f2
MD5 0811810a32ba183d608eb75ff8c4dc55
BLAKE2b-256 4814ac01df91b2a67516bde7c30d810e6802e7a34f8b2e86a926740fabf73e45

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6bf01f8973c1b3a38e85c7b9a440016a98ea071dc9385f39b7663a512f838de
MD5 a57954b42459b1a4a5dab35ac438cb43
BLAKE2b-256 530fdc982a998e192d892028e201fbbdfb9a130494e0dfed03975d7ac9fe3651

See more details on using hashes here.

File details

Details for the file orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for orbslam3_python-2.0.0-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ba1d0cd10c4541b1b3ac8eee1b4fcbb15e0b97a3a3e69c59f4fde5a935cf6672
MD5 3277b6c80642f2276b1a0e7821e90c51
BLAKE2b-256 f4819cb7792049a49764744033ea61b8b2e19cfc5e42aac9892e03c4769e8752

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page