title: Curvature estimation from image
body: <p>I have images like this ones:</p>
  
  <p><img src="https://i.stack.imgur.com/VITxL.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/3issI.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/t98wb.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/32PtZ.jpg" alt="enter image description here"></p>
  
  <p>In this images the red line is what I want to get from the image. Original images do not have that red lines, but only that green road. </p>
  
  <p>What I want is to estimate the curve from image in form of a coeffitients of equation: A x^2 + B x + C = 0. In images there can be noise (black holes on edges as you see above). </p>
  
  <p>I have tried to solve this by using least squares method (LSM), but there are two problems with this approach:</p>
  
  <ol>
  <li><p>The method is too slow even on PC, because the points amount is high.</p></li>
  <li><p>The road is too wide in the following case: </p></li>
  </ol>
  
  <p>The curve on the left image is correctly recognized, but on the right side incorrectly. The reason is that the road is too wide and too short, I suppose.
  <img src="https://i.stack.imgur.com/zbspe.jpg" alt="enter image "></p>
  
  <p>As a solution for both cases I want to make the road narrow. In ideal case it is a red line in images above. Or I want to use LSM for line detection (A x + B = 0) for optimization of processing time.</p>
  
  <p>I have tried eroding image - it is wrong approach.
  Skeleton also not the right solution.</p>
  
  <p>Any ideas about how to achieve the desired result (make the road narrow)?
  Or any ideas of another approach for this problem?</p>