I am trying to process multiple images in a directory by providing a with statement and a text file listing the file paths for the files I want processed (processing includes grayscaling shown and some de-noising and pixel intensity measures). With the code shown below the program correctly processes the first file on the list but then ends before processing the other files. Does anyone know why and how I can make it iterate through all files listed?
#establish loop
with open('file_list.txt') as inf:
for line in inf:
path = line
# grayscale and plot
original = io.imread(path, plugin = 'pil')
grayscale = rgb2gray(original)