Skip to content

Instantly share code, notes, and snippets.

@haitch
Created January 9, 2017 01:10
Show Gist options
  • Save haitch/a78bba103d6092ec4a6c1d0c2cdb58c3 to your computer and use it in GitHub Desktop.
Save haitch/a78bba103d6092ec4a6c1d0c2cdb58c3 to your computer and use it in GitHub Desktop.
nodejs-opencv-facedetect
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);
}
]
);
{
"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