Complex gestures

Hello,

I’m working on a project and I’m really stucked with gestures, I need to detect some complex gestures like “Z” or “V” or “U”.

Tho I know how to code simple ones with c# , I do not know where to begin coding these.

Thanks in advance

Well, the usual way is to only store directions of movement. They should be limited in length and time. So if you’re input moves a certain amount it will take the difference as direction vector, or if a certain time has passed in combination with a small minimum movement bias.

You’ll end up with a list / continuous stream of direction vectors. Now you might have to filter / combine similar directions into one, also based on a min / max difference (based on the angle).

Finally you need to figure out which of your gestures fits best. You can either require a perfect match or a weighted match. For a perfect match your filtering has to be reliable and you usually limit the possible directions to around 8 (45°). The weighted approach you would slide each possible gesture along the input stream and calculate the difference to the gesture pattern. Add up those differences (arithmetic mean or something like that) and pick the lowest match. If you do this for all gestures, the one with the lowest difference is the right one.

This is all not as simple as it sounds and requires a lot of testing / debugging. As alternative you might look out for a ready to use solution.