GithubHelp home page GithubHelp logo

kylesayrs / pyslam-d Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 8.48 MB

pySLAM-D is a real-time SLAM algorithm for UAV aerial stitching. Includes additional features and refactored code inspired by BU's implementation https://github.com/armandok/pySLAM-D

Python 100.00%
computer-vision gtsam opencv real-time slam stitching visual-odometry uav

pyslam-d's Introduction

PySLAM-D

PySLAM-D is a UAV-tailored SLAM stitching inspired by pySLAM-D which was developed in partnership with GreenSight Agronomics. This implementation significantly increases the robustness and usability of the initial design, includes functional documentation, and implements additional matching options and parameters.

Example Stitching

Technical explaination

The Pyslam-D live stitching algorithm works by generating a factor graph whose nodes are each camera’s pose in georeferenced 3D space and whose edges (factors) are the relative pose transformations from one node to another. During the optimization step, the nodes of the factor graph are optimized for spatial consistency, meaning that even noisy sensor measurements can still reinforce one another to produce a consistent estimation of camera poses.

The first factor type, odometry factors, are determined by performing visual odometry between neighboring images and using point cloud registration to estimate the pose transformation between the two images. These factors can be computationally expensive, but help neighboring images “mesh” with each other independently of instrument noise.

The second factor type, gps factors, help to determine the camera's absolute position. These factors are often noisy, but are valuable for compensating for bad odometry estimates. The error produced by GPS, unlike relative odometry error, is independent of flight duration, meaning that these factors prevent images from drifting away from their true, georeferenced positions over time.

The third factor type, attitude factors, incorporate attitude measurements from the drone when the picture was taken. These factors improve estimates of image rotation and can be used as a prior for the odometry area of overlap, making odometry matching faster and increasing robustness to low overlap and high attitude datasets.

One known bug is that this implementation projects images directly downwards from the camera position. Future work will project the image with respect to the orientation of the camera, therefore better supporting non-gimbaled payloads.

Example Stitching

Installation

  1. Install pyslamd
git clone https://github.com/kylesayrs/pySLAM-D
python3 -m pip install -e .
  1. Install GTSAM
  2. Install TEASER-plusplus

Use cmake .. -DENABLE_DIAGNOSTIC_PRINT=OFF to turn off debug messages for teaser

Usage

Edit src/pyslamd/Settings.py to adjust stitching settings. In the future these settings will be documented as script arguments

pyslamd.stitch path/to/image/directory

Images must be geotagged with gps coordinates in order to georeference frame poses within a real world coordinate frame.

pyslam-d's People

Contributors

kylesayrs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyslam-d's Issues

test dataset

Hi, please can I ask what test data you are using? I am using images taken by a DJI Drone and the exif metadata does not contain ["GPSImgDirection"].

Traceback (most recent call last):
  File "/home/dubing/anaconda3/bin/pyslamd.stitch", line 33, in <module>
    sys.exit(load_entry_point('Pyslamd', 'console_scripts', 'pyslamd.stitch')())
  File "/home/dubing/code/pySLAM-D/src/pyslamd/main.py", line 56, in main
    tracker.process_image(image_path)
  File "/home/dubing/code/pySLAM-D/src/pyslamd/Tracker.py", line 58, in process_image
    frame = self._add_frame(image_path)
  File "/home/dubing/code/pySLAM-D/src/pyslamd/Tracker.py", line 143, in _add_frame
    frame = Frame(image_path, len(self.frames), self.settings)
  File "/home/dubing/code/pySLAM-D/src/pyslamd/Frame.py", line 42, in __init__
   self.gps_coords, self.imu_orientation = get_exif_measurements(image_path, settings)
  File "/home/dubing/code/pySLAM-D/src/pyslamd/utils/exif.py", line 20, in get_exif_measurements
    imu_orientation = _get_imu_orientation(exif_data, settings.payload)
  File "/home/dubing/code/pySLAM-D/src/pyslamd/utils/exif.py", line 86, in _get_imu_orientation
    else -1 * float(exif_data["GPSImgDirection"]) + settings.yaw_offset  # the -1 was found emperically
KeyError: 'GPSImgDirection'

test dataset

Hello, can you share a test dataset? I'm not getting good results with some datasets and suspect that there might be differences in the IMU part. However, I'm not sure about the specific differences. If you could share a test dataset, I believe it would help me gain a better understanding.

my_test_result

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.