ODM icon indicating copy to clipboard operation
ODM copied to clipboard

Mesh construction

Open v4ven27 opened this issue 10 years ago • 7 comments

Greetings ODM users,

I've been looking into the ODM source code, particularly OdmMeshing.cpp.

Poisson surface reconstruction method from PCL is used to create a mesh from the point cloud as seen here meshCreator_ = pcl::Poisson<pcl::PointNormal>::Ptr(new pcl::Poisson<pcl::PointNormal>());

By my understanding, the Poisson method gives a "watertight" surface and I've been wondering how to get rid of the unwanted faces (& vertices) generated. Is that done at the mesh decimation stage here: pcl::MeshQuadricDecimationVTK decimator

I'd appreciate any insight to help me better understand the ODM workflow.

Thanks!

v4ven27 avatar Jul 11 '16 20:07 v4ven27

Are you asking about cleaning up the mesh during the process?

Mesh decimation simplifies over-tessellated parts of the mesh, i.e. a flat face with 50 triangles down to 5 or something like that. Mesh decimation happens only if the generated vertex count is higher than the input max vertex count. The algorithm used is first described here:

H. Hoppe. New Quadric Metric for Simplifying Meshes with Appearance Attributes. IEEE Visualization 1999, pp. 59-66.

To be quite honest, our meshing process is quite simple and is on our list of things to improve, in terms of both in mesh density and accuracy.

dakotabenjamin avatar Jul 15 '16 13:07 dakotabenjamin

Thank you, @dakotabenjamin

However, what I am most concerned about is how ODM handles the "watertightness" property of Poisson reconstruction due to which it results in closed surfaces as seen here: poisson-bldg

This is the front view of a building whose surfaces are clearly discernible but you can also see how Poisson Reconstruction has closed the the entire mesh by generating polygons from one stairwell to the other. I'm curious about how ODM handles this issue. :)

Thanks!

v4ven27 avatar Jul 20 '16 19:07 v4ven27

Unfortunately, ODM handles it pretty poorly as you can see.

I would say it will be hard to create a proper solution to photosets with non-nadir facing photos like above. I would avoid using photos with any part of the sky in them at all. I think that is what is causing your issues.

One thing you can try is use the --end-with pmvs tag to stop after pmvs pointcloud densification step. Then manually remove any points rendered as sky or points you don't want by hand using MeshLab or some point cloud editor, then replace the ply and rerun from odm_meshing. Theoretically that could work.

dakotabenjamin avatar Jul 20 '16 20:07 dakotabenjamin

Meshing is definitely something we want to revisit and improve in the near term.

smathermather avatar Jul 21 '16 20:07 smathermather

@dakotabenjamin and @smathermather , thanks for your response! I'm currently working with PCL (used in generating the above mesh) and CGAL to process aerial LIDAR pointclouds and generate meshes from non-nadir viewpoints. I'd glanced over the ODM source to see how the watertightness property of Poisson reconstruction is handled in ODM.

Considering my research area overlaps with ODM as far as the meshing module is concerned, I'd love to contribute towards improving mesh generation in ODM :). Let me know how I can help.

I'll update this post once I have solid (pun intended) results from my research.

v4ven27 avatar Jul 21 '16 20:07 v4ven27

That sounds great! We welcome contributions :smile: If you want to contribute but need some direction or help navigating the codebase, head on over to our Gitter for dev talk.

dakotabenjamin avatar Jul 22 '16 12:07 dakotabenjamin

This issue is outdated and will be closed. Please open a new thread in http://community.opendronemap.org and reference this issue if you would like to continue the conversation.

dakotabenjamin avatar Mar 28 '18 18:03 dakotabenjamin