Skip to content

Commit

Permalink
Fix incorrect mapping of w/h and row/col
Browse files Browse the repository at this point in the history
  • Loading branch information
wenq1 committed Mar 21, 2019
1 parent 97ceaaa commit 7d4b72e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ NAN_METHOD(Matrix::Zeros) {
int h = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;

cv::Mat mat = cv::Mat::zeros(w, h, type);
cv::Mat mat = cv::Mat::zeros(h, w, type);
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);
info.GetReturnValue().Set(im_h);
}
Expand All @@ -1183,7 +1183,7 @@ NAN_METHOD(Matrix::Ones) {
int h = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;

cv::Mat mat = cv::Mat::ones(w, h, type);
cv::Mat mat = cv::Mat::ones(h, w, type);
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);

info.GetReturnValue().Set(im_h);
Expand All @@ -1196,7 +1196,7 @@ NAN_METHOD(Matrix::Eye) {
int h = info[1]->Uint32Value();
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;

cv::Mat mat = cv::Mat::eye(w, h, type);
cv::Mat mat = cv::Mat::eye(h, w, type);
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);

info.GetReturnValue().Set(im_h);
Expand Down

0 comments on commit 7d4b72e

Please # to comment.