I would like to create a program that compares two images. It must take in 2 folders, each full of pictures and each picture in one folder has a pair in the other folder (with the same filename) ex: folder1 has 3 pictures: [a.png, b.png, c.png], and folder2 has 3 pictures: [a.png, b.png, c.png]. I would like to take folder1/a and compare it to folder2/a. I do not know where to start.
Share
You mentioned
imagesinstead offileso I assume you don’t want to compare raw data but the image pixels and you may also want to have threshold for difference between imagesEasiet way to do that is compare two images using PIL. PIL has a
histogramfunction, you can use that to get histogram for both images and then getting a RMS(root mean square) e.g.copied from http://effbot.org/zone/pil-comparing-images.htm
once you have a function which returns rmsdiff, you can use that in another function which iterates thru all files e.g.