title: Simple algorithm for approximation image contour for line segment
body: <p>The image contour is a array points. I need to approach two points on each side to create four line segments.</p>
  
  <p><a href="https://i.stack.imgur.com/XhEOX.jpg" rel="nofollow noreferrer" title="Image contour">Image contour</a></p>