OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.81k stars 1.09k forks source link

Computing depthmaps over splitmerge datasets #1101

Open linusmartensson opened 4 years ago

linusmartensson commented 4 years ago

How did you install OpenDroneMap? (Docker, natively, ...)?

Docker

What's your browser and operating system? (Copy/paste the output of https://www.whatismybrowser.com/)

Chrome on Linux

What is the problem?

When running splitmerge with very few images per split - or short tracks as may be the case with #1076 - the step resulting in merged.ply may execute successfully, but result in an empty point cloud:

[INFO]    running /usr/bin/env python2 /code/SuperBuild/src/opensfm/bin/opensfm compute_depthmaps "/datasets/code/submodels/submodel_0002/opensfm"
2020-04-16 13:10:56,837 INFO: Computing neighbors
2020-04-16 13:10:57,350 INFO: Using precomputed raw depthmap DJI_0443.JPG
2020-04-16 13:10:57,607 INFO: Using precomputed raw depthmap DJI_0442.JPG
2020-04-16 13:10:57,610 INFO: Using precomputed clean depthmap DJI_0443.JPG
2020-04-16 13:10:57,612 INFO: Using precomputed clean depthmap DJI_0442.JPG
2020-04-16 13:10:57,616 INFO: Using precomputed pruned depthmap DJI_0443.JPG
2020-04-16 13:10:57,618 INFO: Using precomputed pruned depthmap DJI_0442.JPG
2020-04-16 13:10:57,618 INFO: Merging depthmaps

After this, some more stages succeed, but the application then fails to extract a bounding box in:

[INFO]    running pdal info /datasets/code/submodels/submodel_0002/odm_filterpoints/point_cloud.ply > /tmp/tmpIwmnA7.json

The root cause is apparently that merged.ply is empty. Empty as in a valid header, but zero points. This aborts execution of all subsequent submodels and the final merge.

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.

There are many possible ways to solve this. The most applicable one in my case would be for the system to be fault tolerant and continue running, then do the merge while ignoring that particular submodel.

How can we reproduce this? (What steps did you do to trigger the problem? What parameters are you using for processing? If possible please include a copy of your dataset uploaded on Google Drive or Dropbox. Be detailed)

Try creating a splitmerge dataset with "--split 2 --split-overlap 0" - or whatever low number causes opensfm to fail silently when generating the point cloud in a submodel.

linusmartensson commented 4 years ago

Found the root cause, the pruner killed all points on this clause:

depthmap_min_consistent_views: 3

If a track is shorter than min_consistent_views, all points are of course pruned.

I guess the real question then is how to handle such a short track. Do we delete it and lose data, do we maintain it and reduce min_consistent_views for the submodel? Or, third option, maintain the data, generate the empty merged model, and then do error checking to continue execution in other submodels and during the merge, even if this submodel track can't be rendered?

linusmartensson commented 4 years ago

In the track split handling of #1076, I'm running with the second option for now. It seems to be working and doesn't affect existing code.