Playing with pixels in depth with Kinect, part 2

07.02.12 George Profenza

As if the previous post wasn't geeky enough, here's a quick look at project that also ties in a bit of computer vision and neural networks.

One one of the courses, related to Programming for Architecture and Design, among other things, we had a lecture and tutorial on Neural Networks. There are multiple types of Neural Networks, mainly classified as supervised and unsupervised, based on how this networks learn.

Kohonen networks (which is what this post focuses on) are unsupervised networks, also known as a self organizing maps (SOM). As opposed to supervised networks, where neurons are trained what the output should be like (should weigh towards), this type of network is based on competitive learning - the outputs/neurons organize themselves towards the closest inputs. This idea of competitive learning is based on how it is thought the hippocampus(the part of our brain responsible for navigation) works. In a sense, the outputs display a particle-spring like behaviour towards the inputs, which make this type of network useful for surface fitting/dimensionality reduction/etc.

Initially a dataset of 3d points was given, but it thought it would be more fun for some reason to fit a surface on my face (or any face for that matter). This is what the video illustrated:

  • Computer vision(OpenCV's HAAR cascade feature) is used to detect faces and isolate an area in the Kinect depth map
  • depth pixels belong to the face are converted to 3D coordinates
  • once a point cloud was selected, the points can be fed as the inputs of the neural net and the outputs are vertices of the surface. The number of ouputs is variable, so a low-poly mesh can also be calculated

The mesh can also be saved to AutoCAD (.dxf) format, which is what I've used to render a creepy theatre like mask based on Max's face. Currently the default surface is a rectangular grid, which is a good start, but not ideal for fitting on a face. If you can imagine a face unwrapped into 2D space, it would not look like a perfect rectangular, but that's something to explore at a later time.

In the meantime, if you would like to have a play with the code, the source is included. If this leads to something interesting let us know. The code is written using Processing and uses OpenKinect and OpenCV. If you think this is something you would like explained further, leave a comment bellow and we'll post more details on the wiki.

Max Mask Max face point cloud 1 Max face point cloud 2




Playing with pixels in depth with Kinect, part 1

07.02.12 George Profenza

I've managed to get a bit of breathing time so I thought about posting a few nerdy bits and pieces. Currently I'm doing an MA in Adaptive Architecture and Computation at UCL which is pretty cool, but keeps me pretty busy lately. Been learning up a lot of new skills there, among others, using the Kinect Sensor.

In this post I'll demo a few things I've learned.

I'll start with a quick technical demo of what I was able to achieve using Kinect and Processing. It displays the following:

  • user isolation
  • stereo calibration (matching rgb pixels with depth data)
  • hand tracking (in 2D and 3D)
  • skeleton tracking (without the 'cactus' calibration pose)

Although there is an official Microsoft driver for the Kinect, it's for Windows only (no surprize there), so I've used the opensource drivers. There are plenty of wrapper libraries for various languages, but so far I've used wrapper libraries for Processing (Daniel Shiffman's OpenKinect Processing lib and SimpleOpenNI), OpenFrameworks (ofxKinect) and MaxMSP (jit.freenect.grab). Each library has it's pros and cons, but I won't go much into detail in this post.

Here's a list of the data you can get from a Kinect:

  • Depth/IR/RGB pixels
  • Accelerometer (accesible with some of the libraries)
  • Audio data (currently supported by the official KinectSDK at the moment)

Plenty that can be done with the above mentioned. Currently I'm keen to learn more about manipulation the raw data rather than relying on OpenNI to see what sort of interactions can be achieved.

I tend to be gravitate around unusual(think Aphex Twin) ideas lately, hence the first image on the side, which displays how skeleton tracking and user isolation can be used to duplicate parts of the body. When displaying the bounding box, the gray forearm is the copied version.

One unusual idea might be turning people into trees. It seems the Greeks beet me to it (a few thousand years back), as the myth of Heliades also portrays this idea. The second image on the side shows a tracked figure morphing into a tree by recursively copying forearms. You can see the full video here. It's split into 3 parts: context, prototyping and final piece. I'm using SimpleOpenNI and skeleton tracking, but the unstable release of the drivers which allows for a more responsive output, as the calibration pose is not required.

