Friday, September 6, 2013

WonderRoom

It started when we got a departmental e-mail (forwarded from a Microsoft representative) informing us about a prize challenge to create an "Out of the Box" project using NUI (Natural User Interface). The challenge is named Microsoft NUI OOBW (Out-of-the-box week). This was about an hour before a semester exam so me and Omer were chilling outside and starting to run ideas. After a couple of days we set out - we were about to build WonderRoom - the interactive playroom. The funny thing is, about a week before the actual convention we realized "NUI" was just Microsoft's way of saying - "user Kinect"...

So the idea behind the project is to demo a "non-standard" use of the Kinect and it's features - real time depth and color map feeds, skeleton tracking, and segmentation. The application is in the form of a Kinect for Windows device on a tripod looking over a child's playroom with the idea that we can bring the child's own toys to life. This is done by hooking the Kinect to a PC running MATLAB with the MATLAB toolbox for Kinect and running our software which recognizes a person and some simple building blocks and guides the child in building a house - constantly providing feedback on success or failure just by "looking" at the child playing. A picture is worth a 100 words, so a video probably a million:


Some tech stuff:

  • As said - we used a very normal laptop running Windows, MATLAB 2013 with the Kinect for Windows Toolbox from MathWorks - this is a wonderful toolbox that gives you everything the Kinect has to offer in real-time, straight to the MATLAB workspace. It's only flaw is that it does not include the registration functions between the color and depth maps - meaning you can not correlate a pixel from the depth channel with the RGB channels - this did give us some trouble.
  • The recognition is quite straight forward - we use min and max thresholds on the depth map for background subtraction. We then use hue filters and shape tests to find each playing cube and figure out it's orientation and position. For 3D positioning we also use the depth map but for this we had to do some ugly approximation because of the lack of correlation between the RGB and D channels. The positions of all cubes is fed to a simple state-machine that gives the user feed back like -"now lets put the blue triangle on top" etc.
  • You can see the full source code (including a C++ attempt which was dumped) on Google Code:
    https://github.com/syagev/playroom
We put up a pitch which included the following video and presented it to some Microsoft VPs from Israel and Redmond:


They seemed to like it and the demo we did live during the pitch so we won first place (and got to go home with an Xbox 360 and a Kinect for each of us), and got some press coverage on Ynet.

All together this was bunch of fun!

Monday, September 2, 2013

WeizGrid

WeizGrid is a Simple framework for using the SGE cluster on Weizmann for parallel work (so if you're not from Weizmann's Math&CS department you won't find much use in this, although it is can be easily used by anyone who runs Sun's Grid Engine and MATLAB).

You can get the latest version off of GitHub from here.

Features:

  • Helps split your own code into fractions that can be run in parallel on the cluster.
  • Allows you to aggregate results in an efficient manner.
  • Write your code ONCE! Execute the same code on PC for debugging and on the cluster for production.
  • Recover from errors on the cluster - splitting means if 1 iteration out of a 1000 failed you still have 999 iterations in your hand!

Use case example:
You have a job that processes 1000 images in some way, running the same algorithm for each image, outputing something for each image, and finally aggregating the results from all images. Up until now, you ran this in a single job that took 1000 minutes (because lets assume it takes 1 minute to process each image). Using WeizGrid you can take advantage of the fact that the job can be parallelized - instead of 1 job WeizGrid helps you easily split the job to 80 parallel jobs so that you get all 1000 images in 1000/80=12.5 minutes (!!)

Documentation:
Read the full README file to get a better picture and also make sure to go over the 'sample.m' and 'calcPrimes.m' files included as an example and over the quick-help of the function WGexec, and WGgetResults. If you still have questions please feel free to contact me.

Terms:
WeizGrid is obviously free of use with no restrictions except for one: if you find a bug I need to know to make WeizGrid better !!