[Plugin] : Unistroke Gesture Recognizer

Forum Home Forum Home > Construct 2 Development > Plugins for Construct 2
 Post Reply Post Reply Page  123 6>
Author
5,295 Rep
Post Options Post Options   Quote Pode Quote  Post ReplyReply Direct Link To This Post Topic: [Plugin] : Unistroke Gesture Recognizer
    Posted: 31 Jan 2012 at 5:26pm
Edit : Update 08 - february - 2012
New build !http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/pode_1StrokeGestureRecognizer.0.3.zip
Demo : http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/index.html
To appologize, there's a new functionnality : remove a specific gesture, by name

Edit : Update 07 - february - 2012
New build ! http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/pode_1StrokeGestureRecognizer0.2.zip
- Centroid, Bounding Box, Angle
- delete all gesture from the lib (even those given at the start)
- add a custom list of points ! (provided as "X1,Y1|X2,Y2|...|XnYn)

The demo is updated, by the way : http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/index.html

Edit2 : I also added a Custom Gesture Creator : http://dl.dropbox.com/u/1412774/CustomGestureCreator/index.html
http://dl.dropbox.com/u/1412774/CustomGestureCreator/GestureCreator.capx. It's easier for the creation of custom gesture's pointlists...

____________________

I remembered using a library to work with wiimote, helping to recognize gestures made with the gamepad.
That lib is there : http://depts.washington.edu/aimgroup/proj/dollar/
So I made a plugin for C2 today, that helps to recognize gestures made by the user, which uses that lib.
You can get that plugin there : http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/pode_1StrokeGestureRecognizer.zip
I also made a quick demo app, mimicking the one from the original link :


http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/index.html
And a demo capx : http://dl.dropbox.com/u/1412774/oneStrokeGestureRecognizerC2Plugin/oneStrokeGestureRecognizerC2PluginDemo.capx

One thing to know : in the original algorithm, the recognition works when there's more than 10 points defined for a gesture.

In a future rev., I'm going to add the possibility to give directly to the plugin a list of points (for example, if you already determined a predefined gesture), and the possibility to load that from a file.

When I have more time, I'm going to integrate the N strokes (multistrokes) Javascript lib from the same team...

Edit : it's up to you to set a level (score) under which the gesture isn't recognized, because the lib will try its best to recognize something anyway. I usually go for something between 75 (it let pass a few bad detection) to 90 (pretty strict detection).

Edit2 : In the original paper, to have a good recognition when you add new gestures, you need to add at least 3 variants of that gesture. So if you want to detect a new gesture, to forget to draw it 3 times and add it 3 times ! :)

Edit3 : the action "Clear Point List" empties any user defined gesture, not gesture pre-packaged with the lib !

Edited by Pode - 08 Feb 2012 at 2:36pm
Back to Top
16,358 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 31 Jan 2012 at 5:32pm
I am grinning like your avatar right now.
Back to Top
5,635 Rep
Post Options Post Options   Quote smitchell Quote  Post ReplyReply Direct Link To This Post Posted: 31 Jan 2012 at 5:52pm
Wow, Cannot think of a place of where i'll use this in my game, But none the less, Great Plugin!! will look nice in my list of 3rd party plugins
In memory of flash :'(
Back to Top
5,295 Rep
Post Options Post Options   Quote Pode Quote  Post ReplyReply Direct Link To This Post Posted: 31 Jan 2012 at 5:57pm
I just added two things to the original post I'm just remembering now...
Back to Top
6,686 Rep
Post Options Post Options   Quote septeven Quote  Post ReplyReply Direct Link To This Post Posted: 31 Jan 2012 at 6:19pm
Pode, that is a great plugin !
Back to Top
16,358 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2012 at 2:02am
I figured out how to parse a string and add it via events, only thing is, the default gestures cause a false positive sometimes. Is there any way to take the defaults out?

Edited by newt - 01 Feb 2012 at 2:03am
Back to Top
10,250 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2012 at 2:53am
Very cool and powerful!

Edited by rexrainbow - 01 Feb 2012 at 3:11am
Back to Top
9,136 Rep
Post Options Post Options   Quote edisone Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2012 at 10:02am
excellent!!!!!!!!!
Back to Top
5,295 Rep
Post Options Post Options   Quote Pode Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2012 at 1:22pm
@newt : I'm not really sure what you mean by "the default gestures cause a false positive sometimes. Is there any way to take the defaults out?"
If, when you draw something that's not looking something you aleardy have in the library of gesture, the lib will try to match it anyway (but it will get a very bad score). So you can filter false positives with a high score. Is it helping you ?

@all : I didn't think about that in the beginning, but with that lib, you can do a "swipe gesture" detection on mobile ;).

I also edited the original post to add something : to have a good recognition when you add new gestures, you need to add at least 3 variants of that gesture.
Back to Top
16,358 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2012 at 3:01pm
Ahh, ok the variants, and checking the score should help.
That does make me wonder about adding gestures from externals. I guess you would have to make variants for that as well.
Back to Top
 Post Reply Post Reply Page  123 6>

Forum Jump Forum Permissions View Drop Down