mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
add tests for bitwiseXor and absDiff
This commit is contained in:
parent
4ce14beb96
commit
363b950f1e
27
test/unit.js
27
test/unit.js
@ -190,7 +190,32 @@ vows.describe('Smoke Tests OpenCV').addBatch({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, ".absDiff" : function(cv){
|
||||||
|
var mat1 = new cv.Matrix(1,1);
|
||||||
|
mat1.set(0,0, 0);
|
||||||
|
|
||||||
|
var mat2 = new cv.Matrix(1,1);
|
||||||
|
mat2.set(0,0, 1);
|
||||||
|
|
||||||
|
var diff = new cv.Matrix(1,1);
|
||||||
|
diff.absDiff(mat1, mat2);
|
||||||
|
|
||||||
|
assert.equal(diff.get(0,0), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
, ".bitwiseXor" : function(cv) {
|
||||||
|
var mat1 = new cv.Matrix(1,1);
|
||||||
|
mat1.set(0,0, 1);
|
||||||
|
|
||||||
|
var mat2 = new cv.Matrix(1,1);
|
||||||
|
mat2.set(0,0, 1);
|
||||||
|
|
||||||
|
var xored = new cv.Matrix(1,1);
|
||||||
|
xored.bitwiseXor(mat1, mat2);
|
||||||
|
|
||||||
|
assert.equal(xored.get(0,0), 0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user