Skip to content

Instantly share code, notes, and snippets.

@twiddles
Created May 25, 2017 11:57
Show Gist options
  • Save twiddles/4f619c7f640fa6775c721b853a86662f to your computer and use it in GitHub Desktop.
Save twiddles/4f619c7f640fa6775c721b853a86662f to your computer and use it in GitHub Desktop.
for source in SOURCES:
print('Processing:', source)
try:
img = io.imread(source)
img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
filename = os.path.basename(source)
cv2.imwrite('processed_' + filename, img)
except Exception as e:
print('Skipping', source, 'because of', e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment