Daily Archives: 25 Jan 2013

Robb

25 Jan 2013

Using my face to control a pan/tilt mirror.

faceOSC, MaxMSP, maxuino, two servos, a teensy 2.0 running standard firmata, and a shard of glass combine to make a system of directing laser beams using your head.
Maxuino is useful for MAX to Arduino communication. It is developed by CMU art professor Ali Momeni.
I used MAX because it is really easy to smooth and visualize data. This project took very little time.
Maxuino actually expects OSC formatted messages, meaning that my patch is simply translating OSC to OSC and then to Firmata.

Screen Shot 2013-01-25 at 4.31.05 PM
GitHub Link

Robb

25 Jan 2013

I went with the threshold method. Ideally, I think it should use background subtraction, but thats for another day.
The rainbow circles give the letters legibility, playfulness, and greater visual weight. I encountered several challenges with this project.
It took me about 4 hours.
I commented the heck out of my mediocre code if anyone is curious.
I have trouble with logic, so that section is likely verbose and roundabout. I’d love some tips.
w/♡,
-Robb

GitHub Link

////RobbRain/////Textrain Spinoff, after Camille Utterback
////2013/////www.robb.cc//////////////////

import processing.video.*; ///add the library

Capture video;

int threshold = 122; //brightness value to count as dark
int letterSize = 20; //diameter of circles, real or imaginary that bound the falling shapes
int columnWidth = 20; //how wide you want the columns to be
int columnQty; //dependent on above
int numPix; //dependent, how many pixels are there?
int[] fallingY; //array of all the y values of our objects
String poem = "Trust not he who winces in rain.";

//char[] poem = { o,h, };  // Alternate syntax

void setup() {
  size(640, 480, P2D); // Change size to 320 x 240 if too slow at 640 x 480
  video = new Capture(this, width, height);
  video.start();  
  colorMode(HSB); //easy rainbows man
  noCursor(); //cursors are for sissys
  noStroke();//as are strokes
  smooth();//doesn't work.
println(poem.length());
  numPix = video.width*video.height; //calc the pixel qty
  columnQty = width/columnWidth; //calc the column qty

  fallingY = new int[columnQty]; //size that array
  for (int i = 0; i height||fallingY[i]<0) {//if it falls off the bottom or top, it should go again. no giving up
        fallingY[i] = 10;
      }
      fallingLetter(sampleX, fallingY[i], poem.charAt(i),i); ///draws the thing.
    }
    if(mousePressed){setup();}////cute.. puts the letters at top if click.
  }
}


void fallingLetter(int letterX, int letterY, char letter, int i) {
  fill(map(i, 0, columnQty, 0, 255), 255, 255, 100);
  ellipse(letterX, letterY, letterSize, letterSize);
  fill(0);
  text(letter, letterX-letterSize/3, letterY+letterSize/5);
}


int brightnessXY(int xxx, int yyy) { ///this lil guy calc the brightness of a video pixel and returns it as an int.
  int  videoIndex = constrain(yyy * video.width + xxx, 0, numPix-1);   //index = y*videoWidth + x
  int briteSpot = int(brightness(video.pixels[videoIndex]));
  return briteSpot;
}

void mouseTrack() { //useful for finding the proper threshold.
  float briteMouse = brightnessXY(mouseX, mouseY);
  if (briteMouse > threshold) { 
    fill(0);
  } 
  else { 
    fill(100);
  }
  rect(mouseX, mouseY, 20, 20);
}

Ersatz

25 Jan 2013

For this assignment I have combined the addons: ofxMacamPS3Eye and ofxFern, creating a simple Augmented reality application.

ofxMacamPs3Eye

This addons is probably the only way to get the long praised Playstation3 EyeCam working inside Openframeworks. It’s capability to run at 60fps at a resolution of 640×480 make it the best affordable solution for AR or any kind of computer vision tracking applications.

ofxFern

ofxFern is an implementatin of the Fern tracker from EPFL CVLab. It’s written by Theo Watson and used in an interactive application they did for the Boards Magazine, back in 2010 – More about his project

Demo Video:

Concept and Process:

A cover of a book with 8bit art is augmented with animation, when shown on the cam.

I tried couple of different images, but colorful magazine and book covers works best with Fern tracking, two color card, won’t work. Then the process is pretty simple, ofxFern will give you coordinates of the four corners of your book cover, which you could use to draw a rectangle textured with a image from a video, in my case the video was created in After Effects using the original static image.

Github: https://github.com/kamend/IACD_ofxFern