Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

Make: Projects

The Big Picture

Taking a 100+ megapixel macro photo with a basic digital camera.

Explore the full-size image at gigamacro.com/make.

Explore the full-size image at gigamacro.com/make.

Seeing small details is hard. As the eye gets closer to a subject, the depth of field (the distance through which details are clearly focused) gets shorter. At about 70mm away, most human eyes can no longer focus at all. In fact, only about 2 degrees of our field of vision is actually in focus at any given instant. The rest of what we “see,” from moment to moment, is virtually constructed by our remarkable brains.

stacking-and-stitching

The process for making a very large digital macro image — sometimes called “stacking and stitching”— is actually similar. “Stack” is derived from “focus stacking” (which combines many images taken at different focal lengths into one image with a long depth of field), and “stitch” from “image stitching” (which combines side-by-side images with overlapping fields of view into a single continuous picture). The final product has both a long depth of field through the entire subject and a high level of detail or resolution.

For practical purposes, the achievable resolution depends only on how many images you’re able to combine. In this project, our goal is 100 megapixels (MP), which will require stacking and stitching about 200 images. A challenge using manual equipment, but by no means insurmountable.

Two Approaches to Image Stitching

rotation_translation

Camera Rotation: To eliminate parallax, the center of rotation should be the “nodal point” of the lens. A panoramic bracket, which keeps the center of rotation from changing between shots, is required for accurate macro work.

Camera Translation: Standard lenses work well for flat subjects like maps. For objects with depth, a special “telecentric lens” is required to eliminate perspective and parallax and produce a so-called orthogonal view.

setup_diagram

Step 1: Configure the camera

Figure out how close you can place your subject and still focus the camera. (Most likely, you’ll find the camera has the highest magnification when fully zoomed out.) Turn off all automatic exposure adjustments, and set the F-stop between 6.3 and 8. Turn on the built-in self-timer or set up a remote trigger release so you don’t jostle your images pressing the shutter button.

Step 2: Position the camera

Mount your camera on the bracket so that it rotates around the “nodal point” of the lens. Finding the nodal point can be a bit tricky.

For tips on finding nodal points, check out tutorials from VR Photography and Panamundo.

Download the DIY bracket plans.

Step 3: Position the subject

Center the thing you want to photograph under the nodal point as best you can. Get the camera as close as you can and still focus, then make sure that it will not bump into the subject even when rotated to the limits of the bracket’s motion.

Parallax describes how near and far objects appear to change position when you change your field of view. It causes inaccuracies and undesirable artifacts in panoramic photos, but can be eliminated by rotating the lens about its nodal point.

Parallax describes how near and far objects appear to change position when you change your field of view. It causes inaccuracies and undesirable artifacts in panoramic photos, but can be eliminated by rotating the lens about its nodal point.

Step 4: Light it up

For lighting, we recommend diffused natural daylight. For the Due image, we also added a couple of 12V LED dome lights below a translucent panel underneath the board to give some backlighting.

Step 5: Take some test shots

Before we shoot hundreds of images, let’s try a sample stack to verify the focus-stacking process. Adjust the camera view to an area of the subject with lots of depth. Secure the bracket and take 8 images focused at different depths. Jump ahead to steps 7 and 8, and verify that the post-processed images look right before proceeding.

Camera movement during the imaging process.

Camera movement during the imaging process.

Step 6: Take working shots

You’ll be shooting anywhere from 200 to 800 photos. Be patient.

6a. Position the camera. It doesn’t really matter where you start or where you end; all that matters is that you have complete coverage when you’re done. I usually start dead center under the camera.

6b. Shoot a stack of images. Start by focusing at the nearest depth, on the features closest to the camera. Take a picture then change the focus slightly, working “deeper” into the image. How many images you take for each stack can vary between subjects and between different parts of a subject; just make sure that every feature in frame is well focused in at least one image in each stack. For
the Arduino image, I shot an average of 8 images per stack.

6c. Rinse and repeat. Work your way out in a grid pattern until you’ve covered your entire subject. When you move the camera, shoot for 40-50% overlap from the last image. Covering the Arduino shown here required 25 stacks. It took about 30 minutes to take all the pictures.

The result produced by Photoshop. The spherical projection setting works well to stitch images shot by  rotating the camera around a pivot point, but does not automatically correct for spherical distortion.

The result produced by Photoshop. The spherical projection setting works well to stitch images shot by
rotating the camera around a pivot point, but does not automatically correct for spherical distortion.

Step 7: Focus the stacks

Transfer the images from your camera to your computer and open Photoshop or other stacking software. For each “stack” of images taken at a particular position, the Photoshop workflow goes like this:

7a. Select File → Scripts → Load Files into Stack. Select only the photos from a single camera position. Check the “Align automatically” box. Click OK, and the files should load, each one in a separate layer.

7b. Select all layers in the Layers panel. Then select Edit → Auto-Blend Layers, and choose “Stack Images” for your blend method. Click OK.

7c. Save the stack to a PSD file. I like to name these files with column and row numbers to make them easier to keep track of.

The result produced by AutopanoGiga. In this instance, we used the software’s  automatic planar projection feature to remove spherical distortion.

The result produced by AutopanoGiga. In this instance, we used the software’s
automatic planar projection feature to remove spherical distortion.

Step 8: Stitch ‘em together

When you’ve saved the focus-stacked images from each camera position, clear your workspace and proceed as follows:

8a. Select File → Scripts → Load Files into Stack. Choose the focus stacked images you just saved
and click OK. The files will load in different layers
as before.

8b. Highlight all the layers in the Layers panel, then select Edit → Auto-Align Layers. Choose “Spherical” projection and check the “geometric distortion” box. Click OK, and the files will be aligned and the canvas area automatically adjusted.

8c. Highlight all the layers again, then select Edit → Auto-Blend Layers. Choose the “Panorama” blend method and click OK. Each photo will have a mask that you can edit or change if desired. When you’re happy with the finished image, save in whatever format you like.

Our GIGAmacro Magnify2 is specifically designed for automated capture and processing of gigapixel macro photographs.

Our GIGAmacro Magnify2 is specifically designed for automated capture and processing of gigapixel macro photographs.

Going Further

This setup works wonderfully for showing incredible details on many items — experiment with insects, flowers, and coins to reveal rarely seen aspects.

Beyond 100MP, hardware and software automation becomes a practical necessity. As magnification increases, the image count rapidly climbs into the thousands. With gigapixel macro photos my company commonly combines 25,000 or more shots into a single image. We also produce equipment to help automate shooting, including off-the-shelf and custom robots. Look for the first terapixel macro photo from us in 2014!

Gene Cooper

Gene Cooper (gigamacro.com) is a creative technologist with a passion for developing scientific tools, exhibits, and educational programs. He is owner and founder of GIGAmacro, which builds robotic microphotography systems and imagery comparison tools. Gene lives in Vallejo, Calif. with his wife, Naomi , and two children, Cora and Emmet.


Graham Bird

Graham Bird (gigamacro.com) jumped out of corporate life in 2007 to “have more fun” and does so traveling and helping small companies with strategy, business, and marketing. He loves working with smart groups of people to solve challenging problems. Graham is a transplanted Brit who has lived with his wife, Barbara, in Oakland, Calif. since 1996.


blog comments powered by Disqus

Featured Products from the MakerShed