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

Thinning-based skeletonization #15

Open
schlegelp opened this issue Aug 2, 2021 · 2 comments
Open

Thinning-based skeletonization #15

schlegelp opened this issue Aug 2, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@schlegelp
Copy link
Collaborator

Look into implementing a thinning-based skeletonization. See e.g. this one based on skimage.

For this, we would need to first voxelize the mesh which is straight forward with Trimesh.

See also this function to extract a graph from pixel neighbourhood.

@venugovh
Copy link

Hi @schlegelp! I am trying to implement the skimage based thinning algorithm for my research work. However, I am confused as to how to generate the mesh_map data that is available in skeletor. Since we generate the skeleton on the voxelized mesh of the input trimesh object, I was wondering how mesh_map would work in this case.

Any input would be very helpful.

Thanks!

@schlegelp
Copy link
Collaborator Author

schlegelp commented Dec 29, 2021

I guess it depends on your implementation but in general you would need to combine two maps:

  1. Vertex to voxel
  2. Voxel to pixel in the thinned image

The first one is straight forward, the second one is more tricky. AFAIK skimage's thinning won't give you a voxel -> pixel correspondence, so that would need to be calculated afterwards. You could just snap the vertices to the closest pixel using the Euclidean distance but that will give you wrong mappings in some cases. The correct approach would be to find the closest pixel using geodesic distance through the voxels graph but I have a feeling that this will be very expensive for larger meshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants