node-opencv/smoke/smoketest.js
Loren M. Lang 13488fa94b Smoke test now uses portable file path
Added a sanity check to ensure smoke.sh is run from the correct folder
and use a relative path to the mona image so it works on any system.
2013-07-17 22:26:16 -07:00

29 lines
651 B
JavaScript
Executable File

var cv = require('../lib/opencv')
var trainingData = []
/*
for (var i = 1; i< 41; i++){
for (var j = 1; j<10; j++){
trainingData.push([i,"/Users/peterbraden/Downloads/orl_faces/s" + i + "/" + j + ".pgm" ])
}
}
cv.readImage("/Users/peterbraden/Downloads/orl_faces/s6/10.pgm", function(e, im){
var facerec = cv.FaceRecognizer.createEigenFaceRecognizer();
//facerec.trainSync(trainingData);
facerec.loadSync("/Users/peterbraden/Desktop/ORL")
console.log(facerec.predictSync(im));
})
*/
cv.readImage("examples/mona.png", function(e, mat){
var th = mat.threshold(200, 200, "Threshold to Zero Inverted");
th.save('out.png')
})