Home Games Projects Blog Contact Private
Network

Archive for the ‘maemo’ Category

Maemo Face Detection/Tracking on HardWorkingBee.com

I recently wrote a short article on my face detection and tracking endeavors on the Maemo platform for the blog HardWorkingBee.com. Basically, it’s a summary of my two previous two blog posts here (1, 2). As the blog is only available in German (currently), the article is also written in German.

They split my original article in two parts:

The original article is this:

Im Rahmen meiner Diplomarbeit “Face Detection und Tracking für Computerspiele auf mobilen Endgeräten” habe ich mich damit beschäftigt, Gesichter in Bildern zu detektieren. Das hört sich erst mal nicht spannend an, ermöglicht aber interessante Anwendungen.

Als Plattform kommt das Nokia N900 zum Einsatz. Eine wichtige Voraussetzung ist eine Kamera auf der Vorderseite des Geräts, welche das N900 besitzt. In den durch die Kamera aufgenommenen Bildern wird jeweils die Position des Gesichts des Benutzers bestimmt. So kann das Gerät die Position des Benutzers relativ zum Gerät herausfinden und diese Position kann als Eingabe benutzt werden.

Als erste Anwendung habe ich ein einfaches Spiel mit dem Namen BurgerFace entwickelt. Das Ziel des Spiels ist, bestimmte Objekte (Burger) einzusammeln und anderen auszuweichen (Messer). Um das zu erreichen, muss der Spieler seinen Kopf relativ zum N900 bewegen. Das kann durch Bewegen des Kopfes selbst oder durch Bewegen des Geräts umgesetzt werden. Trotz dieses einfachen Spielprinzips haben die meisten Spieler sehr viel Spaß gehabt. Da das Spiel mit den eigenen Bewegungen gesteuert wird, ist es sehr intuitiv. Es ist nicht nötig, dass man vorher irgendwelche Tastenbelegungen erlernt.

Die zweite Anwendung ist ein einfacher, aber sehr eindrucksvoller 3D-Effekt. Er erweckt beim Benutzer den Eindruck, dass der Bildschirm des Geräts eine gewissen Tiefe hat. Unter bestimmten Umständen können Gegenstände auch so erscheinen, als würden sie aus dem Bildschirm herausragen. Der Bildschirm wirkt wie ein Fenster in eine virtuelle Welt.

Das Prinzip ist, dass die Position der Kamera, durch die die 3D-Szene aufgenommen wird, und die Projektion entsprechend der Position des Betrachters relativ zum Gerät angepasst werden. Setzt man das richtig um, wird die Sicht auf die 3D-Szene immer gerade so angepasst, wie sich auch die Sicht durch ein echtes Fenster ändern würde.

Abgesehen von den beiden vorgestellten Demos gibt es noch viele andere spannende Anwendungen. Ich habe auch bereits einige interessante Vorschläge bekommen. Derzeit überlege ich, was ich als nächstes mache.

3D On The Nokia N900 Through Head Tracking

Building on the algorithms I’ve implemented as part of my Diplom Thesis, I’ve now implemented a demo of a 3D view on the Nokia N900. The idea is to adjust the camera through which the 3D scene is viewed to the user’s head position. The screen then appears to be a window into the virtual world.

The 3D scene is easily constructed on the N900 using OpenGL ES 2.0. A small box and a few foreground objects are sufficient. In order to determine the head position I use the face detection and tracking code I’ve recently implemented (and already used for a little tech demo). The two things are easily put together and the result is this:

The method is not new:

The most difficult thing is to get the perspective right as there is a lot of conflicting information out there. Johnny Lee used the Direct3D function PerspectiveOffCenterLH, which is obviously not available in OpenGL. The best hint I found is here. There projection matrix M should look like this:

Projection matrix

Where n is the distance to the near clipping plane, f the distance to the far clipping plane, t and b define the horizontal clipping planes, l and r define the vertical clipping planes.

I think the effect is pretty cool and I’m currently contemplating making a game with it.

Running ESbox On An Up-To-Date Linux

I’m currently getting my feet wet in Maemo 5 development as I’ll soon be the proud owner of a Nokia N900 (maybe already tomorrow? Go, Amazon, go!). As an avid user of Arch Linux, I try to keep my installation current by running pacman -Syu every now and then. That sometimes leads to software that is too new…

I was trying to install ESbox, an Eclipse plugin for Maemo development, but it wouldn’t work as my Eclipse version 3.5.1 was too new. I then tried to install an older version of Eclipse, but that wouldn’t run because my version of XULRunner was too new then. The error you then find in workspace/.metadata/.log look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
!ENTRY org.eclipse.osgi 4 0 2009-12-06 19:37:24.648
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: XPCOM error -2147467262
	at org.eclipse.swt.browser.Mozilla.error(Mozilla.java:1597)
	at org.eclipse.swt.browser.Mozilla.setText(Mozilla.java:1820)
	at org.eclipse.swt.browser.Browser.setText(Browser.java:737)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.generateContentForPage(BrowserIntroPartImplementation.java:252)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.dynamicStandbyStateChanged(BrowserIntroPartImplementation.java:451)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.doStandbyStateChanged(BrowserIntroPartImplementation.java:658)
	at org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation.standbyStateChanged(AbstractIntroPartImplementation.java:249)
	at org.eclipse.ui.internal.intro.impl.model.IntroPartPresentation.standbyStateChanged(IntroPartPresentation.java:443)
	at org.eclipse.ui.intro.config.CustomizableIntroPart.standbyStateChanged(CustomizableIntroPart.java:266)
	at org.eclipse.ui.internal.ViewIntroAdapterPart$2.run(ViewIntroAdapterPart.java:74)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
[...]

By the way, grabbing the complete Eclipse install from the ESbox website doesn’t help when running a 64-bit system.

So here’s my way of getting it running anyway without harming the rest of my system:

  1. Get and install Eclipse IDE for C/C++ Developers version 3.4.2 / SR2. Of course, you can keep your current Eclipse installed.
  2. Get and unpack XULRunner 1.8.0.1, but don’t really install it. Just put it somewhere and memorize the path.
  3. Edit eclipse-install/eclipse.ini and append this line to the end:
    -Dorg.eclipse.swt.browser.XULRunnerPath=/path/to/your/old/xulrunner/

    (Thanks to this forum thread.)

  4. Go on and follow the normal ESbox installation instructions using Method 2: Eclipse Update Site.

I hope this helps someone.