After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753994 - opencv/faceblur: does not work with OpenCV newer than 2.4.10
opencv/faceblur: does not work with OpenCV newer than 2.4.10
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.7.1
Assigned To: Vanessa Chipirrás Navalón
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-23 16:28 UTC by Vanessa Chipirrás Navalón
Modified: 2015-10-02 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change gstfaceblur to C++ (29.23 KB, patch)
2015-08-26 10:39 UTC, Vanessa Chipirrás Navalón
committed Details | Review
Code refactoring of gst_face_blur_load_profile (2.76 KB, patch)
2015-08-26 10:40 UTC, Vanessa Chipirrás Navalón
committed Details | Review
Check CvHaarClassifierCascade is release before being modified. (1.23 KB, patch)
2015-08-26 10:55 UTC, Vanessa Chipirrás Navalón
committed Details | Review
Need to migrate to C++ (5.17 KB, patch)
2015-08-26 16:02 UTC, Vanessa Chipirrás Navalón
none Details | Review
Test Image of faceblur (1.01 MB, image/png)
2015-08-26 16:08 UTC, Vanessa Chipirrás Navalón
  Details
Need to migrate to new version of OpenCV (5.20 KB, patch)
2015-08-26 16:27 UTC, Vanessa Chipirrás Navalón
committed Details | Review
Remove unused variable. (1.83 KB, patch)
2015-08-26 16:29 UTC, Vanessa Chipirrás Navalón
committed Details | Review
textoverlay: remove unused variable (1.49 KB, patch)
2015-08-26 17:45 UTC, Luis de Bethencourt
committed Details | Review

Description Vanessa Chipirrás Navalón 2015-08-23 16:28:59 UTC
$ gst-launch-1.0 autovideosrc ! videoconvert ! faceblur ! videoconvert ! autovideosink

When I run this, the face blurred is not detected in the camera.
It is due to the new structure of the classifier "CascadeClassifier" that opencv used in versions newer than 2.4.10.

"gstfaceblur.c" should be transform C ++ language and to use the "load" method to load the old and new structure of the classifier.

Previously the classifier was:
<haarcascade_frontalface_default type_id="opencv-haar-classifier">
Now it is:
<cascade type_id="opencv-cascade-classifier"><stageType>BOOST</stageType>
Comment 1 Vanessa Chipirrás Navalón 2015-08-26 10:39:40 UTC
Created attachment 310011 [details] [review]
Change gstfaceblur to C++

Change the gstfaceblur.c file to cpp and add it into Makefile.
It is necessary to migrate the faceblur plugin to C++,
in order to load new and old classifiers, to make faceblur work
with newer versions of Opencv.

https://bugzilla.gnome.org/show_bug.cgi?id=753994

Ready for review.
Comment 2 Vanessa Chipirrás Navalón 2015-08-26 10:40:53 UTC
Created attachment 310012 [details] [review]
Code refactoring of gst_face_blur_load_profile

Changes inside the gst_face_blur_load_profile function, the number of
input parameters and in lines where it is used due to it cannot be used
generically.

https://bugzilla.gnome.org/show_bug.cgi?id=753994

Ready for review.
Comment 3 Vanessa Chipirrás Navalón 2015-08-26 10:55:24 UTC
Created attachment 310018 [details] [review]
Check CvHaarClassifierCascade is release before  being modified.

For PROP_PROFILE case that exist inside gst_face_blur_set_property
function loads the new XML file in the CvHaarClassifierCascade property
without first checking that it is released because maybe there is an XML
file previously loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 4 Vanessa Chipirrás Navalón 2015-08-26 11:08:05 UTC
Ready for review the last patch too.
Comment 5 Luis de Bethencourt 2015-08-26 12:05:49 UTC
Will review in a few hours.
Comment 6 Luis de Bethencourt 2015-08-26 13:35:22 UTC
Review of attachment 310011 [details] [review]:

Looks good.
Comment 7 Luis de Bethencourt 2015-08-26 13:38:28 UTC
Review of attachment 310012 [details] [review]:

Looks good as well.
Comment 8 Luis de Bethencourt 2015-08-26 13:47:17 UTC
Review of attachment 310018 [details] [review]:

Looks good.

Now the missing part is switching to use the new CascadeClassifier () API for this element to work.
Comment 9 Vanessa Chipirrás Navalón 2015-08-26 16:02:17 UTC
Created attachment 310043 [details] [review]
Need to migrate to C++

The cascade classifier changes its structure on new version of OpenCV 2.4.11.
It is need to migrate to C++ to utilize the new load method of OpenCV which
allows to load the old and new classifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=753994

Ready for review.
Comment 10 Vanessa Chipirrás Navalón 2015-08-26 16:08:25 UTC
Created attachment 310044 [details]
Test Image of faceblur
Comment 11 Luis de Bethencourt 2015-08-26 16:17:22 UTC
Review of attachment 310043 [details] [review]:

