Skip to main content

From an OpenDroneMap reconstruction, our goal is to see which part of the ortho photo is covered by each shot.

Project description

OpenDroneMap - A shot coverage report

From an OpenDroneMap reconstruction, our goal is to see which part of the orthophoto is covered by each shot.

We propose a web app with the orthophoto and camera positions displayed. Clicking on photo displays the covered area.

How to run it?

How to install

You need Python >= 3.8

pip install odm-report-shot-coverage

Processing

odm-report-shot-coverage PATH_TO_ODM_PROJECT

And follow the instructions to open the local web page. (Execution time is ~15 seconds for 60 images on a macbook pro)

How does it work?

From an OpenDroneMap reconstruction (odm by default), the reports needs access to the files stored in the project directory:

cameras.json
images/*
odm_report/shots.geojson
odm_report/stats.json
odm_orthophoto/odm_orthophoto.tif
odm_orthophoto/odm_orthophoto_corners.txt
odm_texturing_25d/odm_textured_model_geo.obj

The reporting tool odm-report-shot-coverage.py creates a directory odm_report/shot_coverage with a web page (index.html) containing the interactive report.

Browsing through the results

Open the odm_report/shot_coverage/index.html file and mouse over the shot position (blue dots) to see the image. Click on one or more shot to display the ground boundaries.

Limitations

No ray tracing

The shot boundaries are estimated based on the shot position and rotation, and the 2.5d model, but without ray tracing. Therefore, The extent of the shot boundaries is projected behind a higher structure.

Our purpose was at first to tackle rather flat area, shot from above. Therefore, this limitation is not a big deal in such situations.

Perspective projection

To map x,y,z points from the 2.5d model onto camera pixels, we use the perspective model, as I have not found the information for other projections (such as the Brown, used by the GoPro).

Code Architecture

Two main components:

  • Python to reconstruct the shot boundaries, resize original images and set up the web app directory
  • A JavaScript + D3.js for the front end

Python Processing

The code is in src/ and the entry point odm_report_shot_coverage/scripts/report.py.

Beside copying (and resizing) original images, setting up the web app, the main purpose is to recompute the shot boundaries:

  1. parse the 2.5d model from the odm_texturing_25d wavefront object file (only vertices are used)
  2. parse camera specs from cameras.json
  3. Extract the native coordinates system from stats.json
  4. Get shot position + rotation from shot.geojson; shot positions are shifted from native to the 25d model/ortho photo
  5. Convert and get the ortho photo boundaries
  6. For each vertex, see if they appear in the camera image (with the limitation of the perspective projective + absence of ray tracing described above)
  7. For each shot, compute the boundaries around the subset of vertices within each frame

JavaScript

Base on the web app asset + files computed by the Python processing, the code uses some d3.js

CI/CD

Being hosted on Github, we use actions for the CI/CD:

  • testing the Python code (pytest)
  • linting and security check
  • deployment on Azure static web app

Author

Alexandre Masselot (alexandre.masselot@gmail.com), with the help of the vibrant ODM community.

License

MIT

Project details


Download files

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

Source Distribution

odm-report-shot-coverage-0.1.4.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

odm_report_shot_coverage-0.1.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file odm-report-shot-coverage-0.1.4.tar.gz.

File metadata

File hashes

Hashes for odm-report-shot-coverage-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5134ccc1d379a01c5203c862517e54e9da1037fa8bc31e93e8b173494d90c10d
MD5 f3f8aeef65fabf5879c90f90bcb6f6b8
BLAKE2b-256 8559cf491d4deb29e9b3aa60728b731fda97f603411bb2cdc06b1cd0ea417957

See more details on using hashes here.

File details

Details for the file odm_report_shot_coverage-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for odm_report_shot_coverage-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7d534a4245791bbd0bc7eeded381626f7417efab6673d12f7596ef43329fc33d
MD5 d6681c78d91e6cb19ce5b4f63866d6b5
BLAKE2b-256 538da03560c148e53df612ca76cb8a5d34d1e2778ef36cc0bcaefdc260354e97

See more details on using hashes here.

Supported by

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