Diana Thompson, Final

MIND THERAPY, MEDITATION DOME

“All it takes is 10 mindful minutes.” Andy Puddicombe

Meditation dome allows you to refresh your mind for 10 minutes a day, simply by being mindful and experiencing the present moment. It’s small enough to be installed in any home or office space yet large enough to fit any adult.

How it works:

A person climbs into the meditation pod, sits in a lotus pose, and tries to relax. In the meantime, an HD camera with face detection technology sends a signal to Processing to start playing zen music ideally-suited for meditation. After 10 minutes, the music stops – that’s the indication that that your 10 minute mind refreshing is over and you’re good to go about your day. If the person leaves the dome before 10 minutes is up, the face detection technology will send a signal to stop playing the music.

How it’s built:

5417_PPa

IMG_5397 IMG_5398 IMG_5399  IMG_5409Untitled-1

Watch the video here

Code:

//Diana Thompson
//Art Institute of Seattle, final project

import ddf.minim.*;
import processing.video.*;
import gab.opencv.*;
import java.awt.*;

Capture video;
Minim minim;
AudioPlayer player1;
AudioPlayer player2;
OpenCV myopencv;

void setup() {
size(640, 480);

String Vid = "Logitech HD Webcam C310"; //finds correct camera
video = new Capture(this, 640/2, 480/2, Vid);

myopencv = new OpenCV(this, 640/2, 480/2);
myopencv.loadCascade(OpenCV.CASCADE_FRONTALFACE); 
 
video.start();

minim = new Minim(this);
player1 = minim.loadFile("melodic-piano-atmosphere.mp3");
player2 = minim.loadFile("meditations-over-the-river.mp3"); 
}

void draw() {
scale(2);
myopencv.loadImage(video);
image(video, 0, 0);
noFill();
stroke(123, 255, 24);
strokeWeight(9);
Rectangle[] faces = myopencv.detect();
println("Number of Faces Detected:" + faces.length);
 
 player2.pause(); //player is paused by default, if no faces detected
 player1.pause();
 if (faces.length ==1) { //if 1 face is detected
 player1.play(); //start playing this song
 } else if (faces.length == 2) { //if 2 faces are detected 
 player2.play(); //stop playing the next song
 println("stop");
 }
 
 for (int i = 0; i < faces.length; i++) {
 rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height); //green rectangle that draws the face // if (0<x 
 }
}

void captureEvent(Capture c) {
 c.read();
}
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s