OpenCV for CSI Raspberry Pi Camera

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?

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.