- make API more natural (breaks compatiblity, but passes test)

This commit is contained in:
Wenqi Chen 2019-03-22 13:01:13 +08:00
parent 7d4b72e17a
commit 089024bb41

View File

@ -1167,8 +1167,8 @@ NAN_METHOD(Matrix::SaveAsync) {
NAN_METHOD(Matrix::Zeros) {
Nan::HandleScope scope;
int w = info[0]->Uint32Value();
int h = info[1]->Uint32Value();
int h = info[0]->Uint32Value();
int w = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
cv::Mat mat = cv::Mat::zeros(h, w, type);
@ -1179,8 +1179,8 @@ NAN_METHOD(Matrix::Zeros) {
NAN_METHOD(Matrix::Ones) {
Nan::HandleScope scope;
int w = info[0]->Uint32Value();
int h = info[1]->Uint32Value();
int h = info[0]->Uint32Value();
int w = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
cv::Mat mat = cv::Mat::ones(h, w, type);
@ -1192,8 +1192,8 @@ NAN_METHOD(Matrix::Ones) {
NAN_METHOD(Matrix::Eye) {
Nan::HandleScope scope;
int w = info[0]->Uint32Value();
int h = info[1]->Uint32Value();
int h = info[0]->Uint32Value();
int w = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
cv::Mat mat = cv::Mat::eye(h, w, type);