Sunday, February 20, 2011

Portable 3D Scanners - Accuracy and Beyond, and Triangulation

Portable 3D scanners exist in many forms
2 camera/single projector
single camera/single projector
three camera/single projector
two/three camera with active beacon
2 camera/no projector
etc., etc., etc.

These variations are further expanded by permutations such as structured light, laser line, laser area, passive stereo, passive mono, structured spectrum, random pattern, sinusoid, step function, etc., etc., etc.

And these are, once again expanded into categories such as RGB color camera, narrow wavelength projection, mono camera with bandpass filters, mono camera with broadband (or no) filter, cameras at specific wavelength sensitivities, etc., etc., etc.

And, futher still, the field opens up into high frame rate, multiple exposure, auto-exposure, etc., etc., etc.

Moreso, the systems are based around low bit depth, high bit depth, actively cooled, passively cooled, CMOS, CCD, interline, full-frame, etc., etc., etc.

Yet further, the choices expand to binned pixels, batched pixels, filtered pixels, correlated pixels, derivative-of-pixels, etc., etc., etc.

And, the field further expands into rigid camera/projector assemblies, floating optics, mechanically-coupled cameras/projectors, thermally invariant structures, thermally compensated structures, etc., etc., etc.

How many combinations are we up to? 100 million? We haven't even started to talk about lenses...or data processing...or calibration...or storage...or data stabilty...or cabling... The trade-off options are staggering. If anything, the sheer number of possible configurations should provide hope to you that there is a scanner design to fill your needs.

But, there is, in fact, a single factor that traditionally has tied all "portable" 3D scanners together: Limited triangulation.

Triangulation Governs Portable System Accuracy
By convenience, the process of coupling a camera to a camera or a camera to a light source, or a camera to itself for the purpose of reconstructing a 3D scene results in a system that is easy to use, set up, travel with, and understand, but the quality of the resulting 3D data is bounded by the Laws of Physics which govern it.

For example, most "portable" 3D scanners rely on somewhere between a 15 degree and a 45 degree angle of triangulation. As the angle becomes more shallow, the depth accuracy degrades, or the camera required to accomplish the same task increases in cost. Similarly, as the angle goes up, the depth accuracy improves, and the camera cost goes down, but the common area viewed by the two camera viewpoints diminishes, and the lens depth of field becomes governed by a closed aperture, long exposure times, diffraction, etc., etc., etc. The "sweet spot" in the 3D industry seems to be somewhere around 30 degrees. There are a number of practical reasons to use this number as a starting point for a design, but, as you'll see, there are also many reasons to deviate from it drastically.

As is obvious by now, we can't get into the full range of system trade-offs in this blog post, and possibly ever. But, from the choices available to you, the customer, it is fair to say that the success of a 3D metrology system in your environment, on your parts, may require a very specific combination of these factors. That said, let's look at why a "portable" 3D scanner is not a good starting point if you are in need of high accuracy (i.e. in the CMM range). Incidentally, this correlates strongly to why optical metrology systems, by and large, have not succeeded in displacing CMMs in production environments.

Factors That Influence Scanner Accuracy
In general, the portable systems are governed by 2 things:
1) how well they can locate a landmark in the camera image (a landmark may be a target, a fringe, a random pattern, or anything else it is designed to find). This is the "2D portion" of the scanner, and this is where the cameras play their role. Locating the landmark is expressed in units of pixels, and reasonable values for finding a target may be 0.04 pixels (1 sigma), and a reasonable value for finding a fringe may be 0.1 pixels (1 sigma). This means 0.08 pixels 2 sigma, and 0.2 pixels 2 sigma, respectively. Denser pixels (higher megapixel cameras) and larger pixels (better quality camera imaging sensors) directly correspond to improved 2D landmark finding accuracy. These 2D accuracies can be thought of as "X,Y Accuracy". The X,Y Accuracy is governed by the software algorithms, expressed as a function of the camera parameters. Much higher accuracies are possible, and much lower accuracies are also possible, but these are all part of the trade-offs for system design.
2) the angle between cameras. This corresponds directly to "Z Accuracy". It is calculated more or less as follows: Z Uncertainty = (X,Y Uncertainty)/(sin(angles between cameras)). What does this tell us? Let's say a 1 Megapixel camera (1000 pixels x 1000 pixels = 1 Megapixel) can find a fringe at an accuracy of 0.2 pixels at 2 sigma, and let's say the camera is set up for a 1meter field of view. This means that each pixel is 1mm wide (since 1 meter / 1000 pixels wide = 1mm). If the camera can locate a fringe to 0.2 pixels, the X,Y uncertainty of the fringe is 0.2mm (about 0.008") at 2 sigma. If the angles between cameras (or the angle between the camera and projector for a 1-camera system) is 30 degrees, then sin of 30 degrees is 0.5. The Z uncertainty, therefore, is 0.2mm/0.5 = 0.4mm, or 0.016". Conservatively, we can add the X,Y uncertainty to the Z uncertainty, to achieve a conservatively-derived value of 0.024"

As you can see, a 4 Megapixel camera (2000 pixels x 2000 pixels) would double the accuracy, and a 16 Megapixel accuracy (4000 pixels x 4000 pixels) would result in a 4x accuracy improvement, but all of this comes at a higher camera cost. We could also change the triangulation between cameras to 90 degrees, so the 1/sin term would become 1 (effectively improving the Z accuracy by a factor of 2), but this would result in a scanner that is very difficult to use.

All of these numbers are for a single scan. And, again, how the cameras are physically set up will influence the accuracy in a variety of ways (for example, data at the camera's far field of view will be different than the near field of view, etc.). As experienced scanner people know, the nuances of how multiple scans are merged also play a fundamental role in total system accuracy.

ARE THESE REAL NUMBERS? If you show these numbers to a 3D metrology system supplier, and they try to dismiss this concept, consider this: a camera's pixel at the imaging chip is usually only 5-10 microns across. 0.2 pixels of movement alone is equivalent to 1-2 microns of movement. In other words, if there is a fan on the system, or a gust of wind comes along, or the floor vibrates by 1 micron, we are near the 0.2 limit, distributed across the pixel for the duration of the motion. So, we should ALWAYS design systems for real-world conditions, and we should ALWAYS design conservatively. There is no "magic bullet;" no free lunch. We all live in the world of physics. If anything, a portable system is MORE susceptible to factors such as vibration, as opposed to a production system, where vibration factors can be minimized or designed out fundamentally.

Now back to the topic: the crucial part of this is that for a portable system, with fixed triangulation between cameras, there is a high accuracy penalty for this "convenience" of a portable system. In many cases, it is better to optimize a system around other factors than portability.

To be clear: taking a portable system, and mounting it in a production environment does NOT make it a production system.

In future posts, we'll talk more about how to achieve better triangulation, better feature-finding, and generally how to handle a range of accuracy requirements. But, for now, it's clear that a "portable" scanner setup is NOT always the best approach, especially when high accuracy is concerned! Why? (Among other things...) Limited triangulation!