Quantcast
Channel: How to read in a directory of images with OpenCV - Stack Overflow
Browsing index pages (2 articles)

How to read in a directory of images with OpenCV

I'm trying to read this directory of jpg images and add them to a list but the list is empty when I run this code: import glob import cv2 cv_img = [] for img in glob.glob("E:/project/file/*.jpg"): n=...

View Article


Answer by nathancy for How to read in a directory of images with OpenCV

You can use a list comprehension to read each image into a list. Also ensure that the relative path you're passing in to glob exists otherwise the list may be empty import cv2 import glob images =...

View Article

Browsing index pages (2 articles)


Latest Images