Metadata-Version: 2.4
Name: orbslam3-python
Version: 1.0.0
Summary: Python bindings for the ORB-SLAM3 visual SLAM library
Maintainer-email: "Alex S." <savaalexandru562@gmail.com>
License: BSD 2-Clause License
        
        Copyright (c) 2016, jskinn
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Bug Tracker, https://github.com/AlexandruRO45/ORB_SLAM-PythonBindings/issues
Project-URL: Source, https://github.com/AlexandruRO45/ORB_SLAM-PythonBindings/
Project-URL: Documentation, https://github.com/AlexandruRO45/ORB_SLAM-PythonBindings/
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21.0
Requires-Dist: opencv-python>=4.5.0
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# ORB-SLAM3

Python bindings for the ORB-SLAM3 visual SLAM library.

## Installation

```bash
pip install orbslam3-python
```

<details>
  <summary>TODO (Click me)</summary>

# 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](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).
