As per my understanding you are trying to remove the head section from an object and measure the remaining length of the object.
- To solve the first part, you can create a draggable black square and place it where the objects head is located. For more details you can refer to: How to remove a part of image?
- For the second part, you can make use of the “regionprops” function. The “regionprops” function measures different properties such as area, centroid, and bounding box for each object in an image. Alternatively, you can also refer to the below MathWorks example on how to “Measure Distances in an Image”. https://www.mathworks.com/help/images/measure-distances-in-images.html
For detail, please see this MathWorks documentation below for more information on “regionprops”: