We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
face detection (PC) with qicktime (Read 526 times)
face detection (PC) with qicktime
May 2nd, 2008, 11:30am
 
hi.
i tried to run bryan chungs Face Detection Library for Processing (PC) in my pc. I set up everything as described on the site. Since JMyron doesn't seem to work on my machine (winxp sp2 shuts downs instantly) i tried to make it work with quicktime input. I get the following error:
...

the code:
Code:
import pFaceDetect.*;
import processing.video.*;

PFaceDetect face;
PImage img;
Capture cam;
boolean newFrame = false;

void setup() {
size(320,240);
face = new PFaceDetect(this,width,height,
"haarcascade_frontalface_default.xml");
frameRate(15);

cam = new Capture(this, 40*4, 30*4, 15);
img = new PImage(80, 60, ARGB);

rectMode(CORNER);
noFill();
stroke(255,0,0);
smooth();
}

void captureEvent(Capture cam) {
cam.read();
}


void draw() {
background(0);
img.copy(cam, 0, 0, cam.width, cam.height, 0, 0, img.width, img.height);
img.updatePixels();
face.findFaces(img);
image(img,0,0);
drawFace();
}

void drawFace() {
int [][] res = face.getFaces();
if (res.length>0) {
for (int i=0;i<res.length;i++) {
int x = res[i][0];
int y = res[i][1];
int w = res[i][2];
int h = res[i][3];
rect(x,y,w,h);
}
}
}

void stop() {
super.stop();
}


what went wrong?
Re: face detection (PC) with qicktime
Reply #1 - May 2nd, 2008, 12:38pm
 
Hi,

have you put the "haarcascade_frontalface_default.xml" file in the data folder of your sketch?

Re: face detection (PC) with qicktime
Reply #2 - May 2nd, 2008, 1:20pm
 
thanks for your anwer. face detection works now.
but it's quite slow, compared to blob detection. is there a way to speed this up a little?
Re: face detection (PC) with qicktime
Reply #3 - May 2nd, 2008, 2:19pm
 
Use a faster computer Cheesy

Face detection is not really comparable to blob detection...

You can make it faster by passing it smaller images, but you'll always get a drop in framerate... and from your code, it seems you're already using small images...
Page Index Toggle Pages: 1