import cv2 import numpy as np import filecmp import time import os old=set(os.listdir('C:\images')) while (1): new = set(os.listdir('C:\images')) if(new!=old): difference = new.difference(old) for images in difference: img = cv2.imread('C:\images/' + images) inverted = (255-img) inverted2 = inverted[148:3925 , 732:5157] cv2.imwrite('C:/data/' + images ,inverted2) time.sleep(3) old = new
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)