Hi,
I'm a newbie at Processing and got some questions when I use JMyron. At first I want to combine the brightness tracking function with using webcam as mouse function. It works well when it has only one brightest glob in the screen. However, if there are multi brightest globs, the camera just get to confuse

I guess maybe I need multi-mouses function, but still have no idea how to do that. Anybody can give me some help about it please?

Thanks very very much!
This is my code:
import JMyron.*;
JMyron m;
float objx = 320;
float objy = 240;
float objdestx = 320;
float objdesty = 240;
void setup(){
size(320,240);
m = new JMyron();//make a new instance of the object
m.start(width,height);//start a capture
m.trackColor(255,255,255,2);//R, G, B, and range of similarity
m.minDensity(100); //minimum pixels in the glob required to result in a box
println("Myron " + m.version());
noFill();
}
void draw(){
m.update();//update the camera view
drawCamera();//draw the camera to the screen
int[][] b = m.globBoxes();//get the center points
float avX=0;
float avY=0;
//draw the boxes
stroke(255,0,0);
for(int i=0;i<b.length;i++){
rect( b[i][0] , b[i][1] , b[i][2] , b[i][3] );
avX += b[i][0];
avY += b[i][1];
}
if(b.length-1>0){
avX/=b.length-1;
avY/=b.length-1;
}
//mouse follow
if(!(avX==0&&avY==0)&&b.length>0){
objdestx = avX;
objdesty = avY;
}
objx += (objdestx-objx)/10.0f;
objy += (objdesty-objy)/10.0f;
noFill();
ellipse(objx,objy,30,30);
}
void drawCamera(){
int[] img = m.image(); //get the normal image of the camera
loadPixels();
for(int i=0;i<width*height;i++){ //loop through all the pixels
pixels[i] = img[i]; //draw each pixel to the screen
}
updatePixels();
}
public void stop(){
m.stop();//stop the object
super.stop();
}