Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- download = wget.download(src, path + filename, options);
- download.on('end', function(output) {
- cv.readImage(path + filename, function(err, im) {
- if (err) throw err;
- if (im.width() < 1 || im.height() < 1) throw new Error('Image has no size');
- im.detectObject('data/cascade.xml', {}, function(err, cars) {
- if (err) throw err;
- for (var i = 0; i < cars.length; i++) {
- car = cars[i];
- im.rectangle([car.x, car.y], [car.width, car.height], [0, 255, 0], 2);
- }
- im.save(path + '_' + filename);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment