Archive for the ‘computer vision’ Category

Announcing GFreenect

Friday, January 20th, 2012

As mentioned in my last post, Edu the mighty Cuban and I have been playing with the Kinect and developed an interactive installation for Igalia‘s 10th anniversary party using OpenFrameworks. (By the way, some people asked me for that application’s code so yesterday I cleaned it and it’s available on Gitorious)
OpenFrameworks offers a number of functionalities either from its core libraries or by means of add-ons and indeed there is an add-on that wraps libfreenect, the Free Software library that allows to control the Kinect.

Using OpenFrameworks was easy, it makes it fast to start developing with it but in many aspects it’s completely different from the way we’re used to work on GNOME. We are used to have single, independent libraries that do one thing and do it well and are used as needed by application developers, for example, do not include a sound library if my application is never going to use it.
Having modules such as GTK+, Clutter, Cairo, GStreamer, etc. already gives us flexible ways to develop certain parts of applications similar to the demo mentioned before: we just had to draw the fish using Clutter/Cairo, implement their behavior and show the Clutter stage. Of course we also would need a way to control the Kinect and it would be really nice if it could offer us an easy to use API for those familiar with GLib…

Ladies and gents, we give you… GFreenect

GFreenect is a wrapper for the Freenect library written using Glib in order to control a Kinect device and make it easy to use with GNOME technologies.
It doesn’t simply wrap the Freenect library but also offers ways of using it that are familiar to you if you have developed something using other GNOME libraries.
One example of this enhanced functionality is that we focused on offering an asynchronous API (although there are some synchronous alternative methods as well). Another example is that when setting the device’s tilt angle, a signal will be emitted when it has finished setting the angle, since it might be useful for some applications.

One of the purposes of having it written with GLib is the GObject Introspection capability. This allowed us to include an example application that controls the various features of the Kinect and was written in Python effortlessly. A screenshot of this app is shown below:

GFreenectView Screenshot

And that’s it! You can find the code for GFreenect in Gitorious (including documentation for this 0.1.2 version). Bear with us if you find some bugs, it is fresh out of the oven.

We hope you find GFreenect useful for your projects and please give us feedback if you find some issues or have any good suggestions.

Augmented Reality at Igalia’s 10 Years Anniversary

Tuesday, January 17th, 2012

This is a long pending post. It should have been written about 3 months ago but only now we found the time to do it.

Some of us in Igalia have been interested in Augmented Reality (AR) and Computer Vision (CV) for a while and we wanted to do something within these fields for the company’s 10th anniversary party which took place in last November.
Since our time was limited (due to our work in a client’s project) we came up with a simple AR installation to show at the party — a fish pond, or aquarium.

So a week before the party Edu and I bought a Kinect device and implemented this fish pond using OpenFrameworks, an Open Source framework for writing interactive applications using C++.
As you might notice from the pictures, we are more programming artists than graphical artists so the fish may look a bit funky but they’re drawn in only 10 lines of code using graphics functions (and I kinda like their looks). Due to limitations of the place where we installed the application, we had to place the projector in a lower angle instead of above the “action area” and this of course resulted in bigger shadows but people could still play with it without many issues.

The fish’s behavior was implemented using Reynolds’s algorithms and the idea is that when a person “touches” the pond, the fish will go there as if there was food being dropped. When the person stops touching the pond, the fish will hang for a little while and then will disperse randomly to other points of the pond.

As you see, the idea is pretty simple but it was a nice entertainment for kids and grown ups around the party.

We will likely be doing more AR and CV for the coming months so stay tuned!