import cv2 import numpy import os import glob import ntpath from backSub import * from ConfigParser import SafeConfigParser filepath = "./tl3Pictures/" # where the input files are pathRGB = ".diff/" # where the result is saved extension = "*.jpg" # only jpg files considered batchCount = 0 backSubInstance = backSub() if not os.path.exists(filepath + pathRGB): os.makedirs(filepath+pathRGB) #create the result folder if it # is not there backSubInstance.setConfig('sample.cfg') # load the backSub parameters # from the configuration file for filename in glob.glob(filepath + extension): #print(filename) #full file name and path pathAndFile = os.path.splitext(filename)[0] #print(pathAndFile) #file name and path without extension latestFilename = ntpath.basename(pathAndFile) #print(latestFilename) #only file name
import cv2 import cv2.cv as cv import numpy as np import os import glob import ntpath from backSub import * from ConfigParser import SafeConfigParser filepath = "./inoffice/" pathBGR = "./diff/" #filepath = "./smallOffice/" #pathBGR = "./diffBGR/" extension = "*.jpg" batchCount = 0 back_sub = backSub() #roiMask = cv2.imread("./inoffice/" + "officeMask.jpg", cv2.CV_LOAD_IMAGE_COLOR) #back_sub.ROI = roiMask if not os.path.exists(filepath + pathBGR): os.makedirs(filepath + pathBGR) back_sub.setConfig('sample.cfg') for filename in glob.glob(filepath+extension): PathAndFile = os.path.splitext(filename)[0] latestFilename = ntpath.basename(PathAndFile) image = cv2.imread(filepath + latestFilename + ".jpg", cv2.CV_LOAD_IMAGE_COLOR) print(latestFilename)
import cv2 import cv2.cv as cv import numpy as np import os import glob import ntpath from backSub import * from ConfigParser import SafeConfigParser filepath = "./inoffice/" pathBGR = "./diff/" #filepath = "./smallOffice/" #pathBGR = "./diffBGR/" extension = "*.jpg" batchCount = 0 back_sub = backSub() #roiMask = cv2.imread("./inoffice/" + "officeMask.jpg", cv2.CV_LOAD_IMAGE_COLOR) #back_sub.ROI = roiMask if not os.path.exists(filepath + pathBGR): os.makedirs(filepath + pathBGR) back_sub.setConfig('sample.cfg') for filename in glob.glob(filepath + extension): PathAndFile = os.path.splitext(filename)[0] latestFilename = ntpath.basename(PathAndFile) image = cv2.imread(filepath + latestFilename + ".jpg", cv2.CV_LOAD_IMAGE_COLOR)