mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
change to get from CV_32F Matrix
This commit is contained in:
parent
081a36a995
commit
749e27aaf9
@ -208,6 +208,9 @@ double Matrix::DblGet(cv::Mat mat, int i, int j) {
|
||||
case CV_64FC1:
|
||||
val = mat.at<double>(i, j);
|
||||
break;
|
||||
case CV_32FC1:
|
||||
val = mat.at<float>(i, j);
|
||||
break;
|
||||
default:
|
||||
val = mat.at<double>(i, j);
|
||||
break;
|
||||
|
||||
@ -105,6 +105,7 @@ test('Matrix functions', function(assert) {
|
||||
var matNew = new cv.Matrix(75, 75, cv.Constants.CV_8U);
|
||||
mat.convertTo(matNew, cv.Constants.CV_8U, 2, 1);
|
||||
assert.equal(matNew.pixel(0, 0), 5);
|
||||
assert.equal(mat.get(0, 0), 5)
|
||||
|
||||
// reshape
|
||||
mat = new cv.Matrix(75, 75, cv.Constants.CV_8UC1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user