From 9a90480d9b4885d9224d2fd783f224bd7194981b Mon Sep 17 00:00:00 2001 From: Pierre Colle Date: Tue, 8 Nov 2016 14:41:54 +0100 Subject: [PATCH] adding unit test to get on Float --- test/unit.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/unit.js b/test/unit.js index 2fc9ce4..97767f3 100755 --- a/test/unit.js +++ b/test/unit.js @@ -103,9 +103,10 @@ test('Matrix functions', function(assert) { // convertTo var mat = new cv.Matrix(75, 75, cv.Constants.CV_32F, [2.0]); 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) + var alpha = 2; + var beta = 1; + mat.convertTo(matNew, cv.Constants.CV_8U, alpha, beta); + assert.equal(matNew.pixel(0, 0), mat.get(0, 0)*alpha + beta); // reshape mat = new cv.Matrix(75, 75, cv.Constants.CV_8UC1);