python - Brand new to scipy/numpy and attempting some batch manipulation -
python - Brand new to scipy/numpy and attempting some batch manipulation - so, have bunch of scanned images annoying white around them want remove. i'm prepping algorithm using numpy arrays find closest pixel row , columns of finish white, cropping them positions. code: from scipy import misc import os import datetime a0 = datetime.datetime.now() print("imported @ " + str(a0)) def run(): inputdir = '/users/nicholasezyk/documents/funeralhomescans' os.chdir(inputdir) #batch image renaming counter = 1 file in os.listdir(inputdir): if file.endswith('.jpg'): img = misc.imread(file) print(file + ' beingness analyzed.') cropx = -1 cropy = -1 lx = img.shape[0] ly = img.shape[1] countx = 0 county = 0 while countx < lx: pix = img[countx, 0] if pix == (255, 255, 255): ...