How to segment an object into minor segments for volume calculation

Hello
I want to be able to calculate the volume of an insect larva in order to obtain its weight with python and OpenCV. the body is not evenly shaped, so i need to have minor segments, calculate volume of each then sum them up. I am wondering how i can obtain the minor segments plus how to pick them separately as illustrated in the attached image.
insect


thats the insect original image, that i would like to segment into mini segments

sounds like skeletonization might be useful.

https://scikit-image.org/docs/stable/auto_examples/edges/plot_skeleton.html

given the skeleton, if pruned to be a single line, you could walk along the skeleton, get the distance/radius at each point, and use that in a cylinder volume calculation.

this person there also wants to work with segments of some sausage-shaped visual:

I’m just posting this because it’s recent. many people try to do something like this.

1 Like