Open schlegelp opened 3 years ago
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:
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.
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.