« October 2007 | Main | December 2007 »

November 26, 2007

week 10- thanksgiving

wahooo!

finger tracking and contour tracking is working

using proximity and assigning ids to fingers, in the .h, I figure out the 'error' for all blobs in current frame and error is then defined as the distance between the current frame blobs and the last frame. I found that simply optimizing for the least change in distance allowed for fastest and cleanest tracking without lag.

By generating a matrix of all the possible points, e.g. if we know there are four points last frame and 6 points this frame, then 2 id's will be -1 and can calculate the error and pick up the matric that has the lowest error, the more points the slower this seems to be :(

Awesomely enough there aren't usually many points to deal with, and to rememdy the cpu time that grows with higher numbers of points, i can assume that the chosen ID is from one of the top 4 closest points.

more to come.

November 25, 2007

the wind is telling secrets again.

i want the deep, down silent things that are locked in your heart.

the beautiful innuendos of future, the streaming bittersweet decline, the inanimate objects we call home. my discarded, heartless ramblings, destined to never see seriousness until the light at the end of the tunnel flickers out.

the hovering bird goes to sleep.
go back to bed.

all i want is to put my hands between your ribs and know that i'm somewhere in there.

compform final presentation

Picture 4.png


For my compform final project I am working with OpenCV , OpenFramworks and multitouch hardware (hardware developed with Stefan H).

I am interested in the intersections of sound, cv and touch to create alternative interfaces for visual creations in music and dynamic art.

Here is a screen shot to give you a rough idea of a mid way point (using the isight camera, you can see my face).

Mapping the pitch to the coordinates of fingers on the display allows the user to play higher notes higher up from the 0,0 origin and closer to the origin, lower notes. Ultimately it will, in theory, work like a small piano or keyboard with a few octave ranges or tone ranges.

November 15, 2007

week 9

Picture 2a.png

Picture 3a.png

Picture 4a.png

Picture 5a.png


