前言
比如在视频中查看相邻帧之间的差异
代码
from PIL import Image
import os
import matplotlib.pylab as plt
from PIL.ImageChops import subtract,multiply,screen,difference,add
if __name__ == '__main__':
images_dir = "D:/pycodes/python_image_processing/9781789343731_Code/images"
file_name1 = "goal1.png"
file_name2 = "goal2.png"
file_path1 = os.path.join(images_dir,file_name1)
file_path2 = os.path.join(images_dir,file_name2)
im1 = Image.open(file_path1)
im2 = Image.open(file_path2)
im = difference(im1,im2).show()