Announcing GFreenect

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

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!

Another year has passed

December 31st, 2011

Today is the last day of 2011 and it is once again when people look back in time and realize what they have done throughout the year and if they stuck to their promises. I don’t give that much importance to events like new year’s eve or even my birthday but I decided to write a blog post and to think about what happened on 2011.

December is also the month I’ve joined Igalia, I have been in the company for 3 year and the changes seem to have been quite some.
I feel 2011 was not a very productive year from the point of view of side projects. I have been working on the toolkit that powers the MeeGo Harmattan (Nokia N9) for a year and a half and that, together with other tasks in Igalia and in my personal life didn’t leave me much time for creating new projects. Still, I released 5 new versions of OCRFeeder; 4 versions of SeriesFinale and ported it for the Nokia N9. Also I have given once again presentations in some nice events like FOSDEM and LinuxTag.

On the personal side of things the big event this year was my wedding with Helena. After that we had a nice time travelling in Turkey after having cancelled the plans to visit Japan due to the earthquake.
We also spent 10 days in Berlin, we are still in love with the city and we wish one day we’ll experience living in there (could it be 2012?).
After 3 years living in Spain, I feel comfortable here, I recognize its virtues and flaws but I want to know more cultures, more languages and thus more ways of seeing life. As for Portugal, it is part of what defines me but Helena and I are not planning on living in there for the foreseeable future, especially these times when the government(s) is(are) making things difficult for everybody.
Related to this and the economic crisis that is going on, this year I joined a demo and a strike for the first time and I keep hoping that things get better for everyone.
I also realized I am now used to donate to some institutions throughout the year and it is something that makes me feel good.

As book counting is something often present in this kind of year’s review, in 2011 I read 10 books and a short story. The most important ones, in case you’re interested are: The God Delusion (Richard Dawkins), Through the Language Glass (Guy Deutscher) and Citações e Pensamentos de Agostinho da Silva (“Quotes and Thoughts of Agostinho da Silva” by the philosopher).

The future

People often say “next year is gonna be a year of change” but things do change and some situations that happened this year have made me think about my life so I really feel there are going to be changes in 2012. Hopefully they will be good ones.

I wish you all a happy 2012.

RPM packages of OCRFeeder for Fedora

December 21st, 2011

If you’re one of the people waiting for RPM packages of OCRFeeder for Fedora, rejoice!
Juan, my friend and coworker at Igalia, has cooked an RPM spec and created an OCRFeeder repository for Fedora 15 and 16.

To add this repository to Fedora 16 simply download this file and move it to /etc/yum.repo.list/.
Alternatively you can download the RPMs directly from:
OCRFeeder RPM for Fedora 15
OCRFeeder RPM for Fedora 16

Important: These Fedora packages haven’t been thoroughly tested and there might be tiny issues currently (like the icons not being installed in the right place) and I’m no longer using Fedora myself (I’ve switched to Debian) so please report any issues you might find.

A Couple of Weeks in Turkey, Part 3: Pamukkale

December 19th, 2011

This article is part of the “A Couple of Weeks in Turkey” series and follows A Couple of Weeks in Turkey, Part 2: Selçuk/Ephesus.

The next stop after a well spent time in Selçuk was Pamukkale. The owner of the Tuncay Pension had helped us with our trip planning. He told us Pamukkale was not worth spending the night and instead we should rather get on a night bus to Cappadocia, saving time and money. It was a wise advice but before we were on our way we had another little Trukish adventure.
The hotel owner told us he would talk to his friend at the bus station to get us tickets and we should make sure that we headed to the right agency, Kamil Koç.
When we got to the bus station an old guy came by and we said we were looking for a particular agency, he asked us why and after our answer turns out he also sold tickets to Pamukkale…
We insisted on going for the original agency and he told us “you know, you can go for that agency but my agency is the one with the bus so they will sell you a ticket for my bus, earning a fee, and tomorrow I will be here to happily welcome you”. Hmm, how could we argue with that? We said okay but he told us a price that was higher than what we had been told before so we bargained and finally we could get two tickets to Cappadocia with a stop at Pamukkale for the price of 70 TRL each (~35 €).

At the cotton castle

After arriving at Pamukkale some guy entered the bus and told us that he was our host, that we could leave our bags in his office and have a shower and a tea at his hotel for free. We followed him to his office and when we were already inside, a guy came by the door and told us that this wasn’t our travel agency, that it was some guy trying to sell us stuff and we shouldn’t leave the bags there… What the hell! After seeing that this guy’s office was the agency originally advised by the pension’s guy and that the other one was where we had bought our tickets, we grabbed our bags and told our “host” that we were moving them to the other guy’s office and he said: “Okay, you do whatever you want but I’m telling you, they will try to sell you all kinds of shit. Don’t buy anything! They will try to sell you trips in Cappadocia, whatever, don’t buy them! I just want people to come to my hotel and have a tea for free so they can talk good things about my agency”. When we arrived with the bags to the other office the guy told us that their agencies are always fighting each other and that the other guy wanted us in the hotel to try to sell us stuff…

We wanted nothing to do with those travel agencies’ wars so we went to have lunch at a restaurant from which we could see why Pamukkale means “cotton castle”. Behind some houses we could see a big white mountain that could be easily confused for snow which looked and felt odd with such a hot weather. The reason the mountain is white is a rock called travertine made by calcium carbonate deposits.
The lunch was tasty, as always, but at the end of the day we would have an unpleasant situation with the owner of that place (which apart from a restaurant is also a hostel and a travel agency).

