change to get from CV_32F Matrix

This commit is contained in:
Pierre Colle 2016-11-08 14:33:38 +01:00
parent 081a36a995
commit 749e27aaf9
2 changed files with 4 additions and 0 deletions

View File

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

View File

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