We propose an improved shape matching algorithm that extends the work of Felzenszwalb . In this approach, we use triangular meshes to represent deformable objects and use dynamic programming to find the optimal mapping from the source image to the target image which minimizes a new energy function. Our energy function includes a new cost term that takes into account the center of mass of an image. This term is invariant to translation, rotation, and uniform scaling. We also improve the dynamic programming method proposed in  using the center of mass of an image. Experimental results on the Brown dataset show a 7.8% higher recognition rate when compared with Felzenszwalb’s algorithm.