Skip to content

Commit

Permalink
Merge pull request peterbraden#650 from wenq1/master
Browse files Browse the repository at this point in the history
Fix incorrect mapping of w/h and row/col
  • Loading branch information
peterbraden authored Mar 21, 2019
2 parents 97ceaaa + 7d4b72e commit bb0e4eb
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 bb0e4eb

Please # to comment.