Aligning cameras with semi-silvered mirror - STLs?

Other hardware discussion
Post Reply
gtoal
Posts: 17
Joined: Thu Apr 25, 2019 8:58 pm

Aligning cameras with semi-silvered mirror - STLs?

Post by gtoal »

Hi - I have the original board from many years ago and I enjoyed using it at the time for stereo photography. Recently (now I'm retired and have more time available) I finally got around to trying a project I always wanted to experiment with which is using the NOIR camera and an external IR notch filter to photograph scenes using only the IR component and no visible light. Now that I have that part working, I'ld like to try shooting with a regular pi camera that's aligned with the IR pi camera to have both a visible image of a scene and an IR image of the same scene, which I could then do some image processing on to study crop growth and such. I *could* just place the cameras closely side-by-side but there would still be some stereo separation if I do that, and I'd rather they aligned perfectly, so the solution would be to use a 45-degree semi-silvered mirror to let me align the two cameras exactly. Before I get a hacksaw out and make something crude to hold these out of wood, I thought I might ask here first if anyone has done anything like this and maybe, if I'm lucky, already created a 3D-printed holder for the two picams and a small piece of mirror?

btw I thought I'd throw in an IR photo taken with the IR pass filter that blocks the visible component:
Image
Last edited by gtoal on Sun Aug 24, 2025 6:48 pm, edited 1 time in total.
gtoal
Posts: 17
Joined: Thu Apr 25, 2019 8:58 pm

Re: Aligning cameras with semi-silvered mirror - STLs?

Post by gtoal »

If there's anyone else interested in doing this, I do now have a 3D-printed holder for a beam-splitter prism that does the same job as a semi-silvered mirror would have done. Work-in-progress files and some initial notes (in a Readme file, including where to get a compatible prism for that holder) are at https://gtoal.com/OpenSCAD/prism_holder/ - as the project develops, I'll take photographs and eventually do a proper write-up, probably for the Instructables web site. I have to confess that this time I'll be using a Pi 5 for the dual cameras rather than the compute module and stereopi.
Image
Designing the holder to exactly align the cameras and hold everything firmly turned out to be not trivial. It took 15 iterations to get one where everything fitted perfectly!

Image
Last edited by gtoal on Sun Aug 24, 2025 7:08 pm, edited 1 time in total.
gtoal
Posts: 17
Joined: Thu Apr 25, 2019 8:58 pm

Re: Aligning cameras with semi-silvered mirror - STLs?

Post by gtoal »

PS I thought at first that a consistent registration across all areas of the two images was not going to be possible when I saw the initial images, until I realised that the mismatch could be corrected almost completely by an affine transform, which I believe must be correcting a slight tilt in the lens/sensor component of the picam. (As well as correcting the slight x,y displacement that was expected...) Here's a combined image from two cameras once an affine transform has been applied: https://gtoal.com/OpenSCAD/prism_holder ... ullres.png - the alignment is pretty good although there's a very small area of distortion in one area of the frame which I think may be down to defects in the cheap plastic lenses. Now, how to determine and reuse the affine transform matrix automatically is not immediately obvious, but from this experiment I think it's clear that a beam-splitter prism works for this kind of photography. (And while researching this subject I found I'm not the only person who has wanted to try it (e.g. https://photo.stackexchange.com/questio ... -same-lens ), although I haven't found any instances yet of anyone who actually has tried.)

I did hit a small snag in my experiments, which is that the IR pi camera I have has slightly different dimensions to the non-IR version and doesn't fit well in the prism holder I built. I'll have to do a few more iterations to get a good fit, and also the focal length of the IR version is a tiny bit different from the non-IR camera which is supposed to be identical (they're both V1.3 pi cams) so the alignment is going to need 2 or 3% scaling applied as well as the minor affine transform I already discovered may be needed.
Image
User avatar
Realizator
Site Admin
Posts: 938
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Aligning cameras with semi-silvered mirror - STLs?

Post by Realizator »

Wow, that's quite impressive!
It reminds me of the ancient project I made before the StereoPi - it was a mirror rig to get a stereoscopic image from a single camera (it's on the right of the photo). And this project is 10 years old. It motivated me to develop a StereoPi :-)

I remember that aligning the mirrors was extremely difficult, but the software finally does most of this. In your case, the affine transform can be automated, so you exclude the manual adjustment.

By the way, when I read your post, my first idea was to use a camera with a physically removable IR filter (by servo motor, for example). But then I realized that the pictures would be taken at different times, and any moving object would ruin the result.
Attachments
5b76e6b05ab4406393bc0ac3b8d0a7fb.jpg
5b76e6b05ab4406393bc0ac3b8d0a7fb.jpg (168.98 KiB) Viewed 28712 times
Eugene a.k.a. Realizator
Post Reply