package uk.ac.soton.ecs.waisfest14;

import java.io.File;
import java.io.IOException;

import javax.swing.JFrame;

import org.openimaj.image.MBFImage;
import org.openimaj.image.colour.RGBColour;
import org.openimaj.util.data.Context;
import org.openimaj.util.function.Operation;
import org.openimaj.util.stream.Stream;
import org.openimaj.video.xuggle.XuggleVideoWriter;

public class Visualisation {
	public static void main(String[] args) throws IOException {
		final MBFImage image = FullScreenDemo.createImage();
		final JFrame window = FullScreenDemo.display(image, "Tree Colours");

		final DrawOperation pointOp = new DrawOperation(image, true);

		final XuggleVideoWriter xvw = new XuggleVideoWriter("/Users/jsh2/Desktop/leaves-8day.mp4", image.getWidth(),
				image.getHeight(), 10);

		new CSVStream(new File("/Users/jsh2/Desktop/results_sorted.csv"))
				.transform(new TimeWindow(8 * 24 * 60 * 60 * 1000L))
				.forEach(new Operation<Context>() {

					@Override
					public void perform(Context ctx) {
						image.fill(RGBColour.BLACK);

						@SuppressWarnings("unchecked")
						final Stream<Context> win = ((Stream<Context>) ctx.get(TimeWindow.WINDOW));

						win.forEach(pointOp);

						pointOp.windowDrawn(ctx);

						FullScreenDemo.update(window, image);
						xvw.addFrame(image);
					}
				});
		xvw.close();
	}
}

@@ -645,24 +645,27 @@
 , true);%0A%0A%09%09
+// 
 final Xuggle
@@ -763,16 +763,18 @@
 th(),%0A%09%09
+//
 %09%09image.
@@ -821,48 +821,15 @@
 ile(
-%22/Users/jsh2/Desktop/results_sorted.csv%22
+args%5B0%5D
 ))%0A%09
@@ -1244,16 +1244,18 @@
 age);%0A%09%09
+//
 %09%09%09%09xvw.
@@ -1288,16 +1288,18 @@
 %09%09%7D);%0A%09%09
+//
 xvw.clos

Read input from args rather than hard code.