Image matching based on medium similarity measure