Created
January 9, 2017 01:10
-
-
Save haitch/a78bba103d6092ec4a6c1d0c2cdb58c3 to your computer and use it in GitHub Desktop.
nodejs-opencv-facedetect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cv = require('opencv'); | |
var async = require('async'); | |
async.waterfall( | |
[ | |
function(callback){ | |
console.log('start parsing Image!') | |
cv.readImage('input.jpg', callback); | |
}, | |
function(im, callback){ | |
console.log('start detect faces!') | |
im.detectObject(cv.FACE_CASCADE, {}, callback); | |
}, | |
function(faces){ | |
console.log(faces); | |
} | |
] | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "nodejs-opencv-facedetect", | |
"version": "1.0.0", | |
"description": "example of face detection using nodejs and opencv.", | |
"main": "index.js", | |
"author": "Haitao Chen", | |
"license": "MIT", | |
"dependencies": { | |
"async": "^2.1.4", | |
"opencv": "^6.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment