William A. Leonard

Computer Consultant

3D Scanner


Every once in a while I get interested in computer graphics. I wrote some ray tracing software which I use almost every year to create Christmas Cards and occasionally I compose an entry for the Internet Ray Tracing Competition.

One hurdle that every 3D graphics artist faces is the creation of objects for the scene. There is software that allows the artist to draw an object in three dimensions and there are machines that use lasers, ultrasound, stylus, and positioning arms that more or less automatically record the positions of thousands (if not millions) of points on the surface of the object.

The commercial software is very sophisticated and the devices are high-precision instruments that cost thousands of dollars. I had an idea for a simple technique that perhaps I could build from mostly scavenged parts. I didn't (and don't) expect to achieve high precision or rapid scanning; just enough of both to have a little fun building something that would give adequate results for a hobbyist like myself.


Part 1 - Mechanical

I'd been thinking about doing this kind of project for quite a while. I researched interfacing to the parallel port of a computer and controlling stepper motors.

The thing about building from scavenged parts is that, as you go along, the design changes quite often. Currently, I'm proceeding with two lasers and one camera. At one time I was planning to use two cameras and a laser pointer. There were several design iterations involving rotations of the laser(s) and/or camera(s) and/or the object. I was undecided about measuring parallax or aligning two superimposed views in the computer. Either of these would require tight tolerances and require measuring angles and distances precisely.

The Laser Trac® projects a line. Using a Laser Trac® instead of the spot laser pointer has the advantage that, while a spot would have to be moved in both the X- and Y- directions; a vertical line would only need to be moved in the X- direction and, therefore, there would be no need for the platform to move vertically.

With the current design, the two lasers are mounted on a platform and their beams are crossed at some convenient distance in front of the platform. The object to be scanned is placed in front of the platform in the vicinity of where the beams cross. The beams are projected onto the surface of the object. When the crossing point of the beams happens to coincide with the object's surface the two laser projections merge into one. The platform moves forward and back (the Z direction) searching for that position. The position of the platform corresponds to the location of the point on the surface of the object. Other points on the surface are examined by moving the platform left and right (the X direction). The Y direction is accomodated by examining the camera image looking for where the laser beams cross the camera image raster lines.

I have a collection of a few used and obsolete printers and they provide a ready-made platform for fairly precise linear motion. The frame and rails (with stepper motor) from an old 14" NEC Pinwriter is used as my base. The assembly moves from side to side (the X direction).

Another set of rails from a smaller, lighter Lexmark® printer are mounted on top of the first set at a 90° angle so that its platform approaches and recedes from the object. The two Laser Tracs are mounted on it and angled inward so that their beams cross. As the platform approaches and recedes from the object, the converging beams will meet at points on the surface that are a particular distance away from the platform. The specific distance doesn't matter as long as it doesn't vary (ie, as long as the beams converge at a constant distance in front of the platform).

Principle The accompanying animation illustrates the principle of how the beams will converge at the tip of the figure's nose. The base image is the view from overhead showing the beams crossing in the vicinity of the nose as the platform moves in and out. The inset image shows the projection of the beams onto the figure's face. When the two vertical lines are coincident, the position of the platform is recorded. This represents the distance from some arbitrary reference point to the tip of the nose. (The inset image shows two straight vertical lines. In reality these lines aren't straight but they do meet when the platform position is correct. See the photos below.)

At least mechanically, this is a fault tolerant scanner. It doesn't matter where the lasers are mounted, nor the distance between them, nor the angles between them; the only restriction is that they don't move relative to each other once the scanning begins. The camera doesn't need to be positioned precisely either.

I don't think I need or want to fill in every pixel in the image presented by the camera. I want to project a mesh onto the object and measure the points where the vertical lines meet the horizontal lines. The vertical lines are projected by the lasers but instead of projecting horizontal lines onto the object, I use one scan line (horizontal row of pixels) from the image. The [next] row of the image is examined for light from the laser. If there are two places on the row, the platform will move forward or back until they converge and appear in only one pixel on that row. That pixel, then shows a point on the surface at the intersection of the vertical (laser beam) and horizontal (camera pixel row) lines (ie, an intersection in the mesh). When all rows of the image have been examined this way, the platform will move sideways to repeat these steps for another vertical mesh line.

Notwithstanding the high tolerance of mounting the components, errors will occur if the two laser lines are not absolutely parallel or if the axes of the two printer rails are not precisely 90°. I'm sure other factors will also become apparent as construction proceeds.

scan07 (24K) scan08 (22K)
scannerL (8K) The left laser is on. The projected line is visible. scannerR (8K) The right laser is on. The projected line is visible.
scannerLs (2K) The object is removed leaving only the line. scannerRs (2K) The object is removed leaving only the line.
scannerG (2K)
  The two lines are superimposed. Where they cross is a constant distance from the laser platform. If we know the position of the platform, then we know where in space the crossing point is.

In practice, a scanline in the image will be selected and the platform will move in and out until the beams cross on that scanline.

As of 10/1/06, the project is producing a point cloud output, however, the results are less than satisfactory. The design makes the process excrutiatingly slow because the apparatus has to hunt for the position where the beams cross. Other factors are discussed in the summary.


10/25/06

Home
Part 2 - Electronics
Part 3 - Software
Part 4 - Summary