open-forest-observatory / automate-metashape

Easy, reproducible Metashape photogrammetry workflows
Other
76 stars 27 forks source link

Reduce interdependency DEM and ortho generation, or document clearly #51

Open russelldj opened 2 months ago

russelldj commented 2 months ago

I noticed that the DEM/DSM and orthomosaic computation are tightly coupled in build_dem_orthomosaic. My understanding is this is because metashape does not allow granular control over which geometry source is used, only whether it is elevation or mesh. So the only way to control this is to have the intended surface be the last one generated.

The way the code is structured now, orthomosaic creation will be silently skipped if you disable the DEM stage, except if it is just the mesh based ortho. I encountered this issue because my process died in the middle of the orthomosaic stage and I wanted to restart just that step.

This is entirely speculative, but I wonder if we could check for the requested elevation data (DSM/DTM) and then try to "activate" it before running the ortho step. This would decouple the process. If something like this is not possible, I would update the documentation to clearly state that the desired elevation source must be computed specifically in that run and cannot be loaded from a previous project.

youngdjn commented 2 months ago

Great catch, I agree this should be a priority. The Metashape GUI displays the existence of multiple DEMs in a project (not just the last generated) -- so it is clear that multiple can be stored. This indeed will hinge on us finding a way to "activate" the DEM that we want to be used for ortho generation. (The GUI-based ortho generation menu does not have an option for this). Perhaps this could be a good early task for @asidhu0 . I just posted on the Agisoft forum requesting guidance.

russelldj commented 1 month ago

Some takeaways from our discussion.