I want to compare to images in python, say imageA.jpg and imageB.jpg. I do it this way:
f = open('./imageA.jpg','rb')
imgA = f.read()
f.close()
f = open('./imageB.jpg','rb')
imgB = f.read()
f.close()
imagesEqual = imgA == imgB
The last line basically checks for string equality of the binary data read from the two image files. Now, a lot of stackoverflow questions and google searches suggest to use python modules like ImageChops or OpenCV. Is the way I am doing this incorrect? If so why?
Thanks!