MATLAB: Extract the center of the coarse curve of binary image

binary imagecenter extractioncurveImage Processing Toolbox

I want to extract the center of a series of curves, as shown in the figure below, which looks roughly like the red line in the figure

Best Answer

Try inverting the binary image and then using bwskel(). Demo attached.