Error in reading and displaying image in open cv. [closed]
here is the code:
import numpy as np
import cv2
img = cv2.imread('/home/Pi/Exp/result.jpg',0)
cv2.imshow('gghhss',img)
cv2.waitkey(0)
cv2.destroyAllWindows()
And the error:
Traceback (most recent call last):
File "/home/pi/Exp/opcv.py", line 5, in <module>
cv2.imshow('gghhss',img)
error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/highgui/src/window.cpp:269: error: (-215) size.width>0 && size.height>0 in function imshow
This is from opencv tutorial here in the read image.
Thanks :) P.S. I did google and did not find anything. Please donot downvote,
duplicate of your other question
It not duplicate i did add the directory the cv2.imshow('gghhs',img) is just the name the window will have will displaying img
you obviously did not learn the previous lesson ..
Your previous lesson was about declaring the directory. Well i have mentioned it. Whats the problem? Also how can it be a duplicate the errors are totally different (when looked up i don't know what they actually mean)?
no, it was about checking, if the image loaded, before proceeding.
If it did not load i would have gotten an error like 'NoneType' etc.. but the error is some funky stuff.