×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: no element "faceblur"', even though I did install libcv4

    You don't need queue
    Code:
    gst-launch -v -t v4l2camsrc device=/dev/video0 ! video/x-raw-yuv,width=480,height=272 ! videorate ! \
    video/x-raw-yuv,framerate=12/1 ! ffmpegcolorspace ! edgedetect ! ffmpegcolorspace ! xvimagesink
    faceblur works fine except it doesn't blur faces.
    Last edited by divanov; 2010-06-17 at 14:33.

  2. #17
    Registered User
    Join Date
    Jun 2010
    Posts
    5

    Re: How to use OpenCV for Maemo5 app?

    For the facedetect and faceblur elements to work correctly you need to specify a haarcascade profile (this is what defines how a face should look), by default both elements will look for '/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml' but it looks like that isn't installed as part of the maemo opencv packages.

    You can specify the location of any haarcascade you do install to your device by setting the profile property on the facedetect/faceblur element, e.g.

    ... ! faceblur profile=/home/user/mycascade.xml ! ...

    Once this is set the problem reported by Dorfmeister is repeatable, this is because the n900 isn't fast enough to perform a face detection calculation at the specified framerate, reducing the framerate and the video resolution can help with this. For example the following pipeline gives fairly reliable results for me on the n900:

    gst-launch -v -t 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

  3. #18
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use OpenCV for Maemo5 app?

    Code:
    gst-launch -v -t v4l2camsrc device=/dev/video0 ! video/x-raw-yuv,width=240,height=136 ! videorate ! \
    video/x-raw-yuv,framerate=6/1 ! videoscale ! video/x-raw-yuv,width=120,height=68 ! ffmpegcolorspace ! \
    faceblur  profile=/home/user/haarcascade_frontalface_default.xml  ! ffmpegcolorspace ! xvimagesink
    I've tried this pipeline and this photo I've found on the Net
    http://www.webmastergrade.com/wp-con...a-Rai-face.jpg
    and can state that a result is the same as reported in comment #16.

    P.S. well, ok maybe it should complain if file doesn't exist?
    P.P.S. where could we find these xml files?
    Last edited by divanov; 2010-06-18 at 11:47.

  4. #19
    Registered User
    Join Date
    Jun 2010
    Posts
    5

    Re: How to use OpenCV for Maemo5 app?

    Possibly a stupid question but I take it you actually did download haarcascade_frontalface_default.xml to /home/user/ ? The face I used to test with (besides my own) was http://graphics.cs.cmu.edu/courses/1...s/image016.jpg and you can see a video of that working correctly on the n900 here: http://blog.mikeasoft.com/2010/06/17...he-nokia-n900/

    You're right that it should really give a warning if the file isn't found, I'll see about fixing that tonight.

  5. #20
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use OpenCV for Maemo5 app?

    /usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml belongs to libcv-dev package and this is not acceptable.
    I improved gst-opencv packaging a bit (added a debug package) do you want to make the same change in trunk?

  6. #21
    Registered User
    Join Date
    Jun 2010
    Posts
    5

    Re: How to use OpenCV for Maemo5 app?

    If you could upload a branch with your improvements to somewhere like github/gitorious/etc. I'll see about getting them merged in, thanks.

Similar Threads

  1. Replies: 6
    Last Post: 2011-05-20, 10:43
  2. How to connect to a "Protected" Secure Element with JCOP tools?
    By herwijnen in forum Near Field Communication
    Replies: 1
    Last Post: 2009-06-29, 18:18
  3. Replies: 3
    Last Post: 2009-06-18, 21:42
  4. Replies: 0
    Last Post: 2008-02-14, 10:27
  5. Replies: 6
    Last Post: 2007-04-16, 23:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×