caculate similarity between two images