1 | initial version |
it is pretty simple.
to the dismay of most python noobs, cv2.imread()
does NOT throw an exception on failure, it's your resposibility to check the outcome similar to:
if img == None: # older numpy / py2
# fail !!
or:
if np.shape(img) == (): # latest numpy / py3
# fail !!
if you don't, your NEXT line of code will fail (because you supplied invalid input), to ultimate confusion of anyone ...
2 | No.2 Revision |
it is pretty simple.
to the dismay of most python noobs, cv2.imread()
does NOT throw an exception on failure,
it's your resposibility to check the outcome similar to:
if img == None: # older numpy / py2
# fail !!
or:
if np.shape(img) == (): # latest numpy / py3
# fail !!
if you don't, your NEXT line of code will fail (because you supplied invalid input), to ultimate confusion of anyone ...
3 | No.3 Revision |
it is pretty simple.
to the dismay of most python noobs, cv2.imread()
does NOT throw an exception on failure,
it's your resposibility to check the outcome similar to:
if img == None: # older numpy / py2
# fail !!
or:
if np.shape(img) == (): # latest numpy / py3
# fail !!
if you don't, your NEXT line of code will fail (because you supplied invalid input), to ultimate confusion of anyone ...
ps: the code path in the error msg points to the location, where it was built (svark's box in the case of pypi), not your one.
4 | No.4 Revision |
it is pretty simple.
to the dismay of most python noobs, cv2.imread()
does NOT throw an exception on failure,
it's your resposibility to check the outcome similar to:
if img == None: # older numpy / py2
# fail !!
or:
if np.shape(img) == (): # latest numpy / py3
# fail !!
if you don't, your NEXT line of code will fail (because you supplied invalid input), to ultimate confusion of anyone ...
ps: the code path in the error msg points to the location, location (in the underlyingc++ code), where it was built (svark's box in the case of pypi), not your one.
5 | No.5 Revision |
it is pretty simple.
to the dismay of most python noobs, cv2.imread()
does NOT throw an exception on failure,
it's your resposibility to check the outcome similar to:
img = cv2.imread("butterfly,jpg",1 )
if img == None: # older numpy / py2
# fail !!
or:
if np.shape(img) == (): # latest numpy / py3
# fail !!
if you don't, your NEXT line of code will fail (because you supplied invalid input), to ultimate confusion of anyone ...
ps: the code path in the error msg points to the location (in the underlyingc++ code), where it was built (svark's box in the case of pypi), not your one.