Handwritten character recognition using elastic matching based on a class-dependent deformation model