homemade 3d scanner - the working principle |
due to the many questions received regarding the
working principle it makes sense to present a few
sketches that should explain certain aspects more
thoroughly. the first image revisits the basic setup. it shows all vectors used in the system. each pixel of the cam has an associated direction vector c, i.e. every ccd pixel looks in one particular direction (the actual optical path is unaccounted for in the image). these vectors are fixed and do not change over time. what changes is which of the pixels see the projection of the laser line on the object. the direction vector d is also fixed in time. it connects the ccd with the laser origin. the extension of the ccd itself is neglected for simplicity and d is taken to start at approximately the center of the chip. the two vectors l1 and l2 are explained next. l1 is oriented along the axis of rotation of the stepper motor. hence, it does not change over time. the vector l2 changes as the stepper motor rotates. the components of the vector can easily be calculated from the angle of rotation, as shown on the left. finding the direction vectors from an image seems to give most people headaches. it is done by scanning every horizontal line in the image for the laser projection, that is for every image y-position an associated x-position of the laser is sought. this is shown in an example on the left for a few lines in a single image. once these are found, the belonging direction vectors have to be determined. people actually do write papers about taking all kinds of optical effects into consideration to do that. a highly sophisticated calibration really only makes sense for a very high precision scanning system. that was never the aim of this project, besides the webcam has only a plasic lens with questionable accuracy. the way of choice was to divide the field of vision such that when looking at a wall all pixels inspect same size squares making up the total visible area together. a refinement of this would be to do it piecewise over the field of vision. one more thing that may need to be explained is how a surface over all the scanned points is found. commercial scanners usually come with software to generate surfaces that span this cloud of points. they use pretty complicated algorithms to ultimately generate nurbs faces for later modification in cad systems. far simpler than that is to use tri- or quad-meshes connecting all scanned points. when keeping in mind how all the points have been generated it is actually trivial to make a mesh. the process is shown in the left image. the scanning process requires dozens of images which are taken one by one with an intermediate adjustment of the laser. in each of these images the laser is found on every image line. the key is to assume that a point on line x in image t is near a point on the same line x in image t+1. also a point on line x in image t is near a point on line x+1 in image t. |



