Archive for November, 2007

links for 2007-11-30

Friday November 30th, 2007 at 4:24 pm | research

links for 2007-11-29

Thursday November 29th, 2007 at 4:17 pm | research

Mail Garden – Human Centred Data View

Wednesday November 28th, 2007 at 10:40 pm | code : participate

Over the last two and a half weeks I have been at Visualizar, a project hosted by the ever-awesome Medialab Prado in Madrid, Spain, the same people behind the Interactivos workshops, one of which I participated in earlier this year.

I’ve been working on something called Mail Garden. Mail Garden visualises the contents of one mailbox (read in the mbox format for open goodness) on your computer as a forest of trees. Each tree in this forest represents an email, with the height of the trees reflecting the length of the mail. Moving your mouse over a tree shows some details about the email. The overall aim is to create a view of your mailbox that encourages a more reflective kind of consciousness.

Go to the Mail Garden project page for more…

links for 2007-11-28

Wednesday November 28th, 2007 at 4:18 pm | research

links for 2007-11-22

Thursday November 22nd, 2007 at 4:16 pm | research

Ableton Live – like zoom code for Processing

Tuesday November 20th, 2007 at 6:14 pm | code

I put this together this morning, hope you like it.

Zoom System in Processing

It’s a zoom system that operates very much the one in Ableton Live’s sample viewer. It’s written as a Processing applet. Click and drag to zoom and scroll: drag up and down to zoom, left and right to scroll. The little guide bar at the bottom also works.

links for 2007-11-03

Sunday November 4th, 2007 at 4:16 am | research

Overlap area of two rectangles algorithm

Saturday November 3rd, 2007 at 6:29 am | code

Here’s a nice algorithm to return, as a percentage normalised against the area of the first, the overlap area between two rectangles. It was originally designed to track blob bounding boxes over time: you’d call GetRectangleOverlap passing in the numbers for the bounding rect in the previous frame and the bounding rect in this frame, and if it returned you a number > some threshold (eg 0.5) you could safely assume the two bounding rectangles tracked the same object.

Note: there seems to be some problem with the return statement; thanks go to Almo for pointing it out. I’m sure I meant something else but with have to dig into old code to find out just what. In the meantime use this one..

float Util::GetRectangleOverlap( float minx1, float miny1,
    float maxx1, float maxy1, float minx2, float miny2,
    float maxx2, float maxy2 )
{
	float overlap;

	if ( minx1 > maxx2 )
		overlap = 0.0f;
	else if ( maxx1 < minx2 )
		overlap = 0.0f;
	else if ( miny1 > maxy2 )
		overlap = 0.0f;
	else if ( maxy1 < miny2 )
		overlap = 0.0f;
	else
	{
		// calculate overlap area
		int x_overlap = MIN( maxx2, maxx1 )-MAX( minx2, minx1 );
		int y_overlap = MIN( maxy2, maxy1 )-MAX( miny2, miny1 );
		overlap = x_overlap*y_overlap;
	}

	float area1 = (maxx1-minx1)*(maxy1-miny1);
	float area2 = (maxx2-minx2)*(maxy2-miny2);
	float area_norm = (area1+area2)/(2.0f*area1);

	// convert to a percentage
	// return overlap/area_norm;
	return overlap/area1;

}

links for 2007-10-31

Thursday November 1st, 2007 at 4:18 am | research