See you in part 2 !

realtime forearm cloning with Kinect Heliades: man morphing into tree




Visualising what people on Twitter like

08.09.11 Max Novakovic

The Twitter streaming API allows access to tweets on Twitter as they are created. I decided to experiment by writing a data-mining script that collects geo-located tweets from the streaming API that contain people saying that they 'like' something. For this post I have created two visualisations that aim to make sense of the data collected so far and display it in an easily digestible way.

The script has been running for about 5 days in total and has collected 1873 tweets; It has parsed a lot more tweets than that but a tweet is only added when it meets a certain criteria; which is that it is geo-located from the UK and contains a phrase such as 'I like', 'I love', 'I am fond of', etc...

From the data the second most 'liked' thing is Twitter itself which is un-surprising; 'My Life' is 4th and 'My vagina' is 32nd. The most liked things on Twitter are 'That song' and 'This song' which provides a very un-informative insight into the people on Twitter.

The top two images on the right are visualisations of the data. The first image is a 'Tree Map' which was quite simple to put together thanks to Google Chart Tools. The larger the square, the more likes and vice versa. Click here to view the visualisation in full. The data isn't perfect, for example, 'The' is one of the most popular things but I think overall it works quite well at extracting 'likes'.

The second visualisation is a Processing sketch that plots a users location along with what they have said they like. View a larger image of the sketch here. It doesn't really provide any insights geographically but it's a starting point for something that could have a lot more potential for spotting geographical and cultural trends. Download the code and data for the Processing sketch on the Disturb wiki here.

For now, I will leave the spider running for another month or so and then post again with some updated visualisations and hopefully some more interesting data from Twitter.

Tree map of Twitter like data Processing sketch of twitter likes plotted on to a map Pointless filler image




Visualisation of olympics game entries

01.08.11 Max Novakovic

This visualisation shows entries to a nationwide competition which took place over about 5 weeks. The competition consisted of 1,000 stores handing out scratch-cards to customers offering them a chance to play a web based game to win a pair of tickets to the olympics. Please ensure you watch the video in HD (720p)!

The game was widely cross-platform and allowed the game to be played on mobile devices, tablets and desktop computers. In the visualisation circles represent an entry. The diameter of the circle is based on the score the user achieved (a bigger circle is a better score) and the location of the circle represents where the player was located in the country.

The visualisation was created using Processing.

Some numbers:

  • There were 25,372 entries
  • Spread out over 38 days
  • Which is 676 entries a day
  • Or about 1 entry every 2 minutes
  • Time in the video is sped up 36,480 times




Merry colour blindness!

23.12.10 Max Novakovic

To keep in check with the Christmas cheer, I have been looking into colour blindness. Specifically, re-creating how people that are colour blind see things using Processing.js as my canvas.

Firstly, I created a simple sketch that creates 'Ishihara colour plates'. These are used to test people to see if they are colour blind. You can see the sketch here. The sketch takes an image, loops through every ten pixels and based on the colours of the image it places a coloured circle. The colours are various shades of orangey-brown or green. The shades are designed to be visible to most people but not to people that have Deuteranopia, Protonopia or Achromatopsia. The first image on the right is the result of putting this image through the sketch. If you can't see a slightly distorted disturb logo in green in the image, then I am afraid that you might well be colour blind.

Being able to test colour blindness is nice and all, but what if you want to see what it would be like to be colour blind? The second sketch I created takes various images and applies filters on them to re-create how people with various types of colour blindness see. You can see the sketch here. NOTE: This sketch is best viewed in Chrome or Safari - It is very slow in Firefox. It works by taking the filters found here and here and then applying them on to the image.

If you press 4 on the sketch, you can see another Ishihara colour plate that I generated using my first sketch. If you view the colour plate normally, you can see the letters "LOL WTF". If you switch to other types of colour blindness, you can see how someone that is colour blind would see the colour plate.

You can see demos and the full sources here;

Merry Christmas!

Disturb Processing.js colour blindness simulator