Iteration 5

//create image in folder i save it in, in data folder.

import gab.opencv.*;
import java.awt.*;

Movie react;
Capture video;
OpenCV opencv;

void setup() {
size(1280, 720);
//scale video down, so it runs smoother
video = new Capture(this, 640/2, 480/2);
//loading open cv, and face tracking
opencv = new OpenCV(this, 640/2, 480/2);


//loading my video
react = new Movie(this, “beth”);
//looping video

void draw() {

//scaling video back up to fit the canvas

//displaying the camera video, will be removed
image(video, 0, 0 );

//adjusting the reaction video
//scaling video down to fit canvas
//tint to make transparent
//tint(255, 185);
//display my reaction video
image(react, 0, 0);

//styling for the face tracking rectangle
//stroke(0, 255, 0);
Rectangle[] faces = opencv.detect();

//draw rectangle around the face
//for (int i = 0; i < faces.length; i++) { // println(faces[i].x + “,” + faces[i].y); // rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height); // } //if one or more faces are seen, reaction video will play, else it is paused. if (faces.length >= 1) {;
} else {
//when theres no face, reaction video jumps to beginning

void captureEvent(Capture c) {;

void movieEvent(Movie m) {;

In this iteration I have used the final video for my project, it is the smile and wave video. In the video you can see that the face animates until there is no face seen. This then pauses the video and jumps it back to the beginning. I am happy with this because it is how I wanted it to be, but I think I’m going to mess around with it and see if i can add the other videos into it so that they play after the first video has played.

This a video of the piece, with me in the corner showing how it works:

The video below shows how the video would display to the audience:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s