参考博客Skimage.measure 的compare_psnr和compare_ssim的改动
from skimage.metrics import structural_similarity as compare_ssim
from skimage.metrics import peak_signal_noise_ratio as compare_psnr
import cv2
img1 = cv2.imread(r'HanJie-20220524-102819-Ping-10260.jpg')
img2 = cv2.imread(r'result.jpg')
psnr = compare_psnr(img1, img2)
ssim = compare_ssim(img1, img2, multichannel=True) # 对于多通道图像(RGB、HSV等)关键词multichannel要设置为True
#mse = compare_mse(img1, img2)
print('PSNR:{},SSIM:{}'.format(psnr, ssim))