Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you don't have an image, all you have there is the name of an image. what's missing is:

image = cv.imread(img)  # you have to read it from disc first !

if (image == None): 
      print(img, "could not be read!")
cv.imshow("img", img)
cv.waitKey()

you don't have an image, all you have there is the name of an image. what's missing is:

image = cv.imread(img) cv.imread(imgpath)  # you have to read it from disc first !

if (image == None): 
      print(img, print(imgpath, "could not be read!")
cv.imshow("img", img)
cv.imshow("image", image)
cv.waitKey()

you don't have an image, all you have there is the name of an image. what's missing is:

image = cv.imread(imgpath)  # you have to read it from disc first !

if (image == None): 
      print(imgpath, "could not be read!")
      return # can't go on with an invalid image
cv.imshow("image", image)
cv.waitKey()