Is there way to measure the width of a binary mask along its length?

I have this binary image here:

I am trying to measure the width of the shape along the entire length of the shape.

related:

Hi,

may be this old post can help you