You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/ZERO/node_modules/opencv/lib/opencv.js:22
face_cascade = new cv.CascadeClassifier(classifier);
^
TypeError: Error loading file
at TypeError (native)
at Matrix.detectObject (/Users/ZERO/node_modules/opencv/lib/opencv.js:22:20)
at /Users/ZERO/RM1/index.js:14:8
at /Users/ZERO/RM1/index.js:13:6
at Array.forEach (native)
at Object.<anonymous> (/Users/ZERO/RM1/index.js:12:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
My script
var cv = require('opencv');
var color = [0, 255, 0];
var thickness = 2;
var cascadeFile = '/Users/ZERO/RM1/classifier/cascade.xml';
var inputFiles = [
'/Users/ZERO/RM1/recognize/recognize_this_1.jpg',
'/Users/ZERO/RM1/recognize/recognize_this_2.jpg',
'/Users/ZERO/RM1/recognize/recognize_this_3.jpg',
'/Users/ZERO/RM1/recognize/recognize_this_4.jpg',
'/Users/ZERO/RM1/recognize/recognize_this_5.jpg',
'/Users/ZERO/RM1/recognize/recognize_this_6.jpg'
];
inputFiles.forEach(function(fileName) {
cv.readImage(fileName, function(err, im) {
im.detectObject(cascadeFile, {neighbors: 2, scale: 2}, function(err, objects) {
console.log(objects);
for(var k = 0; k < objects.length; k++) {
var object = objects[k];
im.rectangle(
[object.x, object.y],
[object.x + object.width, object.y + object.height],
color,
2
);
}
im.save(fileName.replace(/\.jpg/, 'processed.jpg'));
});
});
});
Please advice. Thank you.
The text was updated successfully, but these errors were encountered:
That code is not really part of this repository/tutorial. It seems like the problem is node-opencv here. Check out the node-opencv repository and documentation. A quick search brought me to this issue which seems to be the exact same one you have.
I got this error message when execute node script
My script
Please advice. Thank you.
The text was updated successfully, but these errors were encountered: