William A. Leonard

Computer Consultant

3D Scanner


Part 3 - Software

ctlPanel (40K)

Hardware development is at the point that requires software support to test the circuits and they seem to work properly.

The stepper motor controls also work. The user interface button allows stepping in any of the four directions taking one, ten, or one hundred steps depending on the region clicked within the button. The camera only moves along the left/right axis but by manipulating the bitmap capture, it can appear to move up and down as well. The up/down button is not yet implemented and a zoom button will be added later.

The Auto Scan button starts the following sequence:

  • The crossing point between the laser projection and the current scan line is detected for each of the two lasers. Photos showing this are on the mechanics page.
  • If the two crossing points are the same, then the Z position of the platform is recorded as the Z position of the object. A new scanline is selected and the sequence starts again for the new scanline.
  • Otherwise, the platform is moved an amount proportional to the separation of the two crossing points and new crossing points are detected. This is repeated until they coincide.
  • When all scanlines have been processed, the platform is moved in the X direction and the sequence is repeated for all the scanlines as before but with the new X position. This, too, is repeated until the entire X range has been processed.
The sequence generates the 3D point cloud. Eventually, it will produce the 3D mesh. So far, however, the results are less than satisfactory. Problems are listed in the summary.

I searched long and hard for a way to get the image from the web cam to a picture control. I found DirectX/DirectShow to be clumsy, bloated and incomplete - there was always some other piece that had to be downloaded and installed. I never did get all the external references resolved.
I turned to Video for Windows and found an elegant C++ Wrapper for it called CVFWImageProcessor by Ken Varn. You can find it at Code Guru.


10/25/06

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