# OpenCV for CSI Raspberry Pi Camera

**URL:** <https://forum.opencv.org/t/opencv-for-csi-raspberry-pi-camera/12541>\
**Category:** Python\
**Tags:** raspberrypi, videoio\
**Created:** [March 27, 2023, 3:02am UTC](https://forum.opencv.org/t/opencv-for-csi-raspberry-pi-camera/12541 "2023-03-27T03:02:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waikeat23](https://avatars.discourse-cdn.com/v4/letter/w/b9e5f3/32.png) [@waikeat23](https://forum.opencv.org/u/waikeat23)\
**Post date:** [March 27, 2023, 3:02am UTC](https://forum.opencv.org/t/opencv-for-csi-raspberry-pi-camera/12541/1 "2023-03-27T03:02:26Z")

</div>

Hi, I am trying to use OpenCV to capture image using raspberry pi v2 CSI camera in raspberry pi os bullseye. I am using OpenCV v4.7

I noticed that OpenCV only able to open CSI camera when CSI camera detected under **mmal** which returned by v4l2-ctl --list-devices but now camera detected under **unicam**

In certain circumstance, I must load camera overlays IMX219 which cause CSI camera to be detected under **unicam** returned by v4l2-ctl --list-devices.

I can use my camera normally using Picamera library, but not in OpenCV.

cap.isOpened() returned me true, but no frame was captured from csi camera using openCV.

Any ideas?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 27, 2023, 8:37am UTC](https://forum.opencv.org/t/opencv-for-csi-raspberry-pi-camera/12541/2 "2023-03-27T08:37:05Z")

</div>

Nobody so far has bothered to implement this “unicam” interface in OpenCV.

You could be the first?

Examine the “picamera” library and see what’s needed to build a “Video I/O” backend for OpenCV from that.

or you could just use that library, instead of OpenCV’s VideoCapture.
