Line pattern recognition

How should a line pattern recognition work? I'm making a game prototype in which you can draw freehand line patterns that should be compared and matched with some other patterns. Is there some default way of implementing this, I'm not sure from where to start?
Might be good to do some research on handwriting recognition.
Do you mean straight lines of freehand curved lines?
Surely hand writing recognition is a good set of keywords.
Yeah, I'm looking into handwriting recognition stuff now.
It's kind of in vein of those spell casting games where you draw some pattern freehand on screen and then that pattern is recognized as pattern for some spell, so you activate some action by drawing a specific pattern.
So I'm basically tracking movement positions and then I connect those points with lines to get whatever pattern you drew. It's a freehand thing, so it's like you did a brushstroke, it can be curvy or whatever.
I believe some implementations store a pattern as a sequence of directions.

You can add some location restrictions so that for example the lines of a cross actually need to intersect.
Yes i think storing directions is a better solution than working with pixels like hand writing recognition mostly do.