I have a dataset and I want to delete all unreadable images. I tired to delete all unreadable images using python code given below, but interestingly I found that, when ran the code using opencv-3.0.0 it is able to read it. But when I tried to read same image using opencv-2.4.10 it returns 'None'. Here is the code I used:
Using opencv-3.0.0:
if cv2.imread(path_to_image) == None:
os.remove(path_to_image)
Image is not removed
Using opencv-2.4.10:
if cv2.imread(path_to_image) == None:
os.remove(path_to_image)
Image is removed
Here the one image that is unreadable. Can anyone say why is this happening?