fferflo / semantic-meshes

A framework for annotating 3D meshes using the predictions of a 2D semantic segmentation model.
MIT License
46 stars 9 forks source link

Point cloud instead of mesh #7

Open abrahamezzeddine opened 1 month ago

abrahamezzeddine commented 1 month ago

Hello,

I am wondering if this is possible to make it work with the point cloud (both sparse and dense) from colmap rather than the mesh?

Thank you.

fferflo commented 1 month ago

Hey,

point clouds are currently not supported. It could probably be done in pure Python, although you would have to figure out a way to handle occlusion properly (so that class labels are not projected to locations in the scene that are not visible from the camera location). Maybe something like this: https://www.open3d.org/docs/latest/python_api/open3d.geometry.PointCloud.html#open3d.geometry.PointCloud.hidden_point_removal

abrahamezzeddine commented 1 month ago

Could the opposite be done perhaps?

after creating the mesh, reverse back to point cloud or is that data lost in theory?

thank you for the quick answer.

fferflo commented 1 month ago

One way of reverting back to a point cloud would be to extract the vertices of the triangles (although this wouldn't necessarily coincide with the original point cloud used to create the mesh). The class probabilities are computed per triangle though, so you could maybe average the labels of all triangles that a given vertex is part of to compute the label of that vertex.

aggregator.get() contains the class probabilities of all triangles in the input_ply file.