Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dem2mesh #904

Merged
merged 27 commits into from
Nov 1, 2018
Merged

Dem2mesh #904

merged 27 commits into from
Nov 1, 2018

Conversation

pierotofy
Copy link
Member

@pierotofy pierotofy commented Oct 19, 2018

This is a series of changes that replace odm_dsm2points and the call to PoissonRecon, which is the current approach to 2.5D meshing, with a new program, odm_dsm2mesh, which uses a gridded + quadratic simplification tiled approach to meshing.

The approach creates higher fidelity meshes from a DSM, keeps the memory usage linear via tile splitting (the mesh is split into tiles before triangulation and each tile is processed independently, then merged at the end), creates good sized triangles (important for texturing) and is reasonably fast.

image

I will post screenshots of orthophotos for comparison to the current method in the next several days, but I thought I'd ask for early feedback and some help with testing.

Given the novelty of the method, I was also thinking of publishing the odm_dsm2mesh program in a separate repository and pull it into the ODM build process. Let me know your thoughts about that. 😄

@pierotofy
Copy link
Member Author

Future areas of improvement / research include DSM filtering and adding multi-threaded support.

@smathermather
Copy link
Contributor

Agree on the separate repo — this is something that might help with other projects and will be harder to find and use if buried in ODM.

I’ll check this out on Monday. This is very exciting.

@smathermather
Copy link
Contributor

I am liking this improvement a lot. What are the new flags and do we need a synchronized update to https://github.com/OpenDroneMap/docs?

@smathermather
Copy link
Contributor

I'm not sure if this is a regression or an issue that was already extant, but I rerun the dataset, it appears some steps are rerunning in spite of all the data being there:

[INFO]    Running georeferencing with OpenSfM transformation matrix
[DEBUG]   running /home/useruser/OpenDroneMap/build/bin/odm_georef -bundleFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/opensfm/bundle_r000.out -inputTransformFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/opensfm/geocoords_transformation.txt -inputCoordFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/coords.txt -inputFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_texturing_25d/odm_textured_model.obj -outputFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_texturing_25d/odm_textured_model_geo.obj -inputPointCloudFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/smvs/smvs_dense_point_cloud.ply -outputPointCloudFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_25dgeoreferencing/odm_georeferenced_model.ply  -logFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_25dgeoreferencing/odm_georeferencing_log.txt -outputTransformFile /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_25dgeoreferencing/odm_georeferencing_transform.txt -georefFileOutputPath /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_25dgeoreferencing/odm_georeferencing_model_geo.txt
[DEBUG]   running /home/useruser/OpenDroneMap/SuperBuild/build/pdal/bin/pdal pipeline -i /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/las.json --readers.ply.filename=/mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_25dgeoreferencing/odm_georeferenced_model.ply
[INFO]    Calculating cropping area and generating bounds shapefile from point cloud
[DEBUG]   running pdal translate -i "/mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.laz" -o "/mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.filtered.las" decimation outlier range --filters.decimation.step=90 --filters.outlier.method=radius --filters.outlier.radius=2 --filters.outlier.min_k=2 --filters.range.limits='Classification![7:7]'
[DEBUG]   running pdal info --boundary --filters.hexbin.edge_length=1 --filters.hexbin.threshold=0 /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.filtered.las > /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.boundary.json
[DEBUG]   running pdal info --summary /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.laz > /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.summary.json
[DEBUG]   running ogr2ogr -overwrite -a_srs "+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs" /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.bounds.shp /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.bounds.geojson
[INFO]    Running ODM Georeferencing Cell - Finished
[INFO]    Running ODM DEM Cell
[INFO]    Classify: False
[INFO]    Create DSM: False
[INFO]    Create DTM: False
[INFO]    DEM input file /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_georeferencing/odm_georeferenced_model.laz found: True
[WARNING] DEM will not be generated
[INFO]    Running ODM DEM Cell - Finished
[INFO]    Running ODM Orthophoto Cell
[WARNING] Found a valid orthophoto in: /mnt/bigdiskdisk/datadata/ODMProjects/stpbdem2mesh/odm_orthophoto/odm_orthophoto.png
[INFO]    Running ODM OrthoPhoto Cell - Finished
[INFO]    OpenDroneMap app finished - Mon Oct 22 16:14:40  2018

@smathermather
Copy link
Contributor

I am liking this improvement a lot. What are the new flags and do we need a synchronized update to https://github.com/OpenDroneMap/docs?

Also, we should probably implement the version suggestions in this conversation.

@pierotofy
Copy link
Member Author

No new flags since 0.4.0, but the docs haven't been updated since 0.3.1, so yes we should update them.

odm_georeferencing needs to be re-run if the mesh changes. I think it's always been that way. The point cloud doesn't change (that could be improved), but the mesh (and all subsequent steps that depend on it) do.

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

Not much improvement.

@pierotofy
Copy link
Member Author

pierotofy commented Oct 28, 2018

Current master:
image

This branch:
image

anim

Hey that was a car?

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

Not much difference.

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

Not much difference, a bit straighter edges on rooftop.

@pierotofy
Copy link
Member Author

pierotofy commented Oct 28, 2018

One downside is currently that almost all --fast-orthophoto datasets suffer in quality from this approach. This is because of the massive interpolation required to fill the DSM with nearest neighbor, which creates "step ladders" that look distorted.

image

The current approach has distortion as well, but in lesser amounts.

image

I will modify the branch to retain the current approach to meshing for --fast-orthophoto.

@smathermather
Copy link
Contributor

Yes, I wondered what the effect on fast ortho would be.

You should add the Zanzibar city example to this series is you can. It makes subtle but important differences.

@smathermather
Copy link
Contributor

If I get a chance to add it I will, but I might need a tip on your favorite gif maker. I’d hate to include and example without that wonderful addition. :D

@pierotofy
Copy link
Member Author

It's just GIMP.

  1. Add both layers to QGIS
  2. Take a full window screenshot
  3. Paste first layer in GIMP
  4. Toggle a layer in QGIS
  5. Take another full window screenshot
  6. Paste the second layer in GIMP
  7. Crop as desired
  8. From GIMP File --> Export As --> "filename.gif", from GIF options check "As animation", type desired delay (I use 2000, 2 seconds), then "Export".
  9. Drag & Drop directly to GitHub issue.

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

More defined buildings

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

More defined buildings

@pierotofy
Copy link
Member Author

Current master:
image

This branch:
image

anim

Not much difference, perhaps better orthogonality in this branch.

@pierotofy
Copy link
Member Author

Hoping to merge this in sometimes next week unless problems are discovered, or there's feedback of any kind to improve the code. cc @dakotabenjamin

@pierotofy pierotofy merged commit ee53533 into OpenDroneMap:master Nov 1, 2018
@smathermather
Copy link
Contributor

w00t!

peddyhh pushed a commit to peddyhh/ODM that referenced this pull request Jun 7, 2020
pierotofy added a commit that referenced this pull request Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants