imread return None even though the image exists in the given path

300 Views Asked by At
images = glob.glob('../catkin_ws/src/project1/images/*.jpg')
print(images)

When I print the variable images I get all the image file like this in an array.

['../catkin_ws/src/project1/images/img1.jpg', '../catkin_ws/src/project1/images/img2.jpg', '../catkin_ws/src/project1/images/img3.jpg']

But when I try to load the images using cv2.imread it returns None.

for fname in images:
    img = cv2.imread(fname) 
    print(img) #gets None
0

There are 0 best solutions below