Combining Shape Matrices and HMMs for Hand-Drawn Pictogram Recognition