Commit subject should be:
faceblur: need to migrate to new version of OpenCV 2.4.11

Besides that...
It works well. Great job! :)
Comment 12 Vanessa Chipirrás Navalón 2015-08-26 16:27:13 UTC
Created attachment 310045 [details] [review]
Need to migrate to new version of OpenCV

The cascade classifier changes its structure on new version of OpenCV 2.4.11.
It is need to migrate to C++ to utilize the new load method of OpenCV which
allows to load the old and new classifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=753994

I changed the subject of this patch.
Comment 13 Vanessa Chipirrás Navalón 2015-08-26 16:29:20 UTC
Created attachment 310046 [details] [review]
Remove unused variable.

Memory is reserved for this variable and then released without making any
use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 14 Luis de Bethencourt 2015-08-26 16:45:19 UTC
Review of attachment 310045 [details] [review]:

Thanks
Comment 15 Luis de Bethencourt 2015-08-26 16:47:02 UTC
Review of attachment 310046 [details] [review]:

Looks good. Will merge after freeze.
Comment 16 Luis de Bethencourt 2015-08-26 17:45:01 UTC
Created attachment 310056 [details] [review]
textoverlay: remove unused variable

Not related to faceblur, but it is related to the last patch in the faceblur series.

It doesn't really deserve it's own bug and I just wanted to save it here until the freeze.
Comment 17 Luis de Bethencourt 2015-08-26 17:45:21 UTC
Review of attachment 310056 [details] [review]:

Wait till after freeze.
Comment 18 Luis de Bethencourt 2015-08-28 14:46:44 UTC
Review of attachment 310056 [details] [review]:

Merged.
Comment 19 Luis de Bethencourt 2015-10-02 16:41:36 UTC
Review of attachment 310011 [details] [review]:

commit 6193f52f2d88d0fd8ec286d9446c3ad21345a89d
Author: Vanessa Chipirrás Navalón <vchipirras6@gmail.com>
Date:   Wed Aug 26 11:57:24 2015 +0200

    faceblur: Change gstfaceblur to C++.

    Change the gstfaceblur.c file to cpp and add it into Makefile.
    It is necessary to migrate the faceblur plugin to C++,
    in order to load new and old classifiers, to make faceblur work
    with newer versions of Opencv.

    https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 20 Luis de Bethencourt 2015-10-02 16:42:12 UTC
Review of attachment 310012 [details] [review]:

commit bbd16144ca4c572485a4b74f0cf10f701d867e9b
Author: Vanessa Chipirrás Navalón <vchipirras6@gmail.com>
Date:   Wed Aug 26 12:27:15 2015 +0200

    faceblur: Code refactoring of gst_face_blur_load_profile.

    Changes inside the gst_face_blur_load_profile function, the number of
    input parameters and in lines where it is used due to it cannot be used
    generically.

    https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 21 Luis de Bethencourt 2015-10-02 16:42:51 UTC
Review of attachment 310018 [details] [review]:

commit acdcfedde27fc33dfc13a091228405c5526706f3
Author: Vanessa Chipirrás Navalón <vchipirras6@gmail.com>
Date:   Wed Aug 26 12:47:58 2015 +0200

    faceblur: Check CvHaarClassifierCascade is release before being modified.

    For PROP_PROFILE case that exist inside gst_face_blur_set_property
    function loads the new XML file in the CvHaarClassifierCascade property
    without first checking that it is released because maybe there is an XML
    file previously loaded.

    https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 22 Luis de Bethencourt 2015-10-02 16:43:25 UTC
Review of attachment 310046 [details] [review]:

commit 02d8a4f4e8b86c4b27a3e687beec1504aea066b6
Author: Vanessa Chipirrás Navalón <vchipirras6@gmail.com>
Date:   Wed Aug 26 17:56:50 2015 +0200

    faceblur: need to migrate to C++.

    The cascade classifier changes its structure on new version of OpenCV 2.4.11.
    It is need to migrate to C++ to utilize the new load method of OpenCV which
    allows to load the old and new classifiers.

    https://bugzilla.gnome.org/show_bug.cgi?id=753994
Comment 23 Luis de Bethencourt 2015-10-02 16:43:56 UTC
Review of attachment 310045 [details] [review]:

commit 02d8a4f4e8b86c4b27a3e687beec1504aea066b6
Author: Vanessa Chipirrás Navalón <vchipirras6@gmail.com>
Date:   Wed Aug 26 17:56:50 2015 +0200

    faceblur: need to migrate to C++.

    The cascade classifier changes its structure on new version of OpenCV 2.4.11.
    It is need to migrate to C++ to utilize the new load method of OpenCV which
    allows to load the old and new classifiers.

    https://bugzilla.gnome.org/show_bug.cgi?id=753994