return -sum([(p * math.log(p, 2)) for p in samples_probability if p != 0])
img1 = Image.open('SnowCam_main1.jpg')
img2 = Image.open('SnowCam_main2.jpg')
img3 = Image.open('SnowCam_main3.jpg')
img = ImageChops.difference(img1, img1)
img.save('test_diff1.png')
print(image_entropy(img))
img = ImageChops.difference(img1, img2)
img.save('test_diff2.png')
print(image_entropy(img))
img = ImageChops.difference(img1, img3)
img.save('test_diff3.png')
print(image_entropy(img))
How to detect motion between two PIL images? (wxPython webcam integration example included)