I am writing a simple program that reads and does some operations with a series of images. One of the input images has some faults (I think it's the result of disconnecting thumb drive during data transfer).
So the only statement involving the input image that does not cause the program to freeze is cv2.imread()
. The moment my program reaches any statement that involves the input, it freezes. I tried putting these statements in try-catch
blocks (so that error is thrown and this image is skipped) but nothing changes. Is there anything I can do to make my program see the error in the input then ignore it and go to the next image instead of freezing?