void Mesh::drawWireframe()
{
glColor3f( 0,0,0 );

for( int i=0; i {
for( int j=0; j {
//glVertex3f( grid[i][j].x, grid[i][j].y, grid[i][j].z );

glBegin( GL_LINE_LOOP );
glVertex3fv( (float*) &grid[i][j] );
glVertex3fv( (float*) &grid[i+1][j] );
glVertex3fv( (float*) &grid[i+1][j+1] );
glEnd();

glBegin( GL_LINE_LOOP );
glVertex3fv( (float*) &grid[i][j] );
glVertex3fv( (float*) &grid[i][j+1] );
glVertex3fv( (float*) &grid[i+1][j+1] );
glEnd();
}
}
}


void Mesh::makeSineGrid()
{
for( int i=0; i {
for( int j=0; j {
grid[i][j].x = i*w;
grid[i][j].y = sin(i*w)*(20/3.1415) + cos(j*h)*(20/3.1415);
grid[i][j].z = j*h;
}
}
}

void Mesh::makeGrid()
{
for( int i=0; i {
for( int j=0; j {
grid[i][j].x = i*5;
grid[i][j].y = 0;
grid[i][j].z = j*5;
}
}
}

void Mesh::drawShadedTriangle( const Vec3d& A,
const Vec3d& B,
const Vec3d& C )
{
// define vectors within triangle
Vec3d AB = B - A;
Vec3d AC = C - A;

Vec3d normal = AB.perpendicular(AC);

// set up lighting vector
Vec3d light( 100, 80, 0 );
light.normalize();

// compute shading
float shade = fabs(light.dot(normal));

glColor3f( shade*0.1, shade*0.2, shade*0.5 );
glBegin( GL_TRIANGLES );
glVertex3f( A.x, A.y, A.z );
glVertex3f( B.x, B.y, B.z );
glVertex3f( C.x, C.y, C.z );
glEnd();
}

week 9- working on the final

heres the finger tracking on the multitouch working, notice it recognizes the finger as a vector not a pointer! woot!

anyhow, more to come. code isn't open yet, but working with Zach Libermann at the moment to get some applications OS on OpenFrameworks

November 13, 2007

expressing personal narratives as data



I am interested in the exploration of why people keep what we do and how those artifacts of our history define who we are as a society or more specifically a gender.

I originally wanted to create a book format, then settled on a projection. I like the physical and virtual marriage of medium. The words and text are dynamic, the wood, static. The words and objects seen in the projection are peoples answers when they were asked 'what would you take, if you had only a minute to save something from your burning home?' Users post their answers at tokori.livejournal.com and the answers are updated in the projection to the specific area which the object 'lived' within the homes architecture via xml parsing.

I am interested in the exploration of human artifacts, why do some object survive moves and others are discarded? Why do we choose to keep what we keep or what is the meaning we hold within the object?

The projection of words is projected on a piece of wood where they fall into where they 'lived' within their domestic environments. The floorplan of a house has been burned onto the wood symbolic of fire.


November 07, 2007

week 8


(I am quite proud of my alpha on the sides of the mnt)


multiple vertical distortions


waves in two directions on x/z axis

void myMesh::drawShadedTriangle( const ofPoint3f& A, const ofPoint3f& B, const ofPoint3f& C ) {
	// define vectors within triangle
		ofVec3f AB = B - A;
		ofVec3f AC = C - A;

ofVec3f normal = AB.cross(AC);
normal.normalize();

// set up lighting vector
ofVec3f light( 0, 1000, 0 );
light.normalize();

// compute shading
float shade = fabs(light.dot(normal));

glColor3f( shade*0.1, shade*0.2, shade*0.5 );
glBegin( GL_TRIANGLES );
glVertex3f( A.x, A.y, A.z );
glVertex3f( B.x, B.y, B.z );
glVertex3f( C.x, C.y, C.z );
glEnd();
}

November 01, 2007

3d meshes

bird2.jpg

heres my second attempt at using 3d meshes for Ai to use in Af.

Each part of the body is a layer which can be manipulated or animated (head, beak, tail, wings, feet, body and head feathers)

homework.. week um..

part 1:
Picture 1.png

part 2:

Picture 2.png

and I also managed to get my original idea for the midterm project running, although I found the lines were too complex for the eye to follow so I reworked the UI a bit and went with a more easy to 'read' piece.

On the y-axis you see a collection of tangible information (date, gender and value) some of the information was estimated based on other information found about similar works by the same artist, regardless you can compare dynamically different art works, by moving them closer to other pieces you can see how high different values are in comparison to their neighbors.

I'm interested in mapping this information dynamically in some sort of UI. Ideally so that anyone can manage a large collection as if to curate an entire museum . . . on their own terms.

here is a movie to give you an idea of how it works-- code is also provided behind the cut..


you can also see it here if the above embedding doesn't play nice.

problem 1:


for( int step=0; step glBegin( GL_LINE_LOOP );
for ( int arc=0; arc float a = arc / circlesteps*PI*2.0;
float x = radius*cos( a );
float y = step*stepheight;
float z = radius*sin( a );
glVertex3f( x, y, z );
}
glEnd();
}
for( int step=0; step for( int arc=0; arc< circlesteps; arc++ ) {
glBegin( GL_LINE_STRIP );
float a = arc / circlesteps*PI*2.0;
float x = radius*cos( a );
float z = radius*sin( a );
glVertex3f( x, step*stepheight, z );
glVertex3f( x, (step+1)*stepheight, z );
glEnd();

problem 3:

float circlesteps = 30;
vector circleCurr;
vector circlePrev;

for( int i=0; i

glBegin( GL_LINE_LOOP );
for ( int arc=0; arc float a = arc / circlesteps*PI*2.0;
float radius = points[i].x;
ofPoint3f cp = ofPoint3f( radius*cos(a), points[i].y, radius*sin(a) );
circleCurr.push_back(cp);
glVertex3f( cp.x, cp.y, cp.z );
}
glEnd();

glBegin( GL_LINES );
for( int i=0; i glVertex3f( circleCurr[i].x, circleCurr[i].y, circleCurr[i].z );
glVertex3f( circlePrev[i].x, circlePrev[i].y, circlePrev[i].z );
}
glEnd();

circlePrev.clear();
for( int i=0; i circlePrev.push_back( circleCurr[i]);
}
circleCurr.clear();

midterm part 2


#include
#include
#include

#include "ofMain.h"
#include "ofStefanix.h"
#include "ofDirList.h"

#include "photoMetadata.h"
#include "ImageWidget.h"


class world : public ofSimpleApp {
public:

void setup();
void update();
void draw();
void layoutImages();
void drawLayers();
void tagImages();
void loadImages();

vector images;
multimap imagesByOffsetX;

float imgOffY;
float imgCellH;
float imgCellW;
float imgPadX;
float imgPadY;


void keyPressed( int key );
void mouseMoved( int x, int y );
void mouseDragged( int x, int y, int button );
void mousePressed( int x, int y, int button );
void mouseReleased();
};


void world::setup() {
loadImages();

imgOffY = 600;
imgCellH = 0;
imgCellW = 0;
imgPadX = 5;
imgPadY = imgPadX;

layoutImages();
}

void world::update() {
ofBackground( 100, 100, 100 );

}

void world::draw() {

ofSetColor( 0x222222 );
ofRect( 0, imgOffY-50, ofGetWidth(), ofGetHeight()-550 );


glBegin(GL_POLYGON);
ofSetColor( 0x000000 );
glVertex2f(0, imgOffY-40);
glVertex2f(0, imgOffY-50);
ofSetColor( 0xffffff );
glVertex2f(ofGetWidth(), imgOffY-50);
glVertex2f(ofGetWidth(), imgOffY-40);
glEnd();


for( int i=0; i ImageWidget* img = images[i];
if( img->mouseOver ) {
ofSetColor( 0xffffff );
} else {
ofSetColor( 0x888888 );
}
img->draw();
}
drawLayers();

ofSetColor( 0xffffff );
ofDrawBitmapString( "mountGraph.",20, 748 );
}


void world::layoutImages() {
static float focusedImgW = 100;
imgPadX = 5;
imgCellW = (ofGetWidth()+2*imgPadX)/IMGNUM; //no padding at the very ends

imgCellH = imgCellW;
imgPadY = imgPadX;

imagesByOffsetX.clear();
for( int i=0; i ImageWidget* img = images[i];
img->loc.set(i*imgCellW, imgOffY);
img->dwidth = imgCellW-2*imgPadX;
img->dheight = imgCellH-2*imgPadY;
img->dragBBmin.set(0, imgOffY-50);
img->dragBBmax.set(ofGetWidth(), ofGetHeight());
imagesByOffsetX.insert(pair(i*imgCellW, i));
}
}

void world::drawLayers() {
float ridge[IMGNUM];
multimap::iterator iterX;

//init ridge
for( int ii=0; ii ridge[ii] = imgOffY-50;
}

//subjective value
ofSetColor(0xee00ff);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, imgOffY-50);
for( iterX = imagesByOffsetX.begin(); iterX!=imagesByOffsetX.end(); ++iterX ) {
pair p = *iterX;
int i = p.second;
float val = ofRangemap(0, 10, 3, 33, phmdSubjectiveValue[i]);
ImageWidget* img = images[i];
glVertex2f(img->loc.x, ridge[i]-val);
glVertex2f(img->loc.x, ridge[i]);
ridge[i] = ridge[i]-val;
}
glVertex2f(ofGetWidth(), imgOffY-50);
glEnd();


//political relevance
ofSetColor(0x8888ff);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, imgOffY-50);
for( iterX = imagesByOffsetX.begin(); iterX!=imagesByOffsetX.end(); ++iterX ) {
pair p = *iterX;
int i = p.second;
float val = ofRangemap(0, 10, 3, 23, phmdPoliticalRelevance[i]);
ImageWidget* img = images[i];
glVertex2f(img->loc.x, ridge[i]-val);
glVertex2f(img->loc.x, ridge[i]);
ridge[i] = ridge[i]-val;
}
glVertex2f(ofGetWidth(), imgOffY-50);
glEnd();


//creation date
ofSetColor(0xff5555);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, imgOffY-50);
for( iterX = imagesByOffsetX.begin(); iterX!=imagesByOffsetX.end(); ++iterX ) {
pair p = *iterX;
int i = p.second;
float val = ofRangemap(1967, 2007, 3, 43, phmdCreationYear[i]);
ImageWidget* img = images[i];
glVertex2f(img->loc.x, ridge[i]-val);
glVertex2f(img->loc.x, ridge[i]);
ridge[i] = ridge[i]-val;
}
glVertex2f(ofGetWidth(), imgOffY-50);
glEnd();


//artist birth date
ofSetColor(0xffff33);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, imgOffY-50);
for( iterX = imagesByOffsetX.begin(); iterX!=imagesByOffsetX.end(); ++iterX ) {
pair p = *iterX;
int i = p.second;
float val = ofRangemap(1900, 1980, 3, 23, phmdArtistYearOfBirth[i]);
ImageWidget* img = images[i];
glVertex2f(img->loc.x, ridge[i]-val);
glVertex2f(img->loc.x, ridge[i]);
ridge[i] = ridge[i]-val;
}
glVertex2f(ofGetWidth(), imgOffY-50);
glEnd();

}


void world::tagImages() {
/*
ofDirList DIR;
char inpath[] = "/Users/noema/svn/openFrameworks/myapp/luminoStory/src/pix_medium_skyline";

*/
}


void world::loadImages() {
ofDirList DIR;
char inpath[] = "../../../data/";
DIR.setVerbose(false);
int numFiles = DIR.listDir(inpath);

//ofImage images[numFiles];

for(int i = 0; i < numFiles; i++) {
ImageWidget* temp = new ImageWidget;
temp->loadImage(DIR.getPath(i));
images.push_back(temp);
}
}

void world::keyPressed( int key ) {
if( key == ' '){
layoutImages();
}
}
void world::mouseMoved( int x, int y ) {
for( int i=0; i images[i]->mouseMoved(x, y);
}
}
void world::mouseDragged( int x, int y, int button ) {
for( int i=0; i ImageWidget* img = images[i];
int tempX = img->loc.x;
if( img->mouseDragged( x, y)) {
//delete old entry
//int count = imagesByOffsetX.count(tempX);
multimap::iterator p = imagesByOffsetX.find(tempX);
if( p != imagesByOffsetX.end() ) {
while (p != imagesByOffsetX.upper_bound(tempX)) {
if( p->second == i) {
imagesByOffsetX.erase(p);
break;
}
p++;
}
}
//reinsert under different key
imagesByOffsetX.insert(pair(img->loc.x, i));
}
}
}
void world::mousePressed( int x, int y, int button ) {
for( int i=0; i images[i]->mousePressed( x, y );
}
}
void world::mouseReleased() {
for( int i=0; i images[i]->mouseReleased();
}
}


int main() {
ofSetupOpenGL( 1024, 768, OF_WINDOW );
world APP;
ofRunApp( &APP );
}