If you have ever played around with macro photography, you’ll know how hard it is to get a focused image of something that isn’t two-dimensional. For virtually every 3D object, you’ll have to deal with the depth of field – the small region where things are actually in focus. [David] came up with a neat homebrew solution for making sure everything in his macro photos is in focus using a discarded flatbed scanner and a Raspberry Pi.
[David]’s technique relies on focus stacking. Basically, [David] takes dozens of images of the same object, moving the camera closer by a fraction of an inch before snapping each frame. These pictures are stitched together with CombineZ, a piece of software used for extending the depth of field in images.
The hardware part of the build is a Raspberry Pi hooked up to a stepper motor driver and the shutter button of [David]’s camera. By attaching his camera to the carriage of a flatbed scanner, [David] can inch his camera ever closer to his object of study while grabbing the images for CombineZ.
The results are impressive, and would be nearly impossible to replicate any other way without tens of thousands of dollars in camera equipment.