import hypermedia.video.*; //importar libreria PImage mascara; OpenCV opencv; // valores de brillo y contraste de la imagen de video int contrast_value = 0; int brightness_value = 0; void setup() { size( 640, 480 ); mascara = loadImage("concha.png"); opencv = new OpenCV( this ); opencv.capture( width, height ); // open video stream opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load detection description, here-> front face detection : "haarcascade_frontalface_alt.xml" // print usage println( "Drag mouse on X-axis inside this sketch window to change contrast" ); println( "Drag mouse on Y-axis inside this sketch window to change brightness" ); } public void stop() { opencv.stop(); super.stop(); } void draw() { opencv.read(); opencv.contrast( contrast_value ); opencv.brightness( brightness_value ); //Detectar caras usando haar Rectangle[]cara = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 ); image( opencv.image(), 0, 0 ); for( int i=0; i