I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in opencv
Thanks guys, I figured it out, I was supposed to add a try/exception so my code could bypass "ugly" images:
try:
path=os.path.join(mypath,n)
img=cv2.imread(path, cv2.IMREAD_GRAYSCALE)
img=cv2.resize(img, (img_rows,img_cols))
except Exception as e:
print(str(e))
cv2.resize() was where it was supposed to caught the error since it can't resize a "broken" image.
Just enter precise image format. .jpg instead of .jpeg