I have two colored images img1 and img2 as defined below
img1 = cv2.imread("source1")
img2 = cv2.imread("source2")
Now I want to know if the distribution of the RGB value of two images is almost identical. As a human, I can see from the RGB histogram distribution of the two images that they are almost identical or not. But is there a way that I can do this via OpenCV, that it can tell that two images are almost identical with it comes to its RGB distribution?
color = ('b','g','r')
for i,col in enumerate(color):
histr = cv.calcHist([img1],[i],None,[256],[0,256])
plt.subplot(1,2,1)
plt.plot(histr,color = col)
plt.xlim([0,256])
plt.title("Img 1")
histr = cv.calcHist([img2],[i],None,[256],[0,256])
plt.subplot(1,2,2)
plt.plot(histr,color = col)
plt.xlim([0,256])
plt.title("Img 2")
plt.show()