drawContours function

Mat drawContours(
  1. InputOutputArray image,
  2. Contours contours,
  3. int contourIdx,
  4. Scalar color, {
  5. int thickness = 1,
  6. int lineType = LINE_8,
  7. InputArray? hierarchy,
  8. int maxLevel = 0x3f3f3f3f,
  9. Point? offset,
})

DrawContours draws contours outlines or filled contours.

For further details, please see: https:///docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc

Implementation

Mat drawContours(
  InputOutputArray image,
  Contours contours,
  int contourIdx,
  Scalar color, {
  int thickness = 1,
  int lineType = LINE_8,
  InputArray? hierarchy, // TODO: replace with vec
  int maxLevel = 0x3f3f3f3f,
  Point? offset,
}) {
  offset ??= Point(0, 0);
  hierarchy ??= Mat.empty();
  cvRun(
    () => cimgproc.DrawContoursWithParams(
      image.ref,
      contours.ref,
      contourIdx,
      color.ref,
      thickness,
      lineType,
      hierarchy!.ref,
      maxLevel,
      offset!.ref,
    ),
  );
  return image;
}