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.
Pages: 1 2 
Face Detect Library (Read 13487 times)
Re: Face Detect Library
Reply #15 - Nov 11th, 2008, 12:31pm
 
hi,

i'm trying to get your library to work with 2 simultaneous FaceDetects, one for front face detection another for profile face.

the problem is that only the latter works.

im my tests i saw that the problem is in the cascade xml detection: fdSide.start("haarcascade_profileface.xml", width, height, 20);
it assumes only the last loaded cascade.

it seems like the cascade is a singleton static variable, so there can be only one.

can you tell me if my assumption is true and if so is there a way you can change this so we can have many facedetects at the same time?

the code i'm using:
import JMyron.*;
import FaceDetect.*;

FaceDetect fdFront;
FaceDetect fdSide;

int MAX = 10;
JMyron m;

int w = 640;
int h = 480;

int[] x = new int[MAX];
int[] y = new int[MAX];
int[] r = new int[MAX];

int[][] FrontFaces = new int[MAX][3];
int[][] SideFaces = new int[MAX][3];

int[] img = new int[w*h];

PImage face_img; // 160x247
PFont font;

void setup(){

size(w,h);
m = new JMyron();
m.start(width,height);

fdFront = new FaceDetect(this);
fdFront.start("haarcascade_frontalface_default.xml", width, height, 20);

fdSide = new FaceDetect(this);
fdSide.start("haarcascade_profileface.xml", width, height, 20);

strokeWeight(2);
stroke(255,200,0);
noFill();

face_img = loadImage("smilingface_big.png");

font = loadFont("BitstreamVeraSansMono-Roman-12.vlw");
textFont(font);

}

void draw(){

background(0);
m.update();
img = m.image();
loadPixels();
arraycopy(img,pixels);
updatePixels();

SideFaces = fdSide.face(img);
int sideCount = SideFaces.length;
if (sideCount>0) {
for (int i = 0;i<sideCount;i++) {
x[i] = SideFaces[i][0];
y[i] = SideFaces[i][1];
r[i] = SideFaces[i][2];
ellipse(x[i],y[i],r[i],r[i]);
}
}

FrontFaces = fdFront.face(img);
int frontCount = FrontFaces.length;
if (frontCount>0) {
for (int i = 0;i<frontCount;i++) {
x[i] = FrontFaces[i][0];
y[i] = FrontFaces[i][1];
image(face_img, x[i]-80, y[i]-150);
}
}

String s = "Front Faces: " + Integer.toString(frontCount) +
" | Side Faces: " + Integer.toString(sideCount);

fill(255, 255, 0);
text(s, 20, height - 20);
noFill();
}





Re: Face Detect Library
Reply #16 - Mar 25th, 2009, 2:31am
 
I get this error using FaceDetect 052b:

Invalid memory access of location 39a00000 eip=398695f9.
Is it something with the libFaceDetect.jnilib? I think it gives an error too.

edit:
Mmm I reinstalled Framework.Opencv
Than it worked... for a while.
Now getting same error again. Really unstable.

I used processing video lib
Mac OSx 10.5
Pages: 1 2