78
edits
Changes
Aquarium
,→Documentation
super.stop();
}
</code>
balloon code
<code>
import hypermedia.video.*;
OpenCV opencv;
PImage balloon;
void setup() {
size( 640, 480 );
balloon=loadImage("balloon.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"
}
void draw() {
opencv.read();
Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );
image( opencv.image(), 0, 0 );
// draw face area(s)
noFill();
noStroke();
for( int i=0; i<faces.length; i++ ) {
rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );
image (balloon, faces[i].x, faces[i].y+(faces[i].height), faces[i].width, faces[i].height);
}
}
</code>