Created
December 8, 2020 11:50
-
-
Save kerenskybr/06e25fb0518d3d7d7012c68dc961e730 to your computer and use it in GitHub Desktop.
Load images from a directory using opencv
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
def load_images_from_folder(folder): | |
images = [] | |
for filename in os.listdir(folder): | |
img = cv2.imread(os.path.join(folder,filename)) | |
if img is not None: | |
images.append(img) | |
return images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment