mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Add shortcut for face cascade file -> cv.FACE_CASCADE
This commit is contained in:
parent
3a7469fe52
commit
0bb7fe9918
@ -29,7 +29,7 @@ Or to build the repo:
|
||||
|
||||
|
||||
cv.readImage("./examples/test.jpg", function(err, im){
|
||||
im.detectObject("./data/haarcascade_frontalface_alt.xml", {}, function(err, faces){
|
||||
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
|
||||
for (var i=0;i<faces.length; i++){
|
||||
var x = faces[i]
|
||||
im.ellipse(x.x + x.width/2, x.y + x.height/2, x.width/2, x.height/2);
|
||||
@ -117,6 +117,7 @@ detection. This can be used for face detection etc.
|
||||
|
||||
mat.detectObject(haar_cascade_xml, opts, function(err, matches){})
|
||||
|
||||
For convenience in face recognition, cv.FACE_CASCADE is a cascade that can be used for frontal face recognition.
|
||||
|
||||
Also:
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
var Stream = require('stream').Stream
|
||||
, Buffers = require('buffers')
|
||||
, util = require('util');
|
||||
, util = require('util')
|
||||
, path = require('path')
|
||||
|
||||
var bindings = require('./bindings')
|
||||
|
||||
@ -67,3 +68,9 @@ imagestream.end = function(b){
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Provide cascade data for faces etc.
|
||||
|
||||
cv.FACE_CASCADE = path.resolve('../data/haarcascade_frontalface_alt.xml')
|
||||
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ vows.describe('Smoke Tests OpenCV').addBatch({
|
||||
, cb = this.callback
|
||||
|
||||
cv.readImage("./examples/mona.png", function(err, im){
|
||||
im.detectObject("./data/haarcascade_frontalface_alt.xml", {}, cb)
|
||||
im.detectObject(cv.FACE_CASCADE, {}, cb)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user