Building a Desktop Scanner part 2


I used an arduino mega, but any micro controller will do.  The mega has the advantage that it can take an inexpensive lcd display shield and still have lots of i/o pins easily accessible.  The arduino can’t safely drive a stepper motor directly so we connect it to a stepper motor driver.  I used an EasyDriver board which is inexpensive and lives up to its name.  The chip at the heart of the EasyDriver needs a heat sink to reach its maximum output, but in this application you probably don’t need one.  You won’t be running it very hard.  I run the arduino, the lcd and the EasyDriver all off a 9V battery.  This power supply somewhat limits the torque that the stepper will produce so if you are planning to turn a large turntable you might need a larger power supply and a heat sink on the driver.

The firmware is pretty simple.  One set of buttons allows you to select the number of exposures to make per revolution. One button starts and stops the scanner.  One button takes a single exposure and then rotates the stepper one increment.  This manual mode is handy with subjects which require each shot to be manually focused.

When I use the scanner I place it on a work table in my shop and mount the camera on a tripod next to it on the floor.  I use a cheap macro rail ($25 on amazon) to help position the camera.  The rail has more flex than is desirable, but it works okay since you aren’t actually touching the camera to trigger the exposure.  I use to hold a sheet of paper as a seamless background.  I also sometimes punch a hole in a sheet of paper and thread it on the stepper shaft to mask out the motor.  This approach might work well for you guys because you can cheaply replace the background if anything drips on it.

As you know lighting is critical for photogrammetry.  I use 3-4 JANSJÖ led desk lamps from Ikea to light the subject.  These lamps are very easy to position, and put out a lot of light.  They have small heads which makes it easy to light small subjects.  They are LEDs so they put out very little heat.  You can improvise diffusers with regular paper and tape.  Plus they are $10 each!  I also sometimes use a cheap LED ring light on the camera lens which provides nice diffuse light, but since it is attached to the filter ring of the lens it tends to get in the way with macro shots where the subject is almost touching the lens.

Another approach to lighting is to put the scanner inside a light tent.  This gives you a lot of diffuse even light and a clean background.  They sell small kits for photographing jewelry which are designed to minimize reflections and glare when shooting shiny things, so they might help with your stuff.  Also a circular polarizer filter would be a good thing to have on hand.  It can be helpful reducing glare.


Building a desktop 3d scanner part 1

We have talked about many different options for 3d scanning over the years, but we always come back to photogrammetry.  The process involves taking photographs of an object from all angles and then using software to identify and triangulate the location of parts of the object.  After a lot of number crunching you end up with a 3d scan of the object in the photographs.  The quality of the output is entirely dependent on the quality of the set of photos you start with, and that is where the skill comes in.  The software is pretty easy to run and there aren’t that many options on how to process your data.  The big learning curve happens with the camera.  This simple scanner makes it relatively easy to capture high quality photo sets which will produce high quality scans.

The basic setup is simple: An arduino controls a stepper motor and an infrared LED.  Using the multi camera control library from Sebastian Setz  and the IR LED the arduino emulates a wireless remote for almost any DSLR camera.  It fires off an exposure then rotates the stepper motor to the next position and repeats.  The result is an evenly spaced set of photos ready to feed to your photogrammetry software .

screw scan

By automating the movement of the camera you are guaranteed sufficient overlap between the shots and complete coverage.  So you can concentrate on the quality of the exposure.

Properly exposed razor sharp images are critical for photogrammetry so it is worth talking a bit about the basics of photography.  The two most basic exposure adjustments are aperture (also called f-stop) and shutter speed.  No lens can keep the entire image in focus at one time.  There is always a limited depth of field, the range of distances from the camera through which the image is in focus.  Objects closer or farther away than this focal range are blurred.  Blurring introduces noise and errors into photogrammetry so we want the greatest depth of field possible.  On most cameras this comes about f/11.  Lower f-stops have lower depth of field.  Higher f-stops introduce diffraction errors which can be just as bad.  Shutter speed is critical if you are holding the camera in your hand, but in this case it is on a tripod so it is less important.

The drywall screw example here uses a macro lens to fill the frame with the relatively small subject.   Autofocus generally doesn’t work well with macro photography so you will probably need to focus manually.  An object like this drywall screw is predominantly cylindrical so if it is centered on the axis of the stepper it will stay at the same distance from the camera throughout the revolution.  That means you can set the focus and exposure once and it will work for the entire revolution.  Other shapes of object may require you to focus each shot individually.  If you scan a larger object you may be able to use autofocus to keep the images crisp.

Focus tip: Many DSLR cameras allow you to zoom in on the viewfinder preview image which will allow you to focus even more precisely.

Jpeg compression is another source of noise in your images so you will want to shoot at the highest image quality your camera will allow.  You can shoot RAW and develop as uncompressed TIFFs, but for most scans I just use the highest quality JPEG copmression.