title: Is there a way to fit two curves exclusively and simultaneously to multiple edges in python?
body: <p>I have the following edge-detected image:
  <a href="https://i.stack.imgur.com/aG9Nu.png" rel="nofollow noreferrer">edge</a></p>
  
  <p>As you can see, there are two clearly defined lines that make up two sides of an object. I can fit one curve to the entire thing, but how can I perform a curve fitting so that two curves are fit exclusively and simultaneously to such edges, so that I end up with two lines that describe the shape? In other images, the ends may not be discontinuous in this manner.</p>
  
  <p>Is there a good way to specify number of curves to fit to data, like n=2 in this instance, and have it perform a fit where each curve takes into account the other to stay away from it? I have been unable to find similar problems or libraries that can perform something like this.</p>
  
  <p>The two fitted curves in this instance would end up looking like this: <a href="https://i.stack.imgur.com/JffSx.png" rel="nofollow noreferrer">curves</a> </p>