As a part of a content based retrieval system for figurative images we develop algorithms for determining the measure of similarity between two images. We assume that shapes contained in the images are modeled by sets of plane polygonal curves. Our objective is to develop an algorithm which comes close to human similarity perception and allows an efficient implementation for the retrieval system. The method we introduce attempts to capture an intuitive notion of matching, i.e., we find one or more candidates for the best transformation, that when applied to one shape maps the most similar parts of the shapes to each other. The major idea is to take a random sample of points from both shapes and give a ``vote'' for that transformation (translation, rigid motion or similarity map) matching one sample with the other. If that experiment is repeated many times, we get a certain distribution of votes in the transformation space. Clusters of the votes indicate the candidates of transformations which would give the best match between the two shapes.