In general, it is difficult to segment accurately image regions or boundary contours and represent them by feature vectors for shape-based image query. Therefore, the object similarity is often computed by their boundaries. Hausdorff distance is nonlinear for computing distance, it can be used to measure the similarity between two patterns of points of edge images. Classical Hausdorff measure need to express image as a feature matrix firstly, then calculate feature values or feature vectors, so it is time-consuming. Otherwise, it is difficult for part pattern matching when shadow and noise existed. In this paper, an algorithm that use Hausdorff distance on the image boundaries to measure similarity is proposed. Experimental result has showed that the proposed algorithm is robust.