Fixing merge some more, and compiler errors.

This commit is contained in:
Peter Braden 2014-10-07 08:05:21 +02:00
parent 19058ecea9
commit 2d2ac2900c
3 changed files with 8 additions and 19 deletions

View File

@ -71,9 +71,7 @@ NAN_METHOD(Contour::Point) {
NanReturnValue(data);
}
<<<<<<< HEAD
Handle<Value>
Contour::Points(const Arguments &args) {
NAN_METHOD(Contour::Points) {
HandleScope scope;
Contour *self = ObjectWrap::Unwrap<Contour>(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

View File

@ -27,6 +27,8 @@ class Contour: public node::ObjectWrap {
JSFUNC(MinAreaRect)
JSFUNC(IsConvex)
JSFUNC(Moments)
JSFUNC(Hierarchy)
JSFUNC(Serialize)
JSFUNC(Deserialize)
};

View File

@ -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<Matrix>(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<cv::Vec3b>(y, x);
v8::Local<v8::Array> arr = NanNew<Array>(3);
arr->Set(0, NanNew<Number>( intensity[0] ));
arr->Set(1, NanNew<Number>( intensity[1] ));
arr->Set(2, NanNew<Number>( intensity[2] ));
NanReturnValue( arr );
}
NanReturnUndefined();
//double val = Matrix::DblGet(t, i, j);
//NanReturnValue(NanNew<Number>(val));
@ -1614,12 +1605,12 @@ NAN_METHOD(Matrix::Split) {
vector<cv::Mat> 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<v8::Array> arrChannels = NanNew<Array>(size);
for (unsigned int i = 0; i < size; i++) {
Local<Object> 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);
}