I have a task to find the differences between two images, but the issue is that when I use the code below, there are too many differences between the two images, almost the entire image appears different, even though they should only differ in a few parts. However, the specific differences will have a darker color. Please help me figure out how to accurately identify the differences and use OpenCV to circle the differing points on the two original images
Image1:
Image2:
My code:
from PIL import Image, ImageChops
img1, img2 = Image.open('1.png'), Image.open('2.png')
diff = ImageChops.difference(img1,img2)
if diff.getbbox():
diff.show()
Output:
I use PIL library to detect difference between two images