title: Extracting polygon given coordinates from an image using OpenCV
body: <p>I've a set of points like the following:</p>
  
  <pre><code>     &lt;data:polygon&gt;
                              &lt;data:point x="542" y="107"/&gt;
                              &lt;data:point x="562" y="102"/&gt;
                              &lt;data:point x="582" y="110"/&gt;
                              &lt;data:point x="598" y="142"/&gt;
                              &lt;data:point x="600" y="192"/&gt;
                              &lt;data:point x="601" y="225"/&gt;
                              &lt;data:point x="592" y="261"/&gt;
                              &lt;data:point x="572" y="263"/&gt;
                              &lt;data:point x="551" y="245"/&gt;
                              &lt;data:point x="526" y="220"/&gt;
                              &lt;data:point x="520" y="188"/&gt;
                              &lt;data:point x="518" y="152"/&gt;
                              &lt;data:point x="525" y="127"/&gt;
                              &lt;data:point x="542" y="107"/
   &lt;/data:polygon&gt;
  </code></pre>
  
  <p>I want to draw the polygon defined by these points in the image and then extract it. How can I do that using OpenCV with python ?</p>