OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷

Home Page:https://opendronemap.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DJI P1 Sensor is not being handled correctly for SFM Triangulation

summitbri opened this issue · comments

How did you install ODM? (Docker, installer, natively, ...)?

Docker 3.0.5

What is the problem?

Camera orientation isn't being parsed correctly, as evidenced with attached dataset (21 images). Incremental process works fine, triangulation does not.

https://community.opendronemap.org/t/sfm-triangulation-and-orthophotos-very-strange-results/14597/9

What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.

SFM triangulation should produce an ortho that isn't 'garbled'.

Examples from sample provided dataset:

Triangulation:
image

Incremental:
image

How can we reproduce this? What steps did you do to trigger the problem? If this is an issue with processing a dataset, YOU MUST include a copy of your dataset AND task output log, uploaded on Google Drive or Dropbox (otherwise we cannot reproduce this).

docker run -ti --detach --rm --tty --name odm_container -v /odm/datasets/project:/datasets/code opendronemap/odm --project-path /datasets
--auto-boundary
--orthophoto-resolution 1.5
--gps-accuracy 0.03
--sfm-algorithm triangulation
--rerun-from dataset

21 image dataset here: https://drive.google.com/drive/folders/1TVp9oM4i6AEL60KjhxL45CdB5RvP1eoN?usp=share_link

The root cause is that we always assume that the camera is mounted facing down.

https://github.com/OpenDroneMap/ODM/blob/master/opendm/photo.py#L882

            # Convert between image and body coordinates
            # Top of image pixels point to flying direction
            # and camera is looking down.
            # We might need to change this if we want different
            # camera mount orientations (e.g. backward or sideways)

            # (Swap X/Y, flip Z)
            cbb = np.array([[0, 1, 0],
                            [1, 0, 0],
                            [0, 0, -1]])

The P1 has the ability to move the camera independently from the drone body, but that behavior is not modeled.

We'd welcome a PR that helps to improve this.