# How to access cameras with opencv

Source: https://forum.modalai.com/topic/1033/how-to-access-cameras-with-opencv
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Tags: opencv, voxl2, help
Posted: 2022-06-17 17:38:48 UTC by mawriyo
Replies: 1 · Views: 1723

## mawriyo · 2022-06-17 17:38:48 UTC

I have a basic script to try and access a camera. I tried using opencvs cv2.VideoCapture() but have tried the devices i see on ls /dev. I get /dev/video0, /dev/video1, /dev/video32,  /dev/video33. I also tried to use gstreamer to access these cameras to no result.

 I installed a v4l2-utils to see my devices to which returns when I use '''vl2-ctl  --list-devices''' which returns 

"msm_vidc_vdec ():
	/dev/video32
	/dev/video33
	/dev/v4l-subdev2
	/dev/v4l-subdev3
	/dev/v4l-subdev4
	/dev/v4l-subdev5
	/dev/v4l-subdev6
	/dev/v4l-subdev7"

Any idea how I can use the cameras that come with the kit to be used in basic CV programming?

## Reply by Chad Sweet (ModalAI staff) · 2022-06-17 17:45:38 UTC

Please see the documentation for voxl-camera-server here: https://docs.modalai.com/voxl-camera-server/

There are many examples in our SDK code base of how to consume that data. Here is a good place to look for each of our services: https://gitlab.com/voxl-public/voxl-sdk/services

Here is some exact code here: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-qvio-server/-/blob/master/server/main.cpp#L474

And another example here: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-tflite-server/-/blob/master/src/main.cpp#L208
