Barrel distortion and single combined video file from Arducam stereo camera on Pi 5

Hi everyone, I’m running into a couple of issues with my Arducam stereo setup and hoping someone can point me in the right direction.

Hardware:

  • Raspberry Pi 5 running Bookworm OS
  • Arducam 12MP*2 Synchronized Stereo Camera Bundle Kit (UC-512 board / Camarray Stereo Camera HAT + two IMX477 12.3MP modules with CS lenses)

What I’m trying to do: track rodent movement inside a single cage. The cameras are mounted above looking down.

The problems:

  1. There’s really noticeable barrel distortion in the images — it’s bad enough that I don’t think any tracking software will work reliably with it. This happens with both single-camera and dual-camera modes. I’ve attached screenshots below.

  2. The output is always a single combined video file with both camera streams packed together. I actually need separate video files — one per camera.

  3. The documentation I’ve been able to find seems either missing or outdated. Is there an up-to-date resource I should be looking at?

Also a few hardware questions while I’m here:

  • The UC-512 board has two extra connection slots beyond the two I’m using — are those actually functional? Could I run four cameras off this same HAT?
  • Can I use official Raspberry Pi Camera Module V3s with this HAT and have them work the same way as the bundled cameras?
  • Would changing the lenses help with the barrel distortion?

Here’s the connection setup:

image.png

Single camera — you can see the distortion pretty clearly:

image.png

Both cameras — same distortion on both streams:

image.png

Appreciate any help!

Thanks for the detailed post and the screenshots — that helps a lot. Let me break down what’s going on with each issue because they all have different root causes.

Camera incompatibility with V3 modules

The cameras included in your Stereo Bundle have had their crystal oscillators (clocks) physically removed. This is by design — the HAT needs to take over clocking duties to keep both sensors perfectly synchronized. Standard off-the-shelf Raspberry Pi Camera Module V3s still have their independent oscillators onboard, which means they simply won’t work with this synchronization HAT. So unfortunately, no, you can’t mix in V3 modules here.

Barrel distortion

This is coming from the lenses. Your bundle ships with 6mm focal length wide-angle CS-mount lenses. At that focal length, barrel distortion is pretty much inherent — the wider the lens, the more pronounced it gets. The good news is the cameras use standard CS-mount, so the lenses can be physically unscrewed and swapped out.

Single combined video file

This one’s a hardware limitation — the HAT physically merges both camera streams into a single signal before it ever reaches the Raspberry Pi. So at the hardware level, it’s one combined frame arriving at the Pi. Separate simultaneous streams aren’t possible with this HAT. However, you can use Single Channel Mode (Switch Mode) to view one camera at a time at full resolution (4056×3040).

Four cameras + the extra slots on UC-512

For a 4-camera synchronized setup, you’d actually want the dedicated Quad-Camera Kit which comes with the correct HAT and properly modified cameras (all with oscillators removed for sync). That kit uses IMX708 sensors. You can find it here:

Let me know if you want to go down the Single Channel Mode or lens replacement path and I can walk you through those.

That makes a lot of sense — I had no idea the oscillators were physically removed on these. Explains why they’re sold as a matched bundle.

Okay, so it sounds like I have two paths forward with my current hardware:

  1. For the separate video files — can you walk me through how to switch into Single Channel Mode? I’m fine with not having both streams simultaneously as long as I can capture each one at full resolution.

  2. For the barrel distortion — what focal length would you recommend for a flatter image? The cage isn’t huge so I don’t need a super wide field of view anyway. And is it literally just unscrew-and-replace, or is there anything else I need to watch out for when swapping CS-mount lenses?

Also noted on the Quad-Camera Kit — that’s good to know if I ever expand the setup. Thanks!

Glad that cleared things up. Here’s the walkthrough:

Single Channel Mode (Switch Mode)

This lets you address one camera at a time at the full 4056×3040 resolution. The configuration is done on the HAT itself. The full instructions are in the docs here:

https://docs.arducam.com/Raspberry-Pi-Camera/Multi-Camera-CamArray/quick-start/#switch-composition-mode

Essentially you’re toggling the HAT’s composition mode so instead of merging both feeds into one frame, it passes through a single camera’s stream. You won’t get both at once, but you can switch between them and capture each independently at full resolution.

Lens replacement

For your use case (looking down at a single cage, rodent tracking), I’d recommend going with a 12mm or 16mm CS-mount lens. At those longer focal lengths, barrel distortion drops off significantly and you’ll get a much flatter image that tracking software can work with.

And yes, it really is just unscrew-and-replace. The IMX477 modules have standard CS-mount threads — you physically rotate the current lens counter-clockwise to remove it, then thread the new one in. Just be careful not to touch the sensor while the lens is off, and avoid getting dust inside. No firmware changes or recalibration needed.

Quick summary for anyone finding this thread later:

  • The synchronization HAT requires modified cameras with removed crystal oscillators. Standard Raspberry Pi camera modules won’t work with it.
  • Barrel distortion is from the included 6mm wide-angle lenses — swap to 12mm or 16mm CS-mount lenses for a flatter image.
  • Separate simultaneous streams aren’t possible at the hardware level. Single Channel Mode gets you full-res capture from one camera at a time.
  • For true 4-camera sync, look at the Quad-Camera Kit built for that purpose.

Let us know how the lens swap and Single Channel Mode work out!