Hi everyone. I’m using an Arducam 8MP IMX219DS PTZ camera on a Raspberry Pi 4. The preview image looks fine in the center, but the edges and corners have a red cast. It also behaves intermittently — sometimes it initializes, sometimes it’s unstable. One more thing: can this camera be used with the Python picamera library on Raspberry Pi OS Buster?
Welcome! The red tint around the edges is usually a lens shading / ISP tuning symptom rather than a hardware failure, but let’s narrow it down. Can you share the exact setup — Pi model, OS version, and which camera module (model number if possible)? That’ll help a lot.
Sure. It’s a Raspberry Pi 4B running Raspberry Pi OS Buster. The camera is the Arducam 8MP IMX219DS PTZ, model B01678MP. I followed the tutorial on the Arducam site and can pan/tilt with their sample program, so the basics work. While searching for this red-edge problem, I read that there’s an ISP/lens shading file used to tune the camera. I got one named imx219_45d.json — where should I place it?
Good, that matches what I suspected. For a libcamera setup the lens shading JSON normally goes in the camera tuning directory (like /usr/share/libcamera/ipa/raspberrypi/), and the camera needs to pick it up. Put imx219_45d.json there and rerun your focuser example, then let me know if the red edges change. I’m still checking your Buster question — I’ll get back to you on that.
Okay, I placed imx219_45d.json and reran the example. The red edges came right back as soon as the preview opened. Here’s exactly what I ran:
cd PTZ-Camera-Controller
python3 FocuserExample.py
No improvement.
Thanks for the exact commands. That pretty much confirms it — the red around the edges is a lens shading configuration mismatch. The JSON file has to match the actual lens on your module; a generic or wrong file will produce exactly that reddish tint around the frame. About your other question: this camera is not supported on Raspberry Pi OS Buster, so the picamera route on Buster won’t work.
I see. So is there a known-good lens shading file for this exact module, or do I have to tune it myself?
The root cause is that the lens shading config doesn’t match your lens. I’ve sent you a lens shading JSON file via private message — please grab it from your messages and try it. If it’s still not suitable for your lens, check the alternative files here: https://www.arducam.com/lens-shading-json-file/. You can also tune it yourself with the libcamera calibration tool — the steps are documented here: Lens Shading Calibration - Arducam Wiki. To sum up: the red edges are fixed by using a matching lens shading JSON (either the one I PM’d you or a tuned one), and this IMX219DS PTZ camera is not supported on Raspberry Pi OS Buster.