title: How to Pass points to cvFitEllipse2 in OpenCV
body: <p>I am new to OpenCV, I have array of CGPoints and I need to pass those values to cvFitEllipse2, how to pass those values? Right now I am getting exception if I pass like below</p>
  
  <pre><code>    std::vector&lt;cv::Point&gt; contours;
      contours.resize(self.points.count);
      for(int i = 0 ; i &lt; self.points.count ; i++)
      {
          CGPoint point = [self.points objectAtIndex:i];
          cv::Point val;
          val.x = point.x;
          val.y = point.y;
          contours[i] = val;
      }
  
      CvBox2D rect = cvFitEllipse2(&amp;contours);
  </code></pre>