Archive for the ‘software development’ Category

Online image segmentation

Monday, March 26th, 2007

I created an interactive, online version of the Felzenszwalb & Huttenlocher segmentation algorithm.

Example output

Here are the details of the engineering behind it:

Efficient Graph-Based Image Segmentation
Pedro F. Felzenszwalb and Daniel P. Huttenlocher
International Journal of Computer Vision, 59(2) September 2004.

The program takes a color image (PPM format) and produces a segmentation with a random color assigned to each region.

The parameters are: (see the paper for details)

sigma: Used to smooth the input image before segmenting it.
k: Value for the threshold function.
min: Minimum component size enforced by post-processing.

Typical parameters are sigma = 0.5, k = 500, min = 20.
Larger values for k result in larger components in the result.

Also, I reimplemented the average color algorithm
Example output

Eval() for ActionScript 3.0

Wednesday, March 14th, 2007

For the pseudo-physics engine, I was looking for a way to eval() expressions. This isn’t built into ActionScript 3.0, but there is an EcmaScript 4 parser/interpreter in the Tamarin project. Pretty cool. Now I have to figure out how to feed the results of eval back into the swf.

Pseudo Physics updated

Wednesday, March 14th, 2007

I chose to mess around with the pseudo-physics package this evening. I probably should have done work, or slept. Probably slept.

Anyway, I cleaned up the code…er, all the physics stuff is in one place. More importantly, there are controls for the equations.

The green box in the top right sends parameter info to trace. No use to you.

The dark blue circle is friction. Friction greater than 1 means things accelerate on their own accord.

The translucent purple dot is the black-hole, center of the universe.

You’ll figure the rest out.

Pseudo Physics Simulator
[Pseudo Physics Simulator]

Psuedo Physics

Tuesday, March 6th, 2007

Ron Maimon and I worked on this flash animation program the other night at Stella’s. I really like it and want to do more. Half the fun was changing the pseudo-physics equation.

Thumbnail of flash animation
[Click image to view animation]

My new skin

Tuesday, March 6th, 2007

The charlesdietrich.com website has gotten a new look. I expect to asymptotically approach the ideal template, so there are future changes in store. However, I think this is a big improvement. Though not as big as an improvement as the previous change, from the WordPress default theme to the Connections theme…ah, asymptotes!

The current theme is equiX, with a few customizations. There’s a blog that I visit sometimes that uses this theme, so I hope I don’t look too similar.

The image is a current screenshot from my research project…I’ll probably use a photograph later, like I did for Julie (I designed the website, but the excellent photo is courtesy of Luke Walker).

Cue Point generator project reaches milestone

Sunday, March 4th, 2007

It actually does something! Well, right now it displays a graph of the music and you can navigate around in the music. What was fun about this was I used a Model-View-Controller (MVC) architecture, which worked quite well. So well, that I transitioned the music animation program to this system.

AS3 SoundEditor Screenshot

Hierarchical Agglomerative Clustering in n dimensions

Thursday, March 1st, 2007

I am really happy about the blogging thing. Anyhow somebody named Kokila Dhamodharan from India got in touch with me last month about hierarchical agglomerative clustering of images. It happens I know a thing or two about that. Basically you have an n-dimensional, metric space where the dimensions are properties of the image that you are interested in (color, variation, etc). When I did this I was comparing the partitions of a segmented image so I had color, size, shape, major axis etc.

I realize that the asymptotic complexity analysis of my paper was a bit slapdash. But who cares when you have run times of a second. I know that everything is less than O(n^3) anyway.

So here’s the naive approach: You calculate pairwise distances O(n^2). You have n^2 edges, and run an MST algorithm, which takes, with m=n^2, O(m log m) = O(n^2 log n).

Of course a really asymptotically efficient MST algorithm is essentially O(n). And you can approximate the set of pairwise distances — somehow or other…

Anyway, my code relied heavily on Pedro F. Felzenszwalb and Daniel P. Huttenlocher’s code, available here. I even reused their MST implementation. My project also used some code for an image format called ppm.

I sent my code over to the guy in India, but I am too lazy to really figure out what the license is, so I’m not posting it. It looks like it is MIT license compatible. Pedro’s new repackaging is GPL.

It would be fun to put either Pedro’s app and/or my app online.

Here are the results from my code:
Flowerbed showing results of finding repeated shapes

Fun with MusicXML

Wednesday, February 28th, 2007

MusicXML is a XML language for music scores. I have been playing around with it and composition software for several months. I have been using some composition software (Finale) that can generate an MP3 from a score. I have a few scores of classical and modern pieces. Perhaps I don’t have the instruments right, or something else, but the result is full of cracks and often sounds like dire organ music — it’s a lot of fun to listen to. I have a recording of ostensibly the same piece of music, and the two sound nothing alike.

MusicRain is a cool online score viewer / score player written in flash.

Sound Editor project opened (as3soundeditorlib)

Sunday, February 25th, 2007

I needed a mp3 cue point creation widget written as a standalone ActionScript 3.0 project, so I started working on one. It occurred to me that once I get the sound graph built, and the sound navigation built, somebody might want to build in some editing functionality. So I put the project up on Google Code as as3soundeditorlib.You can see the demo here.

Here’s the screenshot:

AS3 SoundEditor Screenshot

Introducing…Toby Dietrich

Sunday, February 25th, 2007

Welcome to the newest page on the web (at this instant). I am working with ActionScript 3.0 on a few projects, some TOP SECRET. But never fear, I have an open-source project to create a standalone sound editor and cue point generator in ActionScript 3.0. I’ll share my techniques and code, and point you to good ActionScript 3.0 resources on the web.

Charles a.k.a “Toby”