mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Add support for maxLevel
This commit is contained in:
parent
d3c18389c6
commit
79da65d9a5
@ -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);
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user