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 685655 - opencv: added OpenCV-based hand gesture detection plugin
opencv: added OpenCV-based hand gesture detection plugin
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-07 12:36 UTC by Andol Li
Modified: 2014-11-17 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
source codes of the hand detection plugin (35.35 KB, application/octet-stream)
2012-10-07 12:36 UTC, Andol Li
  Details
opencv: Add handdetect plugin, Initial implementation. (161.60 KB, patch)
2013-01-27 17:28 UTC, sreerenj
none Details | Review
opencv: port handdtect plugin to 1.0. (26.20 KB, patch)
2013-01-27 17:29 UTC, sreerenj
none Details | Review
opencv: port handdtect plugin to 1.0 (32.92 KB, patch)
2013-01-30 12:41 UTC, sreerenj
none Details | Review
relicense the sample code under LGPLv2+ (2.16 KB, patch)
2014-11-17 09:16 UTC, sreerenj
committed Details | Review

Description Andol Li 2012-10-07 12:36:29 UTC
Created attachment 225985 [details]
source codes of the hand detection plugin

This plugin uses OpenCV to deploy natural hand gesture detections for operations of multimedia playbacks, i.e. using a fist gesture to control the position of media playback or a closed palm to stop media playing. 

This plugin has implemented the detection of two hand gestures - fist and closed palm. When the gesture is detected, a message is sent to main bus, and a simulated mouse event is sent upstream. In the future when Gstreamer core is updated with hand gesture upstream events, this plugin will use the new event routine for navigation.

This plugin can be reached in github in https://github.com/yandol/GstHanddetect.
Comment 1 Tim-Philipp Müller 2012-10-07 12:38:58 UTC
Any chance you could port it to 1.0 ?
Comment 2 Andol Li 2012-10-07 12:44:14 UTC
ready to port this plugin to 1.0, but will have a double-check before that.
Comment 3 sreerenj 2012-10-07 14:10:10 UTC
Hi Andol, happy to see this here :).. please have a look through the opencv plugins which are already ported to 1.0 in git master..It won't be difficult for you to port handdetect to 1.0 ...

Anyway congrats for the Gsoc-project completion...
Comment 4 sreerenj 2013-01-27 17:27:46 UTC
I have ported it to 1.0 . It is just a basic port to make it work with 1.0 ,since the plugin needs few more fixes and some more proper structuring.(I can do it later when i get time or someone else can do :)..)

But i think nothing is preventing to push it to plugins-bad. 

--plugin ported to 1.0
--example is working fine, which is added to plugins-bad/test/examples (renamed to gsthanddtect_test.c)
--fist.xml and palm.xml are installing to OPENCV_PREFIX/share/opencv/haarcascades.

Attaching 2 patches.
Comment 5 sreerenj 2013-01-27 17:28:49 UTC
Created attachment 234554 [details] [review]
opencv: Add handdetect plugin, Initial implementation.
Comment 6 sreerenj 2013-01-27 17:29:45 UTC
Created attachment 234555 [details] [review]
opencv: port handdtect plugin to 1.0.
Comment 7 Tim-Philipp Müller 2013-01-28 21:20:35 UTC
Hi, what's the source of the fist.xml and palm.xml files?

Do they really need to ship with the plugin and be installed by us?

If so, it seems wrong to install them into an opencv path. Either opencv ships this, then we should require it and error out if the files needed aren't there, or we install them into our ownprefix.

Please also make sure all .c and .h files contain proper licenses. I believe the example doesn't have a proper license header.
Comment 8 sreerenj 2013-01-29 07:36:00 UTC
Hi Tim, Yup we have to install it into our own prefix then since palm.xml and fist.xml are not from opencv. Andol's main task in gsoc was to create those palm.xml and fist.xml which was a time consuming process.

