Content-based image retrieval (CBIR) is an important issue in the computer vision community. Both visual and textual content descriptions are employed when the user formulates queries. Shape feature is an important visual feature, as it corresponds to the region of interest in images. For retrieval, shape comparisons must be compact and accurate, and must be invariant to several geometric transformations such as translation, rotation and scaling, even if the particular representation may be rotated. In this paper, we propose a shape comparison technique based on the flat segments of the contour. The segmentation utilizes the Freeman coding technique and run length coding. The lengths of the flat segments make up a length vector, which are used to compare the similarity of the shapes. Experimental results from the test on the standard SQUID database are reported. 12 Pages