sklearn 图片相似

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jacke121/article/details/85106805

from skimage.measure import compare_ssim
from scipy.misc import imread
import numpy as np
 
img1 = imread('1.jpg')
img2 = imread('2.jpg')
 
img2 = np.resize(img2, (img1.shape[0], img1.shape[1], img1.shape[2]))
 
print(img2.shape)
print(img1.shape)
ssim = compare_ssim(img1, img2, multichannel=True)
 
print(ssim)
 

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/85106805