diff --git a/examples/contours.js b/examples/contours.js index 238ca04..dcbf48a 100755 --- a/examples/contours.js +++ b/examples/contours.js @@ -26,6 +26,7 @@ cv.readImage('./files/stuff.png', function(err, im) { contours = im_canny.findContours(); const lineType = 8; + const maxLevel = 0; const thickness = 1; for(i = 0; i < contours.size(); i++) { @@ -33,7 +34,7 @@ cv.readImage('./files/stuff.png', function(err, im) { var moments = contours.moments(i); var cgx = Math.round(moments.m10 / moments.m00); var cgy = Math.round(moments.m01 / moments.m00); - big.drawContour(contours, i, GREEN, thickness, lineType, [0, 0]); + big.drawContour(contours, i, GREEN, thickness, lineType, maxLevel, [0, 0]); big.line([cgx - 5, cgy], [cgx + 5, cgy], RED); big.line([cgx, cgy - 5], [cgx, cgy + 5], RED); } diff --git a/src/Matrix.cc b/src/Matrix.cc index a70c125..3d5db2d 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -1487,7 +1487,7 @@ NAN_METHOD(Matrix::DrawContour) { int thickness = info.Length() < 4 ? 1 : info[3]->NumberValue(); int lineType = info.Length() < 5 ? 8 : info[4]->NumberValue(); - int maxLevel = 0; + int maxLevel = info.Length() < 6 ? 0 : info[5]->NumberValue(); cv::Point offset; if (info.Length() == 6) {