I’m happy using my two raspberry pi cameras in my jetson nano but I needed to install a USB camera in order to move it with a servo. (1)
The servo part works so I bought a USB HD 1080 camera … but it is too slow and it doesn’t seem to accept resizing without crashing.
I tried:
cam.cv2.VideoCapture(2)
cam.set(3,640)
cam.set(4,480)
ret, frame=cam.read()
but I crashes when I do
cv2.imshow(‘camera’,frame)
with this message:
cv2.error: OPENCV(4.1.1) /home/nvidia/host/build/opencv/nv_opencv/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’
If I don’t resize it works… but so painfully slow (about a frame a second) that is of no use.
The camera works fine in a windows computer runing the same .py I used on the jetson nano (without the servo part, of course).
Any Ideas?
BTW: I have my two pi cameras connected, but I’m not using them.
BTW2: It works fine in the cheese app and allows resize to 640x480… but with CV2 I don’t seem to be able to do so…
BTW3: I tried the .py with the
cam.set(3,640)
cam.set(4,480)
on windows and it works with no crashes o warnings.
(1) https://www.amazon.es/gp/product/B07Y1P5P8J?ref=ppx_pt2_dt_b_prod_image