Michael Sheldon's Stuff

Michael Sheldon (mike at mikeasoft dot com)

June 17, 2010

GStreamer OpenCV plugins on the Nokia n900
Mike @ 3:49 pm

A while back I wrote a few GStreamer plugins that expose OpenCV functionality as GStreamer elements (source code), I haven’t had much time to work on these recently myself, but thankfully a number of other folks have started contributing now. Yesterday Daniil Ivanov kindly packaged gst-opencv for the maemo extras-devel repository, and the n900 performs surprisingly well considering how CPU intensive many of the vision operations performed are.

This first video shows edge detection being performed from the n900’s main camera (whilst simultaneously being encoded):

Example gst-launch line: gst-launch v4l2camsrc device=/dev/video0 ! video/x-raw-yuv,width=480,height=272 ! videorate ! video/x-raw-yuv,framerate=12/1 ! ffmpegcolorspace ! edgedetect ! ffmpegcolorspace ! xvimagesink

This second video shows the faceblur element in action, it detects any faces in the current scene and blurs them out, the frame rate and resolution on this one had to be reduced somewhat due to the complexity of the operation, it looks clearer when performed directly to an xvimagesink rather than attempting to encode at the same time.

Example gst-launch line: gst-launch v4l2camsrc device=/dev/video0 ! video/x-raw-yuv,width=240,height=136 ! videorate ! video/x-raw-yuv,width=240,height=136,framerate=6/1 ! videoscale ! video/x-raw-yuv,width=120,height=68 ! ffmpegcolorspace ! faceblur profile=/home/user/haarcascade_frontalface_default.xml ! ffmpegcolorspace ! xvimagesink

For some more examples of the gst-opencv plugins in action on a normal desktop machine take a look at thiagoss’ blog post and a couple of videos by Alexandre Poltorak (edge detection and face blurring).


3 Comments »

  1. Your tags aren’t working in firefox because your server is sending them as text/plain. You need to add ‘AddType video/ogg .ogv’ to httpd.conf or a .htaccess file to make it work.

    Comment by jonne — June 22, 2010 @ 3:18 pm

  2. *your <video> tags

    Comment by jonne — June 22, 2010 @ 3:19 pm

  3. Ah, thanks for pointing that out, I’d hadn’t noticed as Chrome handled it without complaint and in the past I think I’ve always uploaded videos with an .ogg extension.

    Comment by Mike — June 22, 2010 @ 3:34 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress