Aud 21, 2025. This is a holder for 2 V1.3 raspberry pi cameras (a regular one and an IR one) held in place facing two sides of a beam-splitter at 90 degrees so that when viewed from the front, the two lenses are in perfect alignment. This is so that we can take photographs with the two different Pi cameras, and the images will be in perfect alignment - otherwise the best we can do is to minimise the separation between cameras, and even if the separation is quite close (say 1 inch with regular pi cam, 1/3in with a pi zero cam) it still isn't perfect alignment, and when the two images are combined (to highlight the differences between the visible light image and the IR image) there will be some fringes around the edges of objects. This is initially just the basic prism and camera holder functionality, without any thought to aesthetics. Once the prism holder is finished (i.e. no slack in the system that lets parts rattle around, and everything is held down tight) it can be incorporated as part of a camera. At this point it's pretty close and I'm testing the current print to see if the final rattle has been removed. By the way, you have to print this in black! At some point in the future I'll do a modification of this part which will allow me to add a visible-light cut filter to the IR camera so that it *only* sees IR, not the default which is IR + visible. These filters are glass and about 2 to 3mm thick, so the normal light camera will have to be positioned accordingly, to match. At the end of the day, the tolerances of this part come out perfectly on a Bambu printer, but I can't guarantee that this will print as well on some older printers with lower resolution and accuracy - for those, some small tweaking of the .scad file may be necessary. PS This is a project I came up with quite some time ago and originally intended to implement it with a semi-silvered mirror (some Mirropane glass I was going to get cut to size) but I wasn't able to do it justice until recently when I acquired a good quality 3D printer. Related links: https://forum.stereopi.com/viewtopic.php?f=7&t=1426&p=3484#p3484 https://forum.stereopi.com/viewtopic.php?t=1428 https://photo.stackexchange.com/questions/83518/can-i-use-a-beam-splitter-to-record-two-images-using-the-same-lens The beam-splitter prism that I'm using is the 25mm one from https://www.amazon.com/dp/B0B34DNTZH $13.30 + tax. Note that the top and bottom surfaces (the only ones you might even contemplate touching with fingers) are frosted glass. The beam-splitter holder only touches the optical surfaces of the prism at a narrow margin on the vertical edges (although it does fully mate against the frosted top and bottom to hold it tightly in place). Try not to touch the open front of the device but if you ever do, clean it as if it were a camera lens or a piece of optical lab equipment - don't rub it with a cloth, not even the sort of cloth that you might clean your spectacles with. For more specific advice, try this: https://www.google.com/search?q=best+way+to+clean+fingerprint+grease+off+an+optical+beam+splitter+glass A source of cameras is: ?? ?? (I need to find a reliable source of matching vis/ir cameras. Not helped by the fact that the V1.3 cameras are no longer the default and are getting harder to find; and I haven't yet tested with V2 or later cameras which may have slightly different dimensions. Also I have a V2 NOIR but I don't own a V2 Vis.) There are also hundreds of Chinese vendors selling compatible cameras much more cheaply. Just make sure you get a matched pair. Although the mounting system above doesn't yet handle additional filters, you might want to pick up a set of IR pass/Visible cut, and UV pass/Visible cut filters for later: IR: https://www.ebay.com/itm/156413343183 ('New Old Stock'. Won't last forever at these prices.) (The raspberry Pi "No IR" cameras come with a dark blue filter which is quite close to the glass IR pass filter linked to above. Not quite as good but OK for initial testing.) UV: https://www.aliexpress.us/w/wholesale--ZWB2-.html (The ones I have were https://www.aliexpress.us/item/3256803885895014.html at $4.33 when I bought them, but prices have rocketed in the last few months) Since filters vary in shape and size so much, when I add them to the design they will undoubtedly need to be customised to each user. The standard Raspberry Pi Camera Module V1.3 has a horizontal field of view (FoV) of approximately 53.5 degrees and a vertical FoV of roughly 41.4 degrees. The angle of view available from a point on the center of a cube is as follows: the half-angle is determined by the right-angled triangle of size 1/2 in X and 1 in Y (or 1 in X and 2 in Y for easier calculation). Which comes out to atan(2) = 63.43 degrees for the larger angle and 90-atan(2) (26.57) degrees for the smaller angle. 2*26.57 is approximately 53, so the pi camera should almost have a full horizontal view through the prism, although the edges may just be cut off a little. In practice because the camera is not on the face of the prism but a millimeter or two behind it, the results may be a tiny bit worse than the calculation above predicts, but good enough for practical work if we trim the margins of the image just a little. There's a question as to whether the top and bottom faces of the prism (which are frosted) should be painted matte black. I haven't decided yet if this is worth doing or not. https://www.cloudynights.com/topic/452395-to-blacken-or-not-to-blacken-theprism-sides-edges/ The easiest way to drive the two cameras nowadays is by using a Pi 5. https://thepihut.com/blogs/raspberry-pi-tutorials/how-to-use-two-camera-modules-with-raspberry-pi-5 (There are other solutions possible - there's the Compute-module based Stereopi, and there are some multiplexing adapters for regular Pi's.) -- Lastest update: because the NOIR camera was showing a noticable difference in focal length, despite being a V1.3 camera as was the visible light camera, I decided to re-do the experiment using two visible light cameras - and especially, two *identical* V1.3 visible light cameras. I have a lot of these old V1.3 cams - not all official Pi brand, many were cheap Chinese knock-offs, so I sorted through them and picked two that were identical in appearance. Then I undid the modification in the script to use the json file for the NOIR camera so that both would use same parameters. Despite all this, the quality of the two images varied considerably. It is not clear if the differences are down to the different paths through the beam splitter or differences in the individual camera sensors or lenses. But it was not just the colours that were slightly off - once the images were superimposed, there was noticable deviation around the edge regions, though the center parts of both cameras did align fairly well. (This is independent of the two images being slightly offset which could be down to either a deficiency in my 3D printed camera holder or in the exact positioning of the lens/sensor unit in the hole in the holder where the lens is inserted due to differences in the cameras themselves, since that part of the camera is never attached tightly to the base. But my suspicion is that the cheap lenses on these cheap cameras are what's responsible for most of the misalignment around the edges of the images. I can probably try a few more of my v1.3 cameras (I do have a couple of dozen of them) and find a pair that are a better match for each other, but that's not an ideal solution for anyone else so I'll keep working on this and see what I can do to improve the results. Maybe the two images can be better aligned with an affine transform, for example...? (Also I need to parameterise the camera holder part to compensate for the slight differences in size of the lens/sensor units between different brands and diffrent revisions. Shame, I was hoping I was done with the iteration over multiple print runs. I think I made about 20 of these before getting to the one I'm actually using!) Well, yes - turns out that you do get much better registration if you do an affine transform on the images. So the distortion is probably mostly down to the lens/sensor unit not being held completely level in the side of the camera holder. There still remains a small misalignment that's actually in the middle of the image and that is more likely due to individual lens aberrations. I've now managed to put together some open-source code that will take the two images from the pi cameras and align them, and for the proof-of-concept demo it also blends them together at 50% each. The final code will offer more sophisticated blending options, so that - for example - infra-red subjects such as tree could be used as a colour mask and only those objects would have their colours adjusted in the normal image, leaving everything else in full colour. (Note that the align-images bash script invokes align_images.py, but due to a misconfiguration of this hosting site where .py files can be executed by fetching them from any web client, the align_images.py file has been renamed as align_images.p.y.txt) The python alignment script (from https://github.com/khufkens/align_images/ ) requires the python OpenCV packages to be installed, as well as numpy. The bash script requires Image Magick to be installed. pip install opencv-python pip install numpy