title: how to find extreme point of the contour opencv c++
body: <p>I have this image:</p>
  
  <p><img src="https://i.stack.imgur.com/K5THS.jpg" alt="enter image description here"></p>
  
  <p>How do i can implement the extreme point finder code in OpenCv c++ like in the picture?</p>
  
  <p>Anyone have any idea please??</p>
  
  <pre><code># determine the most extreme points along the contour
  
  leftmost = tuple(cnt [cnt[:,:,0].argmin()][0]);
  rightmost = tuple(cnt [cnt[:,:,0].argmax()][0]);
  topmost = tuple(cnt [cnt[:,:,1].argmin()][0]);
  bottommost = tuple(cnt [cnt[:,:,1].argmax()][0]);
  </code></pre>