Dec-17-2019, 01:37 PM
Hi everyone, I would like to write a code to compare two photographs (same dimensions) in order to understand if they are similar or not.
I take photographs at intervals of several minutes and I would like to write a code that verifies that the last photo is similar to the previous one and that otherwise, if for example an obstacle is placed in front of the frame, it sends an alarm message.
But this code shows me a photo with different pixels and I don't need it.
Does anyone have any advice?
I take photographs at intervals of several minutes and I would like to write a code that verifies that the last photo is similar to the previous one and that otherwise, if for example an obstacle is placed in front of the frame, it sends an alarm message.
1 2 3 4 5 6 7 8 9 |
from PIL import Image from PIL import ImageChops img1 = Image. open ( "file1" ) img2 = Image. open ( "file2" ) diff = ImageChops.difference(im2, im1) diff.save( "file3" ) |
Does anyone have any advice?