I have been experimenting with some cheap ESP32 cameras for various projects. At some point I wondered if it was possible to achieve a stereoscopic vision with two cameras side by side.
Setting up the cameras
The mounts has the camera on a flexure that allows vertical adjustment. A small eccentric arm pushes on the bottom of the frame to adjust elevation angle;
Displaying the stereoscopic image
I had some of these early VR goggles, the kind where you can put your phone inside.
I made a basic HTML page that would show two images side by side. This page would load on the phones browser and go into full screen mode.
An Arduino program that would run on both ESP cams. A variable in the code would make the camera take the role of either the left or right eye. The left eye would start a wireless access point that both the right eye and the phone would connect to. The left eye also started a small webserver that launched the viewer webpage via. a captive portal. Once launched the webpage connected to each camera via. a WebSocket interface to receive the video streams.
Considering that this was a crude prototype I was pretty surprised by the result. It is totally possible to make wireless stereo vision with in this simple setup. When both cameras are connected and adjusted correctly you have a real sense of depth and the images blends seamlessly in the goggles.
The framerate is not great and it can be somewhat disorientating if one of the cameras lags for a few frames. I had to make some compromises between the framerate and image resolution but I feel I found a good combination.
The WIFI range of the ESP cams are notoriously bad. Something seems to be wrong with the antennas. I have measured the RF output compared to other ESP32 modules and they seem to be outputting only of fraction of the usual amount. With improved antennas or by connecting the cameras and goggles to e.g. a wireless router the range may be improved drastically.
Try it out
If you want to try it yourself I have included the Arduino sketch for the cameras (AS-IS NO SUPPORT!!). You need to set the variable at the top of the sketch to determine what camera does what.
When both cameras are connected you can connect your phone to the WiFi network:
SSID: “STEREO_VISION” password: “crossEyed”.
Once connected the default browser should pop up with the viewer page. If not go to 192.168.4.1 in the browser. The viewer should toggle fullscreen when you click on the background.