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 detector and JMyron (Read 5843 times)
Face detector and JMyron
May 19th, 2008, 6:30am
 
Hello, I tryed to make the face detector example run, I took it from http://www.bryanchung.net/?page_id=251 (face detector library).

But I get the following message error:

"NULL pointer (Invalid classifier cascada)
in function cvCHaarDetectObjetc, c:\user\vp\opencv\cv\sarc\cvchaar.cpp(890)
Abort - termine application
retry - to debugg
ignore to continue"

As far as I understood it's not necessary to install OpenCV meanwhile I put the .xml in the sketch folder, and the cxcore100.dll, cv100.dll, libguide40.dll libraries in the Processing folder.

Thanks for any suggestions.
BTW. sorry for my english

Greets, ro
Re: Face detector and JMyron
Reply #1 - May 25th, 2008, 6:05pm
 
Hello,
I get exactly the same error message with pFaceDetect.
I have installed OpenCV.

I've runned the JMyron examples and they work.
I've runned the OpenCV examples and they work.

But pFaceDetect don't work...

Anybody knows ?...
Thank you.
Re: Face detector and JMyron
Reply #2 - May 25th, 2008, 8:12pm
 
Hello, could you tell me how you installed the pFaceDetect library?. I don't know if I did it in the right way.
I didn't installed OpenCV, I undserstand it isn't necessary, correct me if I'm wrong.

I tryed to find an email or a 'comment place', to contact Bryan Chung (the author) and tell him about this issue. I haven't found any way to contact him yet.

Info: processing under Windows XP.

thanks, ro
Re: Face detector and JMyron
Reply #3 - May 26th, 2008, 5:57am
 
i using same lib without any trouble.installed the opencv and put into the env_path like this PATH:D:\Program Files\OpenCV\bin

maybe the dll issue?
Re: Face detector and JMyron
Reply #4 - May 26th, 2008, 6:51am
 
Thank you for your reply. I have no idea if it is a dll issue.  I'd like to know if pFaceDetector library is well installed (where you copy the dll, the xml file, etc).

As soon as is possible I'll try your 'tip' and I'll post the result.
Greets, ro
Re: Face detector and JMyron
Reply #5 - May 26th, 2008, 10:28am
 
Thanks for your responses,
Liquid what do you mean by "put into the env_path like this PATH : \Program Files\OpenCV\bin " ?
I have tried to use the jorgecardoso.org dll but it's the same.

Rochi I think this is the right way to to install pFaceDetect : the zip downloaded at Bryan Chung contains 3 folders. Go to your Processing folder/librairies > create a folder "pFaceDetect" and put in the "librairy" folder from the zip. This folder contains "pFaceDetect.jar" and "PFaceDetect.dll". Then when you create a new sketch put the "data" folder from the zip in your sketch folder.

I did this but I have the same probleme as you...
Re: Face detector and JMyron
Reply #6 - May 26th, 2008, 1:44pm
 
I have re-installed OpenCv.
I have checked "Add \OpenCV\bin to system PATH" but it's the same...
Re: Face detector and JMyron
Reply #7 - May 26th, 2008, 6:25pm
 
Gronko, thanks you. It seems I have installed pFaceDetect in the (almost) right way. Just a difference, I put the .xml file in various places without luck. First, in the Processing folder, and then in the sketch one.

I didn't install OpenCV yet, instead I put the cxcore100.dll, cv100.dll, libguide40.dll libraries in the Processing folder.
I thought it was enough. I'll install OpenCV as a I said before and I'll cross my fingers.

cheers, ro

Re: Face detector and JMyron
Reply #8 - Nov 8th, 2008, 8:26pm
 
Hello all!

I'm having the very same problem as stated here.

Has anyone got into a solution? If so, could you please share it here with others like me?

I'm using windows vista 32 bits, I have OpenCV installed, the .dlls are in the Processing root, OpenCV folders are in the environment variables path...

Thanks in advance!

Best regards!
Re: Face detector and JMyron
Reply #9 - Nov 27th, 2008, 11:45pm
 
Hello all!

After some time I finally solved the problem with the loading of the .xml file. For everyone having this same problem, you should place the "data" folder with the .xml file that you use, in the folder where you have your sketch.

