mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Merge pull request #140 from coolblade/master
fixed a bug where minAreaRect c++ function was pointing at BoundingRect ...
This commit is contained in:
commit
a401a7ea84
@ -31,7 +31,7 @@ Contour::Init(Handle<Object> target) {
|
|||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "approxPolyDP", ApproxPolyDP);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "approxPolyDP", ApproxPolyDP);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "convexHull", ConvexHull);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "convexHull", ConvexHull);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "boundingRect", BoundingRect);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "boundingRect", BoundingRect);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "minAreaRect", BoundingRect);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "minAreaRect", MinAreaRect);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "isConvex", IsConvex);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "isConvex", IsConvex);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "moments", Moments);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "moments", Moments);
|
||||||
target->Set(String::NewSymbol("Contours"), m->GetFunction());
|
target->Set(String::NewSymbol("Contours"), m->GetFunction());
|
||||||
|
|||||||
@ -67,6 +67,7 @@ Matrix::Init(Handle<Object> target) {
|
|||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "absDiff", AbsDiff);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "absDiff", AbsDiff);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "addWeighted", AddWeighted);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "addWeighted", AddWeighted);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseXor", BitwiseXor);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseXor", BitwiseXor);
|
||||||
|
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseNot", BitwiseNot);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "countNonZero", CountNonZero);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "countNonZero", CountNonZero);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "canny", Canny);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "canny", Canny);
|
||||||
NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate);
|
NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate);
|
||||||
@ -999,6 +1000,18 @@ Matrix::BitwiseXor(const v8::Arguments& args) {
|
|||||||
return scope.Close(v8::Null());
|
return scope.Close(v8::Null());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Handle<Value>
|
||||||
|
Matrix::BitwiseNot(const v8::Arguments& args) {
|
||||||
|
HandleScope scope;
|
||||||
|
|
||||||
|
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
|
||||||
|
|
||||||
|
Matrix *src1 = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
|
||||||
|
cv::bitwise_not(src1->mat, self->mat);
|
||||||
|
|
||||||
|
return scope.Close(v8::Null());
|
||||||
|
}
|
||||||
|
|
||||||
Handle<Value>
|
Handle<Value>
|
||||||
Matrix::CountNonZero(const v8::Arguments& args) {
|
Matrix::CountNonZero(const v8::Arguments& args) {
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
@ -1755,7 +1768,9 @@ Matrix::PutText(const v8::Arguments& args) {
|
|||||||
color = setColor(objColor);
|
color = setColor(objColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
cv::putText(self->mat, text, cv::Point(x, y), constFont, 1, color, 2);
|
double scale = args.Length() < 6 ? 1 : args[5]->NumberValue();
|
||||||
|
|
||||||
|
cv::putText(self->mat, text, cv::Point(x, y), constFont, scale, color, 2);
|
||||||
|
|
||||||
return scope.Close(Undefined());
|
return scope.Close(Undefined());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,7 @@ class Matrix: public node::ObjectWrap {
|
|||||||
JSFUNC(AbsDiff)
|
JSFUNC(AbsDiff)
|
||||||
JSFUNC(AddWeighted)
|
JSFUNC(AddWeighted)
|
||||||
JSFUNC(BitwiseXor)
|
JSFUNC(BitwiseXor)
|
||||||
|
JSFUNC(BitwiseNot)
|
||||||
JSFUNC(CountNonZero)
|
JSFUNC(CountNonZero)
|
||||||
//JSFUNC(Split)
|
//JSFUNC(Split)
|
||||||
JSFUNC(Canny)
|
JSFUNC(Canny)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user