Archived

This topic is now archived and is closed to further replies.

Gestures..

This topic is 5827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I''m not sure if this is the forum to post this on, if it isnt let me know. I need to implement a simple gesture system into my game. Very simple, in fact, only 1 or 2 gestures is needed. 1 is a simple double circle, one is a square. Does anyone have any thoughts on where to start with this. The closest I have come, is taking every x,y coordinate of the mouse and try to find a pattern, if it matches my pattern, then a gesture has been detected. I dunno, just trying to figure this out. Any help would be great. - DBridle

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try this:

http://www.generation5.org/aisolutions/gestureapp.shtml

Share this post


Link to post
Share on other sites
Someone has been playing Black & White then

Actually there was quite a large discussion about this on the forums on the Lionhead site. You may be able to still access it in the archives there.

For advanced stuff, looking at OCR methods could be useful.

For simple stuff - heavily quantize the movements into a set of connected lines. Check how many lines you have - this gives you a rough indicator of what the shape is and more importantly what it definately is not.
Next walk through the lines looking at the joints between the current line and its neighbours and look at the angle between them if it falls within some threshold for a certain shape, then that particular line is more likely to be part of that certain shape.
Finally the rough direction of each line can indicate a few things about the shape. [The direction and angles for example would tell you the difference between a pentagon and a pentagram]...



--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
I''d take a series of (x, y) pairs, then find a series of more-or-less equidistant pairs of points following the same path. Then I''d look at the gradient of each line segment.

Share this post


Link to post
Share on other sites
If you''re going to use (x,y) pairs, then you need to translate them to a set of independent coordinates. This is difficult if you are using an online learning method to train your gesture recognition system. One idea is to use the mean x and y values as the origin of the system.

A better approach is to follow SICA''s line of thinking. Instead of a sequence of (x,y) pairs, use a set of (length,angle) pairs for each line segment: i.e., the length of the line segment and the angle to the next one. Scale all of the line segments so that either the shortest has length 1 or the longest has length 1. If you use angles from [-PI,PI] then the last line segment will have an angle of PI (or -PI) since there is no proceeding segment. This method makes your lines independent of where they are drawn or how they are scaled, so a small pentagram would be the same as a large pentagram.

Hope this helps get you started.

Cheers,

Timkin

Share this post


Link to post
Share on other sites