Do that, and your problem will be solved. ;-D

Best regards!
Re: Face detector and JMyron
Reply #10 - Jun 25th, 2009, 5:43pm
 
Hello, I could run the face detector example, but I have to copy the .dll libraries on the sketch folder to make it works. The data folder with the .xml isn't enough by itself.
I take a look at the example that comes with the library and it has a folder named 'code' with these .dll, so I did the same.

I had to point these .dll in the env-var PATH?, if I do this, the code folder with the .dll ins't necessary.
Thanks, ro
Re: Face detector and JMyron
Reply #11 - Dec 4th, 2009, 11:25pm
 
Thank guy, i has run test successfully with your code,

i have some problem with multi face detection, it can't remember the face number and too much noise for x,y position. did you have some solution for this ?

thank in advance Smiley
Re: Face detector and JMyron
Reply #12 - May 16th, 2010, 8:05am
 
Hi I'm not sure if this is the correct place to post this query.


I m working on a Final year project at uni using processing. The 2 libraries codes i m using are below.
[color=#ff0000][/color]

float mx = 425;
float my = 200;
float bulge = 0;
float leftdist;
float rightdist;
float fillr;
float fillg;
float fillb;
int cx = (x+(w / 2));  // Centre of Face X Axis
int cy = (y+(h / 2));  // // Centre of Face X Axis

void setup() {
 size(640,480);


}

void draw() {

     
 background(0);

 smooth();
 noStroke();
 //eye color
    if(mousePressed) {
   fillr = 255;
   fillg = 210;
   fillb = 0;
 }
 else{
 fillr = cx/5;
 fillg = 255;
 fillb = cy/2;
 }
 
 
 fill(fillr,fillg,fillb);
 
 pushMatrix();
 translate(215,200);
 rotate(PI/8);
 ellipse(0,0,95,70);
 popMatrix();
 
 fill(fillr,fillg,fillb);
 pushMatrix();
 translate(425,200);
 rotate(-PI/8);
 ellipse(0,0,95,70);
 popMatrix();


 //pupil movement
 float targetx = constrain(cx, 405, 445);// instead of WHATS THERE use cx  and cy
 float targety = constrain(cy, 195,205);
 float easing = 0.15;
 mx = mx + (targetx-mx)*easing;
 my = my + (targety-my)*easing;

 fill(0);
 smooth();

 if((mousePressed) && (bulge <= 10)) {
   bulge += 1;
 }
 else{
   if(bulge > 0){
     bulge -= 1;
   }
 }
 leftdist = dist(cx, cy, mx-210,my);
 rightdist = dist(cx,cy, mx, my);
 if((rightdist < 50) || (leftdist < 50 )){
   if(bulge > -10){
     bulge -= 1;
   }
 }
 else{
   if(bulge < 0){
     bulge += 1;
   }
 }

 arc(mx,my,25 + bulge,54 + bulge,-PI/2+1,3*PI/2);
 arc(mx-210,my,25 + bulge,54 + bulge,-PI/2+1,3*PI/2);



}

AND


import pFaceDetect.*;
import JMyron.*;

PFaceDetect face;
JMyron m;//a camera object
PImage img;

// Eyes Code
float mx = 425;
float my = 200;
float bulge = 0;
float leftdist;
float rightdist;
float fillr;
float fillg;
float fillb;



void setup() {
 size(640,480);
 m = new JMyron();
 m.start(width,height);
 m.findGlobs(0);
 face = new PFaceDetect(this,width,height,
 "haarcascade_frontalface_default.xml");
 frameRate(15);
 img = createImage(width,height,ARGB);
 rectMode(CORNER);
 noFill();
 stroke(255,0,0);
 smooth();
}

void draw() {
 background(0);
 
 
 m.update();
 arraycopy(m.cameraImage(),img.pixels);
 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);
     int cx = (x+(w / 2));  // Centre of Face X Axis
     int cy = (y+(h / 2));  // // Centre of Face X Axis
     println ("centre = "+cx+" , "+cy+"    size = "+w+"  x  "+h);

 
   }
 }
}


My goal is combine them so that the eyes move in realtion to the face detect any thoughts??

Thanks
Page Index Toggle Pages: 1