Merge pull request #650 from wenq1/master

Fix incorrect mapping of w/h and row/col
This commit is contained in:
Peter Braden 2019-03-21 16:47:08 +01:00 committed by GitHub
commit bb0e4ebc22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
@ -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);
@ -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);