Hi everyone, I’m trying to view my Arducam camera in real time with OpenCV on a Raspberry Pi 4B, but the image comes out wrong / I can’t actually see anything. It’s an Arducam Camera OV5467 (I believe the sensor is the OV5647). I already set camera_auto_detect=0 and dtoverlay=ov5467 in /boot/config.txt, but my OpenCV script still doesn’t show a correct frame. It doesn’t give me any error output either, just a bad/black image. Could I be missing some required packages or another config step?
Before we dig into the OpenCV side, let’s first confirm the camera itself is detected and working on the libcamera stack. Can you try running: libcamera-still -t 0 and tell me whether you get a proper preview? That helps separate a camera/driver problem from an OpenCV problem. Also, here’s an OpenCV example demo for reference: picamera2_examples/CaptureOpencvExample.py at main · ArduCAM/picamera2_examples · GitHub
Okay, so I disabled the legacy camera in raspi-config (Interface Options → Legacy Camera → Disabled), and after that libcamera-still -t 0 actually shows the camera feed now. The example demo you linked also works. But my own simple Python script that only uses OpenCV (just cv2.VideoCapture) still fails and the output image is not correct. Does this camera require the picamera2 library in addition to OpenCV?
That’s exactly the issue. OpenCV on its own cannot directly get image data from MIPI camera modules on the Raspberry Pi. It doesn’t talk to the libcamera stack, so an OpenCV-only script will keep giving you a wrong/black image no matter how the config is set. You need to capture the camera data with the picamera2 library, then pass those captured frames to OpenCV for processing and display. That’s the pattern the example demo uses.
Ah I see, so picamera2 handles the capture and OpenCV is only for processing the frames. That makes sense now. Yes thank you very much!