From 2d2ac2900c7770fcccd87de3a6c75d4daabd0b2d Mon Sep 17 00:00:00 2001 From: Peter Braden Date: Tue, 7 Oct 2014 08:05:21 +0200 Subject: [PATCH] Fixing merge some more, and compiler errors. --- src/Contours.cc | 6 +----- src/Contours.h | 4 +++- src/Matrix.cc | 17 ++++------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/Contours.cc b/src/Contours.cc index d89f140..cd5b4a4 100755 --- a/src/Contours.cc +++ b/src/Contours.cc @@ -71,9 +71,7 @@ NAN_METHOD(Contour::Point) { NanReturnValue(data); } -<<<<<<< HEAD -Handle -Contour::Points(const Arguments &args) { +NAN_METHOD(Contour::Points) { HandleScope scope; Contour *self = ObjectWrap::Unwrap(args.This()); @@ -93,8 +91,6 @@ Contour::Points(const Arguments &args) { return scope.Close(data); } -======= ->>>>>>> a42033ac96f3a3506c62b5add536074ffa0801e8 // FIXME: this sould better be called "Length" as ``Contours`` is an Array like structure // also, this would allow to use ``Size`` for the function returning the number of corners diff --git a/src/Contours.h b/src/Contours.h index 72a82d7..710485d 100755 --- a/src/Contours.h +++ b/src/Contours.h @@ -27,6 +27,8 @@ class Contour: public node::ObjectWrap { JSFUNC(MinAreaRect) JSFUNC(IsConvex) JSFUNC(Moments) - + JSFUNC(Hierarchy) + JSFUNC(Serialize) + JSFUNC(Deserialize) }; diff --git a/src/Matrix.cc b/src/Matrix.cc index 00eb783..f006e1b 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -124,7 +124,7 @@ NAN_METHOD(Matrix::New) { mat = new Matrix(args[0]->IntegerValue(), args[1]->IntegerValue()); } else if (args.Length() == 3 && args[0]->IsInt32() && args[1]->IsInt32() && args[2]->IsInt32()) { mat = new Matrix(args[0]->IntegerValue(), args[1]->IntegerValue(), args[2]->IntegerValue()); - } else if (args.Length() == 5) { + } else { // if (args.Length() == 5) { Matrix *other = ObjectWrap::Unwrap(args[0]->ToObject()); int x = args[1]->IntegerValue(); int y = args[2]->IntegerValue(); @@ -230,15 +230,6 @@ NAN_METHOD(Matrix::Pixel){ return scope.Close(Number::New(intensity)); } } - else{ - cv::Vec3b intensity = self->mat.at(y, x); - - v8::Local arr = NanNew(3); - arr->Set(0, NanNew( intensity[0] )); - arr->Set(1, NanNew( intensity[1] )); - arr->Set(2, NanNew( intensity[2] )); - NanReturnValue( arr ); - } NanReturnUndefined(); //double val = Matrix::DblGet(t, i, j); //NanReturnValue(NanNew(val)); @@ -1614,12 +1605,12 @@ NAN_METHOD(Matrix::Split) { vector channels; // Split doesn't seem to work on empty vectors - for (int i = 0; i < size; i++) { + for (unsigned int i = 0; i < size; i++) { channels.push_back(cv::Mat()); } cv::split(self->mat, channels); - unsigned int size = channels.size(); + size = channels.size(); v8::Local arrChannels = NanNew(size); for (unsigned int i = 0; i < size; i++) { Local matObject = NanNew(Matrix::constructor)->GetFunction()->NewInstance(); @@ -1729,7 +1720,7 @@ NAN_METHOD(Matrix::MatchTemplate) { int method = (args.Length() < 2) ? (int)cv::TM_CCORR_NORMED : args[1]->Uint32Value(); - cv::matchTemplate(self->mat, templ->mat, m_out->mat, method); + cv::matchTemplate(self->mat, templ, m_out->mat, method); NanReturnValue(out); }