Pamukkale

After lunch we headed to the “cotton castle”. The entrance fee was 20 TRL (~10 €) and it is forbidden to wear shoes in there so people don’t deteriorate the soil. There are guards around and they will blow a whistle at people who sneaked in with their shoes on or people who seat inside the water stream (blocking it) that goes along the main course of the mountain.
Some times it was hard to walk at some places which had small loose rocks but it was a nice experience.
Another main attraction of that mountain is the number of pools where people can bath. The water is of course full of calcium carbonate deposits which give it its pale look and you can feel it in your feet as some kind of weird paste.

Pamukkale: The cotton castle

Dr. Fish and swimming with the ruins

After we got to the top, we rested a bit laying on the grass under some trees’ shade and then went to the ancient pool.
There is an extra fee for entering the ancient pool but what other opportunity would we have to swim on top of ancient roman ruins? So there we went, the pool’s water is warm and sweet and ruins divide different areas of the pool. We could seat on some ruins, swim and relax for a while.

The Antique Pool

When we got out, we saw they had “doctor fish” tanks in there. We had first known about “doctor fish” in the TV, tiny fish that eat dead skin of one’s body and leave the healthy skin really smooth. After a failed attempt to bargain the price of 35 TRL, we decided to do it anyway. For 20 minutes we were seating with our feet in the fish tank, feeding the fish and paying for it, that is! The feeling is like some fast and small tickles, Helena could not stop laughing for a while until she controlled herself.
A guy that was working there told us that each fish costs 30 US $ and that although they are originally from Turkey and other middle-east countries, they are now usually imported from Singapore. Nowadays it is getting common to see these fish in Spanish health clinics but we can say we had the fish treatment at a beautiful place after swimming in an ancient pool in Turkey ;)

Skin eating fish
(Helena feeding the fish)

There is adventure everywhere!

After we were done with the pool and the fish we went down the mountain again to be there for the bus at 19. When we got to the office where we had left our bags, the guy told us: “What are you doing here so early? We had more people that needed to take the bus so we delayed it to 20:30!”. Yup, they delayed it without any warning or consideration for us.
We were hungry and pissed at the guy so we went back to the place where we had had lunch, ate something and met a Canadian guy from Quebec who was also going to Cappadocia on our bus and didn’t know anything about the hour changes …
When the time came, we seated in front of the office next to the restaurant where we were supposed to get our night bus ticket and this is where the situation I mentioned before started.
The Canadian guy went inside the office and came out with a piece of paper for the three of us (note that we didn’t know each other) that was supposed to be exchanged for a ticket at the bus’s station.
So there we were seating in front of the office, waiting for the bus and the restaurant’s owner, a woman in her 50s, started talking to us. “So you’re going to Cappadocia… Do you have any planned trips in there? You should probably book in advance because they get full and then it’s a shame you don’t get to visit the stuff in there”. “Hmm, we don’t like tours that much so I guess we’ll decide about that when we arrive in there…” I said but she just went on and on about how such good prices they have, about how much cheaper it would be to book with her, etc. Finally the Canadian went inside and after a while the woman told us: “Your friend has bought every tour and even a balloon trip! You should also buy some tours… Do you speak Spanish?” and she went on talking to us in Spanish. It wasn’t about the money anymore, it was about not giving in to that sick woman so I told her in English: “Look, we speak Spanish but we also speak English as you might have noticed, we are not even Spanish, so you don’t have to speak in another language! We are not buying anything so please stop trying to sell us stuff!”.
We were really pissed off and on top of that the bus was late so that was a really unpleasant couple of hours.

Fun with the funky night bus

Finally the mini-bus arrived, it was a dolmuş (read the part 2 of this trip to know more about these buses) and was gonna take us to Denizli’s bus station. After an uncomfortable trip in a dolmuş full of people where I seated at a small stool in the aisle we finally arrived. We went inside the bus station, showed the piece of paper to the first assistant that we saw and he pointed us to the right place where we finally got our individual ticket and then we went outside to wait for our bus. Next to us were some Korean guys talking to each other about a piece of paper they had. I decided to ask them if they were going to Cappadocia on a night bus; they were but they thought that the piece of paper was a real ticket and didn’t know anything about exchanging it for a real ticket and were waiting for the wrong bus number so I think I saved some Korean folks from spending the night at Dinizli bus station.

When the bus arrived we hopped on and had our seats next to the Canadian. I was seating next to Helena and our new friend was seating on the other side of the aisle next to a woman. The ticket inspector came buy, took a look at our tickets and started yelling something in Turkish and giving directions to us. Finally we understood, the tickets have the passenger’s genders printed on it and he was trying to switch Helena’s seat with the Canadian so the other woman wasn’t seating with a man but she said she didn’t mind and Helena claimed she was married to me so the guy gave up in the end.

Night bus with private TVs

The bus was equipped with a small TV for every passenger (one of the channels was from a camera in front of the bus) and they served snacks and drinks. Still, this 11 hour trip was more uncomfortable than I thought. Every time the bus stopped the lights went on, then there were people coughing, children crying, the sound of the water hitting the windows when they washed it (they washed it at every stop). We didn’t have much sleep but we saved a night and had this experience.

On June 21st we arrived at Göreme, Cappadocia, the best place where we stood during the whole trip, but that’s a story for the next article…

to be continued…