mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Merge pull request #650 from wenq1/master
Fix incorrect mapping of w/h and row/col
This commit is contained in:
commit
bb0e4ebc22
@ -1171,7 +1171,7 @@ NAN_METHOD(Matrix::Zeros) {
|
|||||||
int h = info[1]->Uint32Value();
|
int h = info[1]->Uint32Value();
|
||||||
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
|
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);
|
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);
|
||||||
info.GetReturnValue().Set(im_h);
|
info.GetReturnValue().Set(im_h);
|
||||||
}
|
}
|
||||||
@ -1183,7 +1183,7 @@ NAN_METHOD(Matrix::Ones) {
|
|||||||
int h = info[1]->Uint32Value();
|
int h = info[1]->Uint32Value();
|
||||||
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
|
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);
|
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);
|
||||||
|
|
||||||
info.GetReturnValue().Set(im_h);
|
info.GetReturnValue().Set(im_h);
|
||||||
@ -1196,7 +1196,7 @@ NAN_METHOD(Matrix::Eye) {
|
|||||||
int h = info[1]->Uint32Value();
|
int h = info[1]->Uint32Value();
|
||||||
int type = (info.Length() > 2) ? info[2]->IntegerValue() : CV_64FC1;
|
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);
|
Local<Object> im_h = Matrix::CreateWrappedFromMat(mat);
|
||||||
|
|
||||||
info.GetReturnValue().Set(im_h);
|
info.GetReturnValue().Set(im_h);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user