Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'provide-cascades' into beta

Conflicts:
	lib/opencv.js
  • Loading branch information...
commit 0840e0b2e2f724e6ce9137ccdca0ef7c924b3588 2 parents 4ca1656 + a8e5ac4
@peterbraden authored
Showing with 12 additions and 3 deletions.
  1. +2 −1  README.md
  2. +9 −1 lib/opencv.js
  3. +1 −1  test/unit.js
View
3  README.md
@@ -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);
@@ -132,6 +132,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:
View
10 lib/opencv.js
@@ -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')
@@ -68,6 +69,7 @@ imagedatastream.end = function(b){
}
+<<<<<<< HEAD
cv.ImageStream = function(){
this.writable = true
@@ -105,3 +107,9 @@ ods.write = function(m){
}
+
+// Provide cascade data for faces etc.
+
+cv.FACE_CASCADE = path.resolve('./data/haarcascade_frontalface_alt.xml')
+
+
View
2  test/unit.js
@@ -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)
})
}
Please sign in to comment.
Something went wrong with that request. Please try again.