Ask Your Question
0

How to get the multiple images as a loop

asked 2015-10-27 08:24:27 -0600

tgs gravatar image

updated 2015-10-27 23:52:57 -0600

berak gravatar image

Hello, i want to read multiple images which are saved in my working folder using imread function. can i use for loop or while loop to do that. i m using opencv with python.

edit retag flag offensive close merge delete

Comments

1

i think if you tried to search about your question you could find http://answers.opencv.org/question/69712

sturkmen gravatar imagesturkmen ( 2015-10-27 08:44:14 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-10-27 23:56:08 -0600

berak gravatar image

there is a glob in python, too:

from glob import glob

img_mask = 'mydir/*.jpg'
img_names = glob(img_mask)
for fn in img_names:
    print('processing %s...' % fn,)
    img = cv2.imread(fn, 0)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-10-27 08:24:27 -0600

Seen: 15,016 times

Last updated: Oct 27 '15