Iniciar sesión

Redondela en Foto

Shotwell Faces Tool: Weekly Report 03 & 04

::

[ NOTE: Spanish translation in http://sanva.net/blog/109/ ]

The schedule to this last two weeks was to write some demo code in Vala with GTK+ and OpenCV, to proof that we can get face detection feature in Shotwell. And I was trying to fight against OpenCV & GTK+ 3 incompatibilities, but I have lost.

I thought this would be easy, because I had written some working code to detect faces inside Shotwell using OpenCV at the end of last year. But the problem now is that Shotwell is using GTK+ 3, and the OpenCV highgui module, which is used to provide a simple multiplatform user interface —but also to load IPL images, the format that OpenCV functions expect— uses GTK+ 2, so they cannot be in the same process.

So, two problems I had to deal with:

  • OpenCV objdetect module dependencies with highgui module: The only modules that are essential to face detection are core and objdetect, but for some reason I don't know, objdetect have dependencies with highgui and so the highgui library is included in the binary if you include objdetect. I've submitted a bug for that at [1], but they canceled it —it seems that they don't care about integration of OpenCV with other programs... They said that I can compile OpenCV without highgui —and that's correct, everything works fine, but the problems are two:

    • We would be adding the need of compile OpenCV —it's easy, by the way, I didn't have any problem doing it— to compile Shotwell.
    • Idon't know if there will be problems with the binary distributed Shotwell packages —in Ubuntu for example— since they would be linked against some version of OpenCV with no highgui and the OpenCV binaries in the system would probably have been compiled with it.

  • The other problem is that, without highgui, we lose the ability to load IPL images, so I've needed to find a way to convert form GDK pixbufs —or Cairo surfaces— to IPL images... and I've been looking for some way to do it but I simply haven't found anything —until Álvaro Marcos Ramiro, one Spanish guy that I know he id this in the past —because I've found some fragments of his code and it's doing the thing, but the important part, the conversion between formats, was missing— answered my mail asking his help.

So, the second problem is solved, but there is still the problem with objdetect module dependencies with highgui module, so I've continued with and alternative way: I've created an independent program which would be called by Shotwell to perform face detection.

Starting from a test program you can find in the OpenCV official tarball [2] —in /samples/c/facedetect.cpp— I've created a helper program that process one image file and outputs it's faces information —you can see it in [3], please refer to the README file to get more info about the program or, of course, ask me whatever.

I started working on the integration of this new feature into Shotwell, but now I've returned to this simple program, since people at Yorba think that it is more important to proof that OpenCV can perform face detection in a reliable way, and also try to perform face recognition, one feature that would be really awesome if it works fine.

[1] http://code.opencv.org/issues/2024

[2] http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.1/

[3] https://github.com/Sanva/facedetect

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell

Comentarios (2)

Comentarios

Este usuario no tiene un avatar definido

Elleo

23/06/12 23:09

Have you considered using the facedetect plugin that already exists in gstreamer-plugins-bad? That might make life a lot easier for you, especially since Shotwell already depends on GStreamer.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-facedetect.html

Este usuario no tiene un avatar definido

Valentín

04/07/12 14:04

Hi!!

The problem is that that facedetect plugin only performs face detection, and the goal of this project is to have also face recognition, so the final program —if all intermediate test programs I'm writing confirms that I can achieve this— would be more complete than that plugin —and also the need of learning OpenCV would the there even if using that GStreamer facedetect plugin and later creating some other program to perform face recognition.

But of course, thanks to pointing me to that implementation!

Escribe tu comentario

Nos encantará que des tu opinión, para lo cual puedes utilizar el siguiente formulario. Por favor, intenta que tus comentarios estén relacionados con este artículo. Así mismo te pedimos que no faltes al respeto a nadie, y que no escribas como en un teléfono móvil. Cualquier comentario fuera de lugar (insultos, spam, off-topic, etc) puede ser borrado sin previo aviso.

¿No tienes una cuenta?

Regístrate

Es fácil, rápido y gratuito.

Inicia sesión en sanva.net

He olvidado mis datos de acceso.

Redondela en Foto 8.6.11 - XHTML 1.0 Strict - CSS - Política de Privacidad