I am using USB cameras with Jetson Xavier AGX. To keep the application simple, I want to read images from two USB cameras and store them in separate directories. But I am facing the below issues:
When I plug in two USB cameras to Jetson and run /ls/dev/video* → it shows there are 4 devices connected.
This is not right whereas I connected only two. How to resolve this?
I am using python and cv2 to read the images like below:
cap = cv2. VideoCapture(0)
cap2 = cv2. VideoCapture(1)
#My code to save to the directory.
But I get an error “cannot open the camera by index” Not sure what’s going wrong! I unplug the device and repeat, and in one of many attempts, it’s reading fine else the same error repeats.
- When i faced the above error, I had to manually unplug and re-plug. Is there any other way I can do that? I do not want to unplug and replug everytime as my camera’s connectivity is fragile.
It would be helpful to get some guidance.