i have this code
import processing.video.*;
PImage imagen;
Capture camara;
int ancho = 640;
int alto = 480;
boolean monitor = true;
SupImagen entrada,salida;
MoCap mocap;
PImage a;
PImage b;
PImage c;
PImage d;
PImage e;
void setup(){
imagen = loadImage ("2.jpg" );
size( 1800 , 800 );
background (255);
a = loadImage ("1.png" );
b = loadImage ("2.png" );
c = loadImage ("3.png" );
d = loadImage ("4.png" );
e = loadImage ("5.png" );
camara = new Capture( this , ancho , alto );//inicializo
entrada = new SupImagen( ancho , alto );
salida = new SupImagen( ancho , alto );
int retardo = 5;
int umbral = 40;
mocap = new MoCap( ancho , alto , retardo , umbral );
mocap.conFondo = true;
noFill();
// background (imagen);
rectMode(CENTER);
}
void draw(){
//background (imagen);
noFill();
if( camara.available() ){ //pregunto si hay fotogramas disponibles
camara.read(); //leo el fotograma
entrada.cargarImg( camara );
mocap.capturarMov( entrada );
mocap.imprimirMov( salida );
println( mocap.area );
stroke(255,0,0);
if(( mocap.area > 6900 )&& (mocap.area < 10000))
{
image( a, mocap.centx*2 , mocap.centy*2 );
}
if (( mocap.area>12000) && (mocap.area< 29000))
{
image ( b, mocap.centx*2 , mocap.centy*2 );
}
if ( (mocap.area>30500)&&(mocap.area<42000)){
image ( c, mocap.centx*2 , mocap.centy*2 );
}
if ( (mocap.area>11000)&&(mocap.area<17000)){
image ( d, mocap.centx*2 , mocap.centy*2 );
}
if( monitor ){
entrada.imprimirImg( 0 , 0 );
salida.imprimirImg( ancho , 0 );
}
}
}
void keyPressed(){
if( key==' ' ){
mocap.resetFondo();
}
if( key=='a' ){
monitor = !monitor;
background (255);
}
}