mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Merge pull request #474 from ImageQuix/master
Add support for the 'Oriented' area flag in contourArea
This commit is contained in:
commit
1cd0535c7d
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user