Last active
July 14, 2016 07:44
-
-
Save Hironsan/ec97cad4e89802f74abe097d6e3ff34b 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 | |
def read_image(file_path): | |
# cv2.read(file_path, 1) # grayscale | |
pass | |
def traverse_dir(path): | |
for file_or_dir in os.listdir(path): | |
abs_path = os.path.abspath(os.path.join(path, file_or_dir)) | |
if os.path.isdir(abs_path): # dir | |
traverse_dir(abs_path) | |
else: # file | |
if abs_path.endswith('pgm'): | |
read_image(abs_path) | |
if __name__ == '__main__': | |
traverse_dir("./CroppedYale") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment