Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you probably still have to "read" an image somehow, but you can batch-process them like this:

from glob import glob
for fn in glob('*.png'):
     im = cv2.imread(fn)
     #
     # your processing here.

if your images are numbered, like im00004.png you can even abuse the VideoCapture:

cap = cv2.VideoCapture("im%05d.png") #like a printf pattern, leading zeros are important !
while cap.isOpened():
     ret,img = cap.read()
     #
     # your processing here