Template-based sketch recognition using Hidden Markov Models