This paper formulates shape registration as an optimal coding problem. It employs a set of landmarks to establish the correspondence between shapes, and assumes that the best correspondence can be achieved when the polygons formed by the landmarks optimally code all the shape contours, i.e., obtain their minimum description length (MDL). This is different from previous MDL-based shape registration methods, which code the landmark locations. In this paper, each contour is discretized to be a set of points to make the coding feasible, and a number of strategies are adopted to tackle the difficult optimization problem involved. The resulting algorithm, called CAP, is able to yield statistical shape model with better quality in terms of model generalization error, which is demonstrated on both synthetic and biomedical shapes.