Skip to content

Instantly share code, notes, and snippets.

@satour
Created March 24, 2017 11:27
Show Gist options
  • Save satour/dca61786a09025f3b345da6ebb0cf038 to your computer and use it in GitHub Desktop.
Save satour/dca61786a09025f3b345da6ebb0cf038 to your computer and use it in GitHub Desktop.
import os
import cv2
pwd = os.getcwd()
ls = os.listdir(pwd)
png_files = filter (lambda n:n[-3:]=="png", ls)
for png in png_files:
grey = cv2.imread(png, 0)
cv2.imwrite("gray_scale_" + png, grey)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment