Created
March 24, 2017 11:27
-
-
Save satour/dca61786a09025f3b345da6ebb0cf038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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