From 7d4b72e17ae242c2749f27bc70e9a9971770cc2e Mon Sep 17 00:00:00 2001 From: Wenqi Chen <1@newmobo.com> Date: Thu, 21 Mar 2019 23:34:39 +0800 Subject: [PATCH] Fix incorrect mapping of w/h and row/col --- src/Matrix.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Matrix.cc b/src/Matrix.cc index 85aab90..c804e7c 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -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 im_h = Matrix::CreateWrappedFromMat(mat); info.GetReturnValue().Set(im_h); } @@ -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 im_h = Matrix::CreateWrappedFromMat(mat); info.GetReturnValue().Set(im_h); @@ -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 im_h = Matrix::CreateWrappedFromMat(mat); info.GetReturnValue().Set(im_h);