Curve Fitting in a binary image, MATLAB
<p>I have this Binary image <code>bw</code>:</p>

<p><a href="https://i.stack.imgur.com/k03LQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k03LQ.jpg" alt="enter image description here"></a></p>

<p>edges  of an object  to carry out some measurements. But firstly I have to  do curve fitting  for both edges. The result should be two smooth curves representing edges. </p>

<p>I have the indices for each edge but I can not use them in making x-y data to be  input data to a fitting function. I mean they are not <code>x</code> and <code>f(x)</code>, actually, they all have the same value (1) with different positions. It is not right to say <code>[x y]=find(BW)</code> ; <code>y</code> here is not the value at <code>x</code>, but for sure there should be a way to use them to some kind of scale the binary image. I seem confused and I'm stuck here. </p>

<p>Any recommendations?</p>