title: Draw single Contour in OpenCV on image
body: <p>What is the best way to draw a single contour in OpenCV? As far as i can see <a href="http://docs.opencv.org/2.4.2/modules/core/doc/drawing_functions.html?highlight=drawcontours#void%20drawContours%28InputOutputArray%20image,%20InputArrayOfArrays%20contours,%20int%20contourIdx,%20const%20Scalar&amp;%20color,%20int%20thickness,%20int%20lineType,%20InputArray%20hierarchy,%20int%20maxLevel,%20Point%20offset%29" rel="noreferrer">drawContours</a> can only handle multiple contours.</p>
  
  <p>Background: I want to change my code to a for each loop. The old code:</p>
  
  <pre><code>//vector&lt;vector&lt;Point&gt; &gt; contours = result of findContours(...)
  for (int i = 0; i &lt; contour.size; i++){
      if(iscorrect(contours[i])){
          drawContours(img, contours, i, color, 1, 8, hierarchy);
      }
   }
  </code></pre>
  
  <p>The way presented <a href="http://opencv-users.1802565.n2.nabble.com/draw-only-one-contour-using-drawContours-td7404400.html" rel="noreferrer">in this mailing list</a> is pretty ugly:</p>
  
  <pre><code>for (vector&lt;Point&gt; contour : contours){
       if(iscorrect(contour)){
            vector&lt;vector&lt;Point&gt; &gt; con = vector&lt;vector&lt;Point&gt; &gt;(1, contour);
            drawContours(img, con, -1, color, 1, 8);
       }
  }
  </code></pre>
  
  <p>Is there a cleaner way to draw single contours (vector&lt; Point> Object)?</p>