I want to open multiple images in a loop. I have named the images number wise(1,2,3...) and want to open that image through code. This is what i tried
for i in range(1,10):
img=cv2.imread('i.jpg')
I want to open multiple images in a loop. I have named the images number wise(1,2,3...) and want to open that image through code. This is what i tried
for i in range(1,10):
img=cv2.imread('i.jpg')
You need the i
to be a string. So casting to string
will solve it.
like this:
import cv2
for i in range(1,10):
img = cv2.imread(str(i)+'.jpg')