From 7c6187b3a8fed35581aa04f08ed4a8cbf5aab27e Mon Sep 17 00:00:00 2001 From: John Ludwig Date: Thu, 17 Apr 2014 16:09:58 -0700 Subject: [PATCH] thickness in contour drawing Add optional line thickness arg in drawContours and drawAllContours --- src/Matrix.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Matrix.cc b/src/Matrix.cc index 61c2659..6d9b012 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -1026,7 +1026,9 @@ Matrix::DrawContour(const v8::Arguments& args) { color = setColor(objColor); } - cv::drawContours(self->mat, cont->contours, pos, color, 1); + int thickness = args.Length() < 4 ? 1 : args[3]->NumberValue(); + + cv::drawContours(self->mat, cont->contours, pos, color, thickness); return Undefined(); } @@ -1046,7 +1048,10 @@ Matrix::DrawAllContours(const v8::Arguments& args) { color = setColor(objColor); } - cv::drawContours(self->mat, cont->contours, -1, color, 1); + int thickness = args.Length() < 3 ? 1 : args[2]->NumberValue(); + + cv::drawContours(self->mat, cont->contours, -1, color, thickness); + return Undefined(); }