OAK-D camera: can’t open camera by index

i try to work with oak-d camera of ai-kit. I want to use this to create depth maps, pose estimation exc.
when I try to use it with the videocapture it gives me this error:
[ WARN:0] global /tmp/pip-req-build-s58vuwxh/opencv/modules/videoio/src/cap_v4l.cpp (890) open VIDEOIO(V4L2:/dev/video0): can’t open camera by index
can someone help me ??

what did you install there, exactly ?

where is your code running, on the device ?
are you trying to access the camera on some pc, via usb ?

this is my code:


I just tried to run this script that takes pictures from the right and left cameras.

please, no screenshots of code anywhere on the internet, replace with TEXT, thank you

can you answer my questions ?

the code is on my computer, to which the camera is connected via usb.
I have not installed any dependencies or packages, except opencv

1 Like

hmm, the hello world example

OK thank you.
but I wanted to use “videocapture”, since the camera is “initialized” in a different way and because I’m doing a project and I need to reuse parts of code present in these scripts (GitHub - niconielsen32/ComputerVision), such as calibration, pose estimation …

did you check, if the depthai examples work for you ?
do you see any devices in /dev/video ?

no, in / dev / video I don’t see any devices but the depthai code examples work.

1 Like

that’s probably, why VideoCapture does not work
there was something in the “troubleshooting” section in their docs

at least ! good to hear.

yes at least with depthai I can interact with the room …
so i better focus on depthai and drop VideoCapture?

I wanted to write camera instead of room…

from docs

DepthAI does not show up under /dev/video* like web cameras do. Why?

The USB device enumeration could be checked with lsusb | grep 03e7 . It should print:

  • 03e7:2485 after reset (boot loader running)
  • 03e7:f63b after the application was loaded

No /dev/video* nodes are created.

DepthAI implements the VSC (Vendor Specific Class) protocol and libusb is used for communication.