两张图片的相似度

from skimage.measure import compare_ssim
import cv2

if __name__ == '__main__':

    img1 = cv2.imread(r'facebank/ab/1.jpg')
    img2 = cv2.imread(r'facebank/yangmi/1.jpg')

    img2 = cv2.resize(img2,(img1.shape[1],img1.shape[0]),interpolation=cv2.INTER_LINEAR)
    print(img2.shape)
    print(img1.shape)
    ssim = compare_ssim(img1,img2,multichannel=True)
    print(ssim)

你可能感兴趣的:(两张图片的相似度)