In a content-based image retrieval system, it is necessary to find a metric to index shapes of objects in the images. The metric should be unique to each shape, regardless of size and orientation. A similarity measure is also needed which should reflect the perceptual similarity, i.e. the perceptual similar shapes should have high similarity values. Chain codes have been used for shape description in previous works, but chain codes are non-invariant to shape size and orientation. In this paper, a method is introduced to eliminate the inherent non-invariance of chain codes to obtain unique chain codes for shapes. The shape index is derived from this unique chain code representation. The shape distance and similarity measures based on the shape indexes are then discussed. The indexing and retrieval procedures discussed in this paper should be applicable to large image databases.