From b8419a842ab73070384ec1b8dde7c18ef6dd3a7b Mon Sep 17 00:00:00 2001 From: Craig Valente Date: Mon, 12 Dec 2016 20:23:38 -0500 Subject: [PATCH] Add support for the 'Oriented' area flag in contourArea --- src/Contours.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Contours.cc b/src/Contours.cc index 49f2bd9..5ef5bf8 100755 --- a/src/Contours.cc +++ b/src/Contours.cc @@ -115,9 +115,10 @@ NAN_METHOD(Contour::Area) { Contour *self = Nan::ObjectWrap::Unwrap(info.This()); int pos = info[0]->NumberValue(); + bool orientation = (info.Length() > 1 && info[1]->BooleanValue()); // info.GetReturnValue().Set(Nan::New(contourArea(self->contours))); - info.GetReturnValue().Set(Nan::New(contourArea(cv::Mat(self->contours[pos])))); + info.GetReturnValue().Set(Nan::New(contourArea(cv::Mat(self->contours[pos]), orientation))); } NAN_METHOD(Contour::ArcLength) {