# Using Correlation for mouse gesture recognition

I am in need to build a mouse gesture recognition system which will compare given recognition to the the gestures in training data and will say where a given gesture best fits.

I am planning to use correlation to accomplish this. I would run Correlation on given input against all the gestures in training data and will select the action associated to the gesture with best correlation co-efficient (and cross a threshold).

I am not sure how robust correlation is for this purpose, so need your insight into this. Also please suggest if you think I should better be using something other than Correlation...

Regards,

Microkernel

PS: I am more of a programmer than a mathematician :(

-
hey, any response on our answers? be fair – MarianP Sep 23 '11 at 18:26

## 3 Answers

Your question is a little too general. It corresponds (assuming you have a fixed database of already classified data) to the most general supervised classication problem, for which there are tons of algorithms - the nearest neighbour rule is perhaps the most simple. But in any case, you always will need to define a "good" way of measure "distances" (among data items - gestures in your case) ; you'll want to try to minimize that distance, (or maximize the correlation, what is conceptually equivalent). The difficult thing is to define a good representation of your data that leads to a nice (to compute and to perform) distance function. (Read eg Duda & Hart)

-

Before re-inventing the wheel, I would read the literature. There are some links to papers and software libraries on Wikipedia: http://en.wikipedia.org/wiki/Pointing_device_gesture

-

It is not possible to simply correlate two sets of data of uneven sizes unless you approximate some points or do some other hacks.

Dynamic time warping is used for this among other methods. It is not too difficult to understand and implement, and there are plenty of providing libraries out there.

http://en.wikipedia.org/wiki/Dynamic_time_warping

-