Hello, i try to connect my usb camera to the jetbot but i dont succeed.
I would like to see the display on jupyter exactly like i see it on the linux jetbot user itself.
i run this simple code (i added in the end) that works perfectly on my main usr (jetbot)
when i try to run it via root (jupyter) i get this warning:
gtk-WARNING ** 15:29:17.674: cannot open display
and the camera lamp itself is on ON for 1 sec and then OFF.
This is my code:- works good on jetbot, doesnt work on jupyter
ill be happy if you can help me to get it to work on jupyter
thanks a lot, yoni
#code for activating usb camera
import cv2
dispWusb=640#res x usb cam
dispHusb=480#res y usb cam
cam=cv2.VideoCapture(1)# 0=>go to the first camera
cam.set(3,dispWusb)
cam.set(4,dispHusb)
while True:
ret, frame=cam.read()
cv2.imshow(‘piCam’,frame)
cv2.moveWindow(‘piCam’,0,0)
if cv2.waitKey(1)==ord(‘q’):# 1ms for see if key is pressed and if its q
break
cam.release()
cv2.destroyAllWindows