4

I wanna achieve something that looks like the wizard's ability in the game Trine.

I want to create a game where the player uses the mouse to create certain objects, so i will need to compare the shape the player drew to a predefined shape of my own and check if its close.

I have no idea how to achieve this and where to look for, I assume it has something to do with shape recognition like in image processing and computer vision but it should be much simpler and work in real time.

does anyone have a clue how this can be done or where can i look for something like that?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Amit Ofer
  • 413
  • 1
  • 7
  • 26

2 Answers2

5

Is this what you're going for? http://www.youtube.com/watch?v=7Zh79q_xvZw

I would start by researching gesture recognition. I think that's the phrase you need to get good info. http://en.wikipedia.org/wiki/Gesture_recognition

Also, sketch recognition: http://en.wikipedia.org/wiki/Sketch_recognition

entropo
  • 2,481
  • 15
  • 15
  • yes, thats what i was going for thanks! i wanna be able to match shapes that are a bit more complex than rectangles and triangles, so i can create all sorts of game objects, but the technique is probably the same – Amit Ofer Apr 04 '11 at 16:16
4

Have a look at this question. What you are looking for in particular is on-line handwriting recognition, meaning that you follow every move of the user from beginning to end.

Now, you might want to simplify it a whole lot, so one way is defining 9 areas, like a 3x3 grid. Then convert the user's movement into a list of how the user moved through these grids (use thresholds to make sure it was in that area for a while). Now you will have an array like this: 1-1, 1-2, 2-2, 2-3 (meaning the user went from upper-left corner, the upper-middle, etc.)

This information is now fairly easy to match to a set of gestures. If it performs poorly, you can either make it more difficult and introduce a Hidden Markov Model, that will allow some mistakes in the gesture (but still matching the most likely one you have in your gesture set), or you could simply display the grid to the user, so that the user will learn the gestures like number codes.

Community
  • 1
  • 1
Gustav Larsson
  • 8,199
  • 3
  • 31
  • 51
  • thanks, i thought of using some sort of image processing algorithm to compare between the shapes, but i need something that will work in real time, i figured that it has something to do with HHM and learning – Amit Ofer Apr 04 '11 at 16:17