0
votes

i am new to opencv and am trying to simply display an image, however with every cv2 function I get the same error, (AttributeError)

I have already installed pip install opencv-contrib-python witch was suggested to fix this problem but changed nothing,

import cv2
img = cv2.imread ("C:\\Users\\Astroid\\Desktop\\desktop backround pics\\560736.jpg", 1)
print(img)
cv2.imshow("560736",img)
cv2.WaitKey(2000)
cv2.DestroyAllWindows()

full error is.

Traceback (most recent call last): File "C:/Users/Astroid/.PyCharmCE2019.1/config/scratches/scratch.py", line 6, in cv2.WaitKey(20000) AttributeError: module 'cv2.cv2' has no attribute 'WaitKey'

1

1 Answers

0
votes

Use lowercase for the method: [docs]

retval = cv.waitKey([, delay])