Thinning-based skeletonization
schlegelp opened this issue · 2 comments
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!
I guess it depends on your implementation but in general you would need to combine two maps:
- Vertex to voxel
- 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.