import processing.video.*; import FaceDetect.*; import de.bezier.data.sql.*; Capture myCapture; PImage[] myImage = new PImage[100]; MySQL msql; FaceDetect fd; String user = "bob"; String pass = "password"; String database = "test"; String table = "video_list"; int MAX = 10; int[] x = new int[MAX]; int[] y = new int[MAX]; int[] r = new int[MAX]; int[][] Faces = new int[MAX][3]; int x_pos = 0; int y_pos = 0; int activeImage = 1; String path = "/Users/coupe/Documents/Processing/face_test/"; void setup() { size(640, 240, P3D); myCapture = new Capture(this, 320, height, 30); fd = new FaceDetect(this); fd.start("haarcascade_frontalface_alt.xml", width,height,30); stroke(255,200,0); noFill(); // get available videos msql = new MySQL( this, "localhost", database, user, pass ); if (msql.connect()){ msql.query( "SELECT * FROM " + table ); while (msql.next()) { String s = msql.getString("filename"); myImage[msql.getInt("id")] = loadImage(path + s); println(s); } } else{ println("connection failed!"); } } void draw() { image(myImage[activeImage], 320, 0); image(myCapture, 0, 0); Faces = fd.face(myCapture); int count = Faces.length; if (count>0) { for (int i = 0;i " + msql.getString("filename")); activeImage = msql.getInt("id"); } } } } } void captureEvent(Capture c) { c.read(); }