I am trying trying to display webcam footage using openCV on Ubuntu but i am getting the following error:
Error: BadDrawable (invalid Pixmap or Window parameter) 9Major opcode: 62 (X_CopyArea)Resource id: 0x3800056]
Here is my full code
import cv2
cap = cv2.VideoCapture(1)
cap.set(3,320)
cap.set(4,240)
while(1):
_, frame = cap.read()
cv2.imshow('frame',frame)
k = cv2.waitKey(5) & 0xFF
if k == 27:
break
cap.release()
cv2.destroyAllWindows()
I have tried googling the error and it seems to be GUI related. I have also read the docs on imshow and I seem to be calling it fine, can anyone figure out why I am getting this error.
Thanks
cv2.VideoCapture(0).