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
facedetect callout new xmls (Read 326 times)
facedetect callout new xmls
Jun 29th, 2008, 7:51am
 
hi just wondering if there is a solution to this problem I am encountering. What I want to do is generate an array that calls out the different xmls for the facedetect library so that an object (in this case, an SVG) is continuously tracked to the different xmls as they are being recoginized. Any help would be appreciated. Thanks in advance everyone!



import processing.candy.*;
import processing.xml.*;

SVG m;


import processing.video.*;
import FaceDetect.*;

FaceDetect fd;

Capture cam;

int MAX = 10;

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



void setup(){

 size(320,240);
  frameRate (25);
 cam = new Capture(this, 320, 240);
 fd = new FaceDetect(this);
   
 fd.start("haarcascade_frontalface_alt.xml", width,height,20);

m = new SVG(this, "hello.svg");
 m.drawMode(CORNER);

 noFill();

}

void draw(){
background (0);
 if (cam.available()) {
   cam.read();
   image(cam,0,0);

   Faces = fd.face(cam);
 
   int count = Faces.length;
   //    println(count);
   if (count >= 0) {
     for (int i = 0;i<count;i++) {
       x[i] = Faces[i][0];
       y[i] = Faces[i][1];
       r[i] = Faces[i][2] * 2;
       m.draw(x[i],y[i]-120,100,66);
     }
   
 }
}
}
Page Index Toggle Pages: 1