Pythonic implementation of an ORB feature matching based Monocular-vision SLAM.
Simultaneous Localization and Mapping (SLAM) has been there for quite a while, but it has gained much popularity with the recent advent of Autonomous Navigation and self-driving cars. SLAM is like a perception that aids a robot/device to find it's relative position in an unknown environment. Applications of which extend from Augmented Reality, virtual reality, indoor navigation and Autonomous vehicles.
This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.
The application begins with calibrating the camera and setting the camera intrinsic for optimization. It makes use of OpenCV's ORB feature mapping function for key-point extraction. Lowe's ratio test is used for mapping the key-points. Each detected key-point from the image at '(t-1)' interval is matched with a number of key-points from the 't' interval image. The key-points with the least distance is kept based on the several generated. Lowe's test checks that the two distances are sufficiently different. If they are not, then the key-point is eliminated and will not be used for further calculations. For 2D video visualization, I had a couple of choices: OpenCV, SDL2, PyGame, Kivy, Matplotlib, etc. Turns out OpenCV's imshow function might not be the best choice. The application made use of SDL2, matplolib and kivy's video playing libraries but PyGame was outperformed all of them. Thus, I used PyGame for visualizing the detected keypoints and various other information such as orientation, direction and speed.
For 3D visualization, Pangolin was the best option due to various reasons such as:
This is an example of how to list things you need to use the software and how to install them.
pip3 install opencv-python
python3 -m pip install -U pygame --user
pip3 install numpy
git clone https://github.com/Akbonline/SLAMPy-Monocular-SLAM-implementation-in-Python.git
python3 slam.py <test-video.mp4>
There is one test video included in the repo.
python3 slam.py test.mp4
The output should look something like this:
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.