I want to read multiple images on a same folder using opencv (python). To do that do I need to use for loop or while loop with imread func
for
while
imread
import cv2 from pathlib import Path path=Path(".") path=path.glob("*.jpg") images=[]` for imagepath in path.glob("*.jpg"): img=cv2.imread(str(imagepath)) img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) img=cv2.resize(img,(200,200)) images.append(img) print(images)