Actually i was thinking to install it to gstreamer prefix then changed my mind :)..Will update that(not now..)..
Thanks..
Comment 9 sreerenj 2013-01-29 13:38:46 UTC
Hi Tim,
Can i add 
AS_AC_EXPAND(DATADIR, $datadir)
AC_DEFINE_UNQUOTED(GST_DATADIR, "$DATADIR", [data dir])

to plugins-bad configure.ac??  (to get the $datadir path in gsthanddetect.c)

or at least I need the prefix var. So that i can add something like,
#define HAAR_CASCADES_DIR GST_PREFIX "/share/gstreamer-"GST_API_VERSION"/opencv_haarcascades
to gsthanddetect.
Comment 10 sreerenj 2013-01-30 12:41:25 UTC
Created attachment 234822 [details] [review]
opencv: port handdtect plugin to 1.0
Comment 11 sreerenj 2013-01-31 09:17:35 UTC
It would be good if you can change the "Version" from 0.10.x to git.
Comment 12 sreerenj 2013-02-28 22:07:11 UTC
Is there any major issue which is preventing this to push ???
Comment 13 Tim-Philipp Müller 2013-03-01 00:30:37 UTC
No major issues :)

Pushed now, many thanks!


commit dec865b2ff4a68b5d63d104f3c8f33f9c37e1219
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Fri Mar 1 00:10:46 2013 +0000

    opencv: use pkgdatadir locally to construct path for custom haar cascades
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685655

commit 757e7c25bfe6479eafbca72643662903614d696c
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Wed Jan 30 14:37:18 2013 +0200

    opencv: port handdetect element to 1.0 and add to build
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685655

commit 7faa44057e0802fc5a98eda8798cb0e0a42a1972
Author: Andol Li <andol@andol.info>
Date:   Sun Jan 27 19:05:27 2013 +0200

    opencv: add handdetect plugin, initial implementation
    
    The handdetect plugin is for detecting hand gestures using
    opencv.
    
    It was created in the course of the Google Summer of Code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685655


Could still use some clean-ups (e.g. property names, split super-long string constants, etc.).
Comment 14 Tim-Philipp Müller 2014-11-17 00:45:27 UTC
Sreerenj, you added a license to the source code, and when doing that added an GPLv3 header instead of an LGPLv2+ header. Was that on purpose?

Could you please relicense your contributions as LGPLv2+ like the rest of GStreamer (by stating so here in the bug)?
Comment 15 sreerenj 2014-11-17 03:15:22 UTC
(In reply to comment #14)
> Sreerenj, you added a license to the source code, and when doing that added an
> GPLv3 header instead of an LGPLv2+ header. Was that on purpose?
> 
> Could you please relicense your contributions as LGPLv2+ like the rest of
> GStreamer (by stating so here in the bug)?

Do you mean the header with in the source code?
Most probably I just copied the same header which has been used in other opencv files..
Do you want to change the copyright header message in all ext/opencv/*.{c.h}?
Comment 16 Tim-Philipp Müller 2014-11-17 09:04:04 UTC
> Do you mean the header with in the source code?

Yes.

> Most probably I just copied the same header which has been used in other opencv
> files..
> Do you want to change the copyright header message in all ext/opencv/*.{c.h}?

No, just tests/examples/opencv/
Comment 17 sreerenj 2014-11-17 09:16:13 UTC
Created attachment 290839 [details] [review]
relicense the sample code under LGPLv2+
Comment 18 Tim-Philipp Müller 2014-11-17 09:25:18 UTC
Comment on attachment 290839 [details] [review]
relicense the sample code under LGPLv2+

Thanks!

commit b8a2f46a88805ff6f6c48d55c46b964b4aef4495
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Mon Nov 17 11:10:35 2014 +0200

    examples: relicense opencv gsthanddetect_test to LGPLv2+
    
    The GPL3 license header was copy'n'pasted from a
    neighbouring source file by mistake, the original
    code was not GPL3 licensed, but fell under the
    default GStreamer license, which is LGPLv2+.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685655