mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Classifier resize image, new example
This commit is contained in:
parent
f855b2a332
commit
c01ae532a6
20
smoketest.js
20
smoketest.js
@ -1,17 +1,17 @@
|
||||
var cv = require('./lib/opencv')
|
||||
, assert = require('assert')
|
||||
, fs =require('fs')
|
||||
|
||||
//console.log(cv.version)
|
||||
|
||||
new cv.VideoCapture(0).read(function(mat){
|
||||
|
||||
cv.readImage("./examples/mona.png", function(err, im){
|
||||
im.detectObject("./data/haarcascade_frontalface_alt.xml", {}, function(err, faces){
|
||||
mat.resize(200,100)
|
||||
mat.save('./out.jpg')
|
||||
|
||||
mat.detectObject("./data/haarcascade_frontalface_alt.xml", {min : [30,30]}, 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);
|
||||
mat.ellipse(x.x + x.width/2, x.y + x.height/2, x.width/2, x.height/2);
|
||||
}
|
||||
im.save('./out.jpg');
|
||||
|
||||
});
|
||||
console.log(faces.length ? (faces.length + " faces found") : "No faces")
|
||||
mat.save('./out.jpg');
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
@ -134,7 +134,7 @@ void AsyncDetectMultiScale(uv_work_t *req) {
|
||||
|
||||
|
||||
equalizeHist( gray, gray);
|
||||
baton->cc->cc.detectMultiScale(gray, objects, baton->scale, baton->neighbors, 0, cv::Size(baton->minw, baton->minh));
|
||||
baton->cc->cc.detectMultiScale(gray, objects, baton->scale, baton->neighbors, 0 | CV_HAAR_SCALE_IMAGE, cv::Size(baton->minw, baton->minh));
|
||||
|
||||
baton->res = objects;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user