2008-06-14

thingamajiggr, and 2 new Processing effects

I'm beginning to incorporate more processing effects into my sets, so I developed two for thingamajiggr. They are less friendly to live alteration than gephex graphs, but if the bulk of the effect is done it's easy to live-code simple keyboard controls or change parameters.

I need a way to get video or screen captures into Processing, on Linux this is not easy- if it doesn't already exist I'm thinking of sending image data from gephex to Processing through an internal loopback path.

Audio input used to work for me but now it doesn't.

First effect: multicolored perlin lines. When shown live the colors dovetailed with led lighting of an artwork in the main theater room:





(click on the image to see the java applet)






The second effect is a standard gas/fluid simulation that uses springs. I spent a lot of time trying to get more complicated flow fields working, but I ended up moderately simple:



(click on the picture to see and play with the java applet)

Things that went wrong or I need to fix:

Holding my laptop on my lap is not very ideal when my laptop has an rgb output without locking screw holes. The connector fell out a few times. The other lesson is to always have good surface so the laptop can be left still.

Not being able to eliminate window manager titles and borders around processing output. I should find a more minimalist window manager.

2008-06-08

Optical Flow in Processing


The standard Lucas-Kanade method as described in the wiki page entry on it here. One key thing not mentioned there (at least until I edit the page) is to use the Sobel operator to get partial derivatives in the x and y direction.

link to applet

Glancing at the OpenCV implementation I notice there is a check for certain kinds of matrices that aren't invertible by the primary method, I may need to be doing that for more robust operation.

2008-06-01

Hosting java with google code

I used the export function of Processing to create a jar of an a-star search/a* search demonstration, and added the files into my google code subversion repository. Then it's necessary to set the proper mime-types:


svn propset svn:mime-type application/java-archive astar.jar
svn propset svn:mime-type text/html index.html


Here's an example:
astar

I don't think I can embed the jar directly here, I get this error:

load: class astar.class not found.
java.lang.ClassNotFoundException: astar.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:168)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:599)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1781)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
at sun.applet.AppletPanel.run(AppletPanel.java:324)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:271)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:158)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
... 9 more


It seems like certain colormodes don't work when exporting from processing (135)- use the integer 0-255 colormode.

For a jnlp (like created with the gwt kit):

2008-05-29

K-means clustering, hough transform

The hough transform is typically used to search for lines in images, though can be generalized to other forms, and for example is used to find the edge of roads for mobile robotics applications.

I'm not sure if I implemented it quite correctly- what for example should a solid white input image look like? In any case it can make some pretty but somewhat bland curvy colored lines, below the picture on the right is the source and the left is the hough transform:



description and link to processing pde file


The k-means clustering algorithm is very simple but very interesting in it's results- an image is split into clusters and then the clusters take on the average color of the source pixels, and the cluster centers are updated in each step until convergence.




K-Means Clustering Frei0r from binarymillenium on Vimeo.

thingamajiggr

Hopefully this will go as well as the Dorkbot show from December- I have some new effects now and ought to get some more done in time for it.