Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  Mat contour( contours[ idBiggest ] );

  /// Draw contour + bounding rect
  Mat drawing = Mat::zeros( range_out.size(), CV_8UC3 );

  Scalar color = Scalar(255,0,255);
  int nc = contour.size();
  const Point * pc = &(contour[0]);
  polylines( drawing , &pc, &nc, 1, 0, cv::Scalar(255) );

  Rect bounds =  boundingRect( contour );
  rectangle( drawing, bounds.tl(), bounds.br(), color, 2, 8, 0 );