Similarity test for my image retrieval algorithm?