Taking stereoscopic images on a Raspberry Pi 5 running Ubuntu

The Raspberry Pi 5 comes with two camera ports, so we can control both cameras using picamera2 without syncing two different Raspberry Pis. I made a (makeshift) stereoscopic camera rig using a Raspberry Pi 5 running Ubuntu 25.04 Plucky Puffin and two V2 camera modules.

Making a mount

We can look at the camera module’s mechanical drawing for this.

Along the vertical axis, the distance between the centres of the holes of the module is 21 mm. The average interocular distance (distance between the eyes) is around 63 mm (Source1 and Source2)

I made the following 3D models to use as the camera mount.

Plank body

Plank pegs

The prongs on the plank are 21 mm apart, so a V2 camera module can be attached to them. The pegs are used to secure them from coming off the plank.
To have the separation of 63 mm, we will attach the modules with two empty spaces between them, which will look like this:

Tripod attachment

Download links for STL files: Plank body and clamps.

Controlling cameras using Picamera2

Connect the camera modules to a Raspberry Pi 5 running Ubuntu 25.04 Plucky Puffin, then follow the Ubuntu Boards documentation for steps to install picamera2.
I have a very basic script that does the bare minimum to generate a side-by-side image

Setting up the scene

I am using the V2 camera modules, so I manually adjusted the focus for the subject. I used a Rubik’s cube, a lego model and some model cars as the subjects for images, placed around 1.5 feet from the camera assembly

Camera rig

Results

Now all we have to do is to run the script to capture these images. You can view them using the cross-eyed method (which frankly never works for me; maybe I am doing it wrong), or use a VR headset (Google Cardboard or any Oculus or SteamVR). I used an Oculus Go to view these images.
You can also edit the script to make a stacked image instead of a side-by-side (incase that’s what your viewing software expects)

Cube and Minecraft

Cars

3 Likes