2D shape recognition by Hidden Markov Models