0

I'm not able to read the image

import cv2
img = cv2.imread('instra.jpg')
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()


import cv2
img = cv2.imread('instra.jpg')
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()

cv2.imshow('image',img)

cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

help-ukraine-now
  • 3,850
  • 4
  • 19
  • 36

1 Answers1

0

It seems that you are unable to load the image. Check if your image exist in current directory and see this post: cv2.imread: checking if image is being read to check if your image is loaded.

Piotr Siekański
  • 1,665
  • 8
  • 14