Merge pull request #474 from ImageQuix/master

Add support for the 'Oriented' area flag in contourArea
This commit is contained in:
Peter Braden 2017-02-08 16:50:59 +01:00 committed by GitHub
commit 1cd0535c7d

View File

@ -115,9 +115,10 @@ NAN_METHOD(Contour::Area) {
Contour *self = Nan::ObjectWrap::Unwrap<Contour>(info.This());
int pos = info[0]->NumberValue();
bool orientation = (info.Length() > 1 && info[1]->BooleanValue());
// info.GetReturnValue().Set(Nan::New<Number>(contourArea(self->contours)));
info.GetReturnValue().Set(Nan::New<Number>(contourArea(cv::Mat(self->contours[pos]))));
info.GetReturnValue().Set(Nan::New<Number>(contourArea(cv::Mat(self->contours[pos]), orientation)));
}
NAN_METHOD(Contour::ArcLength) {