CLAUDEFORGE STUDIO

Daily reference

How to 3D scan an insect with photogrammetry and focus stacking

To 3D scan an insect with photogrammetry you photograph it from hundreds of angles, focus-stack every view so the whole body is sharp, and feed those images to structure-from-motion software; here is how that works and what a new camera-orbiting robot changes.

The short answer: many angles, many focus slices

To 3D scan an insect with photogrammetry, you take photos of the specimen from hundreds of viewpoints, combine a stack of differently focused shots at each viewpoint into one image that is sharp from front to back, and give those merged images to structure-from-motion and multi-view stereo software, which works out where each camera was and builds a textured 3D model. The model is then scaled against a known distance so it can be measured.

The middle step is what makes small specimens different from buildings or statues. The developers of scAnt, an open-source insect scanner, put it plainly: at this scale the depth of field is typically small compared to the dimensions of the specimen. A single photo of a beetle shows only a thin slice in focus, and photogrammetry software cannot match features that are blurred.

Why macro photos need focus stacking

Focus stacking solves the shallow-focus problem. A photography tutorial from Cambridge in Colour describes the routine: take a series of photos while gradually shifting the focus distance through the subject, register the frames so they line up pixel for pixel, then let software keep the sharpest region of each frame and blend them. Each slice should overlap the depth of field of the next, or the composite shows soft bands. The tutorial also notes that as magnification increases, the number of photos needed increases.

There is a subtle catch. Refocusing a lens slightly changes its angle of view, so frames appear to zoom in and out and must be re-aligned. Scanning rigs therefore often keep the lens fixed and move the whole camera, or the specimen, along the optical axis on a motorised rail. The output of a stack is usually called an extended depth of field, or EDOF, image, and one EDOF image is made for every viewpoint.

Two ways to build a scanner: turn the bug or orbit the camera

scAnt, published in PeerJ, rotates the specimen. A pinned insect sits on a two-axis gimbal inside a diffuse lighting dome while a slider moves the camera's focal plane. Its authors report that 20 to 50 images per perspective are usually enough, that their models used 180 to 360 EDOF images, and that capture and stacking took 2 to 5 hours with another 3 to 12 hours of reconstruction. The hardware cost about 200 euros plus about 700 euros for camera and lens, and stacking and masking run on open-source tools, with Meshroom used for reconstruction.

The Orbitoscope, described in ZooKeys in 2026, does the opposite: the specimen stays still and a six-axis robot moves the camera around it. Three linear axes with about 800 mm of travel position the camera, a rotation axis gives a full 360 degrees of azimuth, a tilt axis gives roughly plus or minus 45 degrees, and a sixth stage moves the camera, bellows and lens together for stacking so that magnification never changes. The authors argue this helps with fragile, heavy or elongated mounts that should not be spun. A sharpness score based on edge detection decides when a stack has gone past the specimen and can stop.

The price of thoroughness is time. The Orbitoscope visited 488 predefined viewpoints per specimen, shot 12,000 to 26,000 raw frames each, and needed 42 to 67 hours per insect. Stacking used Zerene Stacker and reconstruction used Agisoft Metashape. The build cost 9,368 euros in total; the control software is released under the MIT license with build instructions archived on Zenodo.

How accurate insect photogrammetry is, and what still fails

Both projects scale their models from a known distance and compare them with microscope measurements. scAnt reports a reconstruction error of roughly 12 to 15 micrometres and preserved claws about 30 micrometres wide on a 27.5 mm ant, with an upper specimen size of about 8 cm. The Orbitoscope team compared three distances on one weevil against a stereomicroscope and found a mean absolute error of about 0.52 percent, while stressing that this validation is limited.

The hard cases are the same in both papers. Hairs and antennae can be visible in the stacked images yet fail to reconstruct. Shiny cuticle can produce rough mesh surfaces, and transparent wings confuse the software because their appearance changes with viewing angle. Masking out the background helps avoid false matches. The Orbitoscope adds its own limits: it weighs about 80 kg, needs a 1.5 by 1.5 metre footprint, and its viewpoint sequence was planned by hand.

  1. Ylinampa and Kõljalg (2026), The Orbitoscope, a six-axis macro-imaging robot for photogrammetric 3D-digitization of insects and other small specimens, ZooKeys 1277
  2. Plum and Labonte (2021), scAnt: an open-source platform for the creation of 3D models of arthropods (and other small objects), PeerJ
  3. Cambridge in Colour, Focus Stacking and Depth of Field
← Past references