A Bayesian Framework for Deformable Pattern Recognition With Application to Handwritten Character Recognition