mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
add compare test
This commit is contained in:
parent
8a8cf57693
commit
f061c032aa
14
test/unit.js
14
test/unit.js
@ -397,6 +397,20 @@ test('Mean', function(assert) {
|
|||||||
assert.end();
|
assert.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Compare', function(assert) {
|
||||||
|
var b = new cv.Matrix.Zeros(2, 2, cv.Constants.CV_8UC1);
|
||||||
|
var a = new cv.Matrix.Zeros(2, 2, cv.Constants.CV_8UC1);
|
||||||
|
|
||||||
|
a.set(0, 0, 3);
|
||||||
|
|
||||||
|
var compare = a.compare(b, cv.Constants.CMP_EQ);
|
||||||
|
var buf = compare.getData();
|
||||||
|
compare.save("./test.png");
|
||||||
|
console.log(compare.norm());
|
||||||
|
|
||||||
|
assert.end();
|
||||||
|
});
|
||||||
|
|
||||||
test('MatchTemplateByMatrix', function(assert) {
|
test('MatchTemplateByMatrix', function(assert) {
|
||||||
var cv = require('../lib/opencv');
|
var cv = require('../lib/opencv');
|
||||||
var targetFilename = "./examples/files/car1.jpg";
|
var targetFilename = "./examples/files/car1.jpg";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user