The Match3D is a tool that aligns 3D surfaces with the so called "best fit" approach. The output is a sal3d::Movement3D corresponding to the rigid 3D transformation mapping the scanned surface to the model surface. Additionally, an using the SAL3D Core, both surfaces can be subtracted, once they are aligned for obtaining a comparison measure or disparity map between them.

The comparison of the surfaces is useful in Quality Control applications. One object can be classified as "good" or "bad" by comparing itself to a reference object. In Machine Vision, an important restriction exists in order to compare two objects. For doing so, they must be aligned, in other words, perfectly matched before they can be compared.

Aligning two 3D surface can be made by mechanical means guiding the part under inspection with accurate positioning systems while a scanning system acquires the 3D shape. This approach is the one used by current CMMs. When using a mechanical system, the representation of the model in the computer's memory is aligned with the scanned surface, the accuracy being entirely up to the mechanical limitations and tolerances.

The mathematical alignment used in Match3D characterizing the alignment process, uses an iterative algorithm that "moves" the scanned surface closer and closer to the model's surface at each iteration. The algorithm can be applied for highly accurate surfaces given an initial small misalignment, typically ±10 degrees in any of the three axis (X Y and Z).

Match3D input data

The Match3D accepts COP's and SurfacePoints as model data, only COP's are accepted as part data. The SurfacePoints is a list of points with their associated normal.

This COP data could be obtained from several ways:

In case of aligning COPs directly created by the user, instead of using SAL3D conversion from range map to COP, assure you COP is correctly fill to get proper alignments. For more information, please, take a look to the section COP.

Alignment Restrictions

The Match3D tool has limitations in aligning surfaces when these are located "far" from each other. In addition, flat areas do not contribute to the alignment, and symmetries are not distinguished (a sphere will be aligned with respect to two axis, but not with the third one, the axis of symmetry).

The section How to evaluate the library describes some common Possible reasons of Match3D misalignments

Main Match3D advantages

In addition, the Match3D Tool allows the user to introduce an initial pre-alignment movement. This functionality allows fast, robust, and accurate alignments when the user knows an approximation of the motion between views. This could be interesting when the user wants to capture the same object from different view points, and he knows an estimation of the motion, but the accuracy of the motion is not good enough to assure a good alignment.

Match3D prealignment applications: combine COPs from multiple views with innacurate motion estimation.

The following figure presents two 3D surfaces, the one displayed with green color belongs to the model (golden model or reference object) and the red one, the currently scanned part being inspected. On the left, both surfaces are shown as acquired before the alignment. On the right, the visualization of the same surfaces after alignment.

Alignment process; a) Model and part surfaces before alignment; b) Same surfaces after alignment

Disparity Maps or bidimensional representation of the differences between two COPs

Once the scanned surface has been aligned to the model, the comparison of both surfaces is performed by a point-to-point subtraction between corresponding points of model and part. The output of this process is a signed float image containing the differences for each pixel of the model and part surfaces.

This disparity map can be represented in different modes to get a better understanding of the differences between model and part.

Different representations of the Disparity map: a) Between tolerance; b) Between min and max values; c) Grayscale representation.

The left image scales the ZMap values on the range [-tolerance, tolerance], where tolerance is a user defined value. On that representation, green color means zero difference between the model and the part, while red color means that the part is higher than the model, and blue means the part is lower than the model. Colors between red and green or between blue and green represents errors smaller than the tolerance. The wxMatch3D example uses this representation to display the ZMap.

The center image scales the ZMap values on the range defined by the min and max values of the ZMap. So, the green value does not always mean zero difference, depending on the min and max values. The wxCore example uses this representation to display the ZMap.

The right image corresponds to a grayscale representation of the ZMap.

The SAL3D library allows to export a ZMap to a 8 bits image (bmp, png, etc.). In that case, the user should choose the interval to scale the floating point values between 0 and 255. (User is referred to sal3d::ZMap::getFrame () and sal3d::normalize (), to convert a ZMap to a Frame, and to scale it on the user defined range.

Disparity Maps are internally represented as ZMap objects.Alternatively, they can be obtained as the subtraction of two ZMaps or by the subtraction of the model ZMap with the COP part, including the movement that aligns this COP part to the model part.

Types of Disparity Maps

SAL3D library includes two types of Disparity Map.

Types of Disparity Map
Direct Disparity Map
Fine Disparity Map

Disparity Maps and inspection operations.

The Disparity Map finds its direct application in Quality Control operations, distinguishing between good parts and bad parts related to their tolerances. As the Disparity Map is a bidimensional image, it is easy to combine with several acceptance criteria, as number of pixels greater than a threshold, max value great than a threshold, etc. It is also possible to only apply these criteria on some predefined parts. In addition, as ZMap is calibrated, it is also possible to determine areas or volumes of defects.

Use of Match3D to align your data before 2D processing

The Match3D is not only a tool for computing disparities between model and part. This tool could be also used to align part ZMap before applying the 2D processing on it. This further process could be done combining the ZMap with 2D libraries.

Consider the case that your 2D library allows you to define some ROIs where to make some computations (i.e estimate the hole radius). You could use a ZMap of an object to define these ROIs over it. However, then you need to get always the ZMap in the same orientation, otherwise, the generated ZMap does not have a relation with the previous defined ROIs. Match3D tool could be used to align all parts to the model, so, then, all ZMaps are represented on the same coordinates.

Generated ZMaps overlapping the same ROI; a) Model; b) Part; C) Aligned Part

Combining the Match3D and the ZMap, user could define some ROIs on the model ZMap, then, align each acquired surface with the model, and then generated the ZMap of the moved surface. After that, both ZMaps are represented on the same coordinates (see next scheme).

Scheme to related acquired ZMaps with user defined ROIs