Imshow doesn't work in Jupyter and PyCharm [closed]
Hello,
I want to use Imshow in Jupyter Notebook (PyCharm just for checking if it is a Jupyter specific problem, but I get the same result there).
When I type in
img1 = cv2.imread(r"savefig/plotXBIC_singlecell/01.png")
cv2.imshow("image",img1)
cv2.waitKey(0)
cv2.destroyAllWindows()
I get the error message:
OpenCV(4.2.0) /io/opencv/modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
And when I do this:
gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
I get the error message:
OpenCV(4.2.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
EDIT: I checked with path.exists() if the path exists and yes, it does (both the relative and absolute one). And in both cases, with the same path (relative/absolute) I get a None when I type in print(cv2.imread(r"savefig/..../01.png))
Can you help me, please? :)
downvoted for: we have answered this question here like 5000 times before, you did no research at all
I did, but the path does exist. And I couldn't find anything about the contradiction between the True from path.exists() and the None from print(imread())..
Here is link jupyter
I already read that article. It doesn't pertain to my problem. :/