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, "convexHull", ConvexHull);
|
||||
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, "moments", Moments);
|
||||
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, "addWeighted", AddWeighted);
|
||||
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, "canny", Canny);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate);
|
||||
@ -999,6 +1000,18 @@ Matrix::BitwiseXor(const v8::Arguments& args) {
|
||||
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>
|
||||
Matrix::CountNonZero(const v8::Arguments& args) {
|
||||
HandleScope scope;
|
||||
@ -1755,7 +1768,9 @@ Matrix::PutText(const v8::Arguments& args) {
|
||||
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());
|
||||
}
|
||||
|
||||
17
src/Matrix.h
17
src/Matrix.h
@ -3,7 +3,7 @@
|
||||
class Matrix: public node::ObjectWrap {
|
||||
public:
|
||||
|
||||
cv::Mat mat;
|
||||
cv::Mat mat;
|
||||
static Persistent<FunctionTemplate> constructor;
|
||||
static void Init(Handle<Object> target);
|
||||
static Handle<Value> New(const Arguments &args);
|
||||
@ -57,6 +57,7 @@ class Matrix: public node::ObjectWrap {
|
||||
JSFUNC(AbsDiff)
|
||||
JSFUNC(AddWeighted)
|
||||
JSFUNC(BitwiseXor)
|
||||
JSFUNC(BitwiseNot)
|
||||
JSFUNC(CountNonZero)
|
||||
//JSFUNC(Split)
|
||||
JSFUNC(Canny)
|
||||
@ -97,13 +98,13 @@ class Matrix: public node::ObjectWrap {
|
||||
JSFUNC(GetPerspectiveTransform)
|
||||
JSFUNC(WarpPerspective)
|
||||
/*
|
||||
static Handle<Value> Val(const Arguments& args);
|
||||
static Handle<Value> RowRange(const Arguments& args);
|
||||
static Handle<Value> ColRange(const Arguments& args);
|
||||
static Handle<Value> Diag(const Arguments& args);
|
||||
static Handle<Value> Clone(const Arguments& args);
|
||||
static Handle<Value> CopyTo(const Arguments& args);
|
||||
static Handle<Value> ConvertTo(const Arguments& args);
|
||||
static Handle<Value> Val(const Arguments& args);
|
||||
static Handle<Value> RowRange(const Arguments& args);
|
||||
static Handle<Value> ColRange(const Arguments& args);
|
||||
static Handle<Value> Diag(const Arguments& args);
|
||||
static Handle<Value> Clone(const Arguments& args);
|
||||
static Handle<Value> CopyTo(const Arguments& args);
|
||||
static Handle<Value> ConvertTo(const Arguments& args);
|
||||
static Handle<Value> AssignTo(const Arguments& args);
|
||||
static Handle<Value> SetTo(const Arguments& args);
|
||||
static Handle<Value> Reshape(const Arguments& args);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user