<p>This sounds pretty similar to what I did in my Bachelors thesis about "<a href="http://arxiv.org/abs/1511.09030" rel="nofollow">On-line Recognition of Handwritten Mathematical Symbols</a>".</p>

<p>You can recognize those patterns with a <a href="https://en.wikipedia.org/wiki/Artificial_neural_network" rel="nofollow">neural network</a>. Interpolate the lines, normalize the points on a line to a fixed number, take the (x,y) coordinates as input features and the types of shape as output nodes (one node for circle, one node for triangle, ...).</p>

<p>You can create such a network with TensorFlow. Here are <a href="http://martin-thoma.com/tensor-flow-quick/" rel="nofollow">my two cents about TensorFlow</a>.</p>

<h2>Dynamic Time Warping</h2>

<p>This is a pattern matching approach. See my bachelors thesis or <a href="https://en.wikipedia.org/wiki/Dynamic_time_warping" rel="nofollow">wikipedia</a>.</p>

<h2>Alternatives to Machine Learning</h2>

<p>If you want something simpler and if you only have a tiny amount of classes (e.g. &lt; 30), then you could probably also hand-engineer an algorithm. I recommend to have a look at the <a href="https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm" rel="nofollow">Douglas-Peucker algorithm</a> to find the most important points. I've described it in my bachelor's thesis. When you go to <a href="http://www.martin-thoma.de/write-math/render/?raw_data_id=331161&amp;show_points=on&amp;dot_reduction_threshold=0.2&amp;dehooking_threshold=20&amp;minimum_time_delay_filter_constant=10&amp;smoothing_applications=1&amp;smooth1=0&amp;smooth2=1&amp;smooth3=0&amp;douglas_peucker=on&amp;epsilon=10&amp;cubic_spline_points=20" rel="nofollow">this interactive preprocessing page</a> you can get a feeling for this algorithm (you can draw something on write-math.com, click on "Drawing" below the canvas, click on "Preprocessing" and apply it by checking the checkbox)</p>

<h2>See also</h2>

<ul>
<li><a href="http://www.cs.virginia.edu/~xj3a/research/publications/PG02.pdf" rel="nofollow">On-line Graphics Recognition</a></li>
<li><a href="http://lib.tkk.fi/Dipl/2011/urn100500.pdf" rel="nofollow">Online Sketch Recognition: Geometric Shapes</a></li>
</ul>
Pattern matching a drawing with basic shapes
<p>I have a python list of coordinates saved like this : <code>[(34,55),(44,66)....]</code>.
This list indicates a hand drawn line on the screen. Now I need to check if this line/shape matches with some pre saved similar lists of basic shapes like square, circle, triangle, etc. (Basically I need to recognise user gestures.) Please suggest some machine learning technique to achieve it. Suggest the link if this is a duplicate. (I prefer a python solution for this.)</p>

<p>P.S : The shape that user is inputting comes from a camera/video. It is the path traversed by an object I am tracking with opencv. Now I need to figure what shapes the user is drawing by waving the object in front of the camera.</p>