我尝试根据颜色直方图找到图像相似度。但是,当方法为cv2.HISTCMP_CORREL时,结果始终为1。我分享了代码段。可能是什么原因?
import numpy as np
import cv2
x = np.random.rand(3, 64, 64)
y = np.random.rand(3, 64, 64)
hist1 = cv2.calcHist([x.astype(np.float32)], [0, 1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256])
hist2 = cv2.calcHist([y.astype(np.float32)], [0, 1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256])
print(cv2.compareHist(hist1, hist2, cv2.HISTCMP_CORREL))