I don't know python but I tried this :
- invert image
- threshold image
- apply thinning algoirthm
- look for connected components
- snake is index surface is 513=length and and black rectangle is index 2 length is 79 (there is an error here because skeleton is not rectangle height)
There is no calibration so width of pixel far from center is not equal to pixel at center