I recently installed opencv ans tried to run a simple process some of the commands won't read such as
cv2.imshow() or cv2.imread () along with the waitkey() everything else works fine but a few necessary likes of code. Is it that i dont have have depencies for them or is it something else?
import numpy as np Import cv2 cap = cv2.VideoCapture(0) while(True) #Capture frame-by-frame ret, frame = cap.read() out.write(frame) #Display the resulting frame cv2.imshow('frame', frame) if cv2.waitkey(20) & 0xFF == ord('q'): break # When everything done, release the capture cap.release() out.write() cv2.destroyAllWindows()```
Errors i get
Traceback (most recent call last): File "/home/pi/test.py", line 9 in <module> out.write(frame) NameError: 'out' is not defined Cv2.imshow() Cv2.error: OpenCV(3.4.4) /home/pi/packaging/opencv-python/opencv/modules/highgui/src/window.cpp:356: error: (-215: assertion failed) size.width>0 && size.height>0 in function 'imshow'```