Patent Publication Number: US-8111904-B2

Title: Methods and apparatus for practical 3D vision system

Description:
BACKGROUND OF THE INVENTION 
     The invention pertains to machine vision and, more particularly, three-dimensional (3D) machine vision. The invention has application in manufacturing, quality control, and robotics, to name but a few fields. 
     Machine vision refers to the automated analysis of images to determine characteristics of objects represented in them. It is often employed in automated manufacturing lines, where images of components are analyzed to facilitate part-picking, as well as to determine part placement and alignment for assembly. When robots are the means for automated assembly and automated analysis of images is used to facilitate part picking, placement, and alignment, the system is referred to as vision-guided robotics. Machine vision is also used for robot navigation, e.g., to insure the recognition of scenes as robots travel through environments. 
     Though three-dimensional (3D) analysis has long been discussed in the literature, most present-day machine vision systems rely on two-dimensional (2D) image analysis. This typically necessitates that objects under inspection be “presented to” the vision system in constrained orientations and locations. A conveyor belt is commonly used for this purpose. Objects being assembled or inspected are typically placed at a particular known, stable, 3D configuration on the belt, but at an unknown position and orientation and moved to within the vision system&#39;s field of view. Based on an object&#39;s 2D pose (i.e., position and orientation) in the field of view, and taking into account that it is disposed on the conveyor (thereby, rendering certain its “lie” and its distance from the vision system camera), the system applies 2D geometry to determine the object&#39;s exact 3D pose and/or conformance with expected appearance. 
     Examples using such 2D vision analysis are provided in prior works of the assignee hereof, including U.S. Pat. No. 6,748,104, entitled “Methods and apparatus for machine vision inspection using single and multiple templates or patterns”, U.S. Pat. No. 6,639,624, entitled “Machine vision methods for inspection of leaded components”, U.S. Pat. No. 6,301,396, entitled “Non-feedback-based machine vision methods for determining a calibration relationship between a camera and a moveable object”, U.S. Pat. No. 6,137,893, entitled “Machine vision calibration targets and methods of determining their location and orientation in an image”, U.S. Pat. No. 5,978,521, entitled “Machine vision methods using feedback to determine calibration locations of multiple cameras that image a common object”, U.S. Pat. No. 5,978,080, entitled “Machine vision methods using feedback to determine an orientation, pixel width and pixel height of a field of view”, U.S. Pat. No. 5,960,125, entitled “Nonfeedback-based machine vision method for determining a calibration relationship between a camera and a moveable object,” U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multi-dimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, entitled “Fast high-accuracy multi-dimensional pattern inspection,” to name a few. 
     With the increased reliance on robotics, everywhere from the factory floor to the home, the need for practical 3D vision systems has come to the fore. This is because, in many of these environments, objects subject to inspection are not necessarily constrained in overall position and lie, e.g., as might otherwise be the case with objects presented on a conveyor belt. That is, the precise 3D configuration of the object may be unknown. 
     To accommodate the additional degrees of freedom of pose and position in a 3D scene, 3D vision tools are helpful, if not necessary. Examples of these include U.S. Pat. No. 6,771,808, entitled, “System and method for registering patterns transformed in six degrees of freedom using machine vision”, and U.S. Pat. No. 6,728,582, entitled, “System and method for determining the position of an object in three dimensions using a machine vision system with two cameras.” 
     Other machine vision techniques have been suggested in the art. Some require too much processor power to be practical for real-time application. Others require that objects subject to inspection go though complex registration procedures and/or that, during runtime, many of the objects&#39; features be simultaneously visible in the vision system field-of-view. 
     Outside the machine vision realm, the art also provides contact-based methods of determining 3D poses—such as using an x,y,z measuring machine with a touch sensor. However, this requires contact, is relatively slow and can require manual intervention. Electromagnetic wave-based methods for determining 3D poses have also been offered. These do not require physical contact, but suffer their own drawbacks, such as requiring the oft impractical step of affixing transmitters to objects that are subject to inspection. 
     An object of this invention is to provide improved methods and apparatus for machine vision and, more particularly, for three-dimensional machine vision. 
     A related object of this invention is to provide such methods and apparatus as have a range of practical applications including, but not limited to, manufacturing, quality control, and robotics. 
     A further related object of the invention is to provide such methods and apparatus as permit determination of, for example, position and pose in three-dimensional space. 
     A still further related object of the invention is to provide such methods and apparatus as impose reduced constraints, e.g., as to overall position and lie, of objects under inspection. 
     Yet still a further related object of the invention is to provide such methods and apparatus as minimize requirements for registration of objects subject to inspection. 
     Still yet a further object of the invention is to provide such methods and apparatus as can be implemented in present day and future machine vision platforms. 
     SUMMARY OF THE INVENTION 
     The foregoing are among the objects attained by the invention, which provides inter alia methods and apparatus for determining the pose,e.g., position along x-, y- and z-axes, pitch, roll and yaw (or one or more characteristics of the pose) of an object in three dimensions by triangulation of data gleaned from multiple images of the object. 
     Thus, for example, in one aspect, the invention provides a method for 3D machine vision in which, during a calibration step, multiple cameras disposed to acquire images of the object from different respective viewpoints are calibrated to discern a mapping function that identifies rays in 3D space emanating from each respective camera&#39;s lens that correspond to pixel locations in that camera&#39;s field of view. In a training step, functionality associated with the cameras is trained to recognize expected patterns in images to be acquired of the object. A runtime step triangulates locations in 3D space of one or more of those patterns from pixel-wise positions of those patterns in images of the object and from the mappings discerned during the calibration step. 
     Further aspects of the invention provide methods as described above in which the runtime step triangulates locations from images of the object taken substantially simultaneously by the multiple cameras. 
     Still further objects of the invention provide such methods including a re-calibration step in which runtime images of the object are used to discern the aforementioned mapping function, e.g., for a camera that has gone out of calibration. Thus, for example, if one camera produces images in which the patterns appear to lie at locations (e.g., when mapped to the 3D rays for that camera) inconsistent and/or in substantial disagreement with images from the other cameras (e.g,. when mapped using their respective 3D rays), pattern locations determined with the images from those other cameras can be used to re-calibrate the one camera. 
     Yet still further aspects of the invention provide methods as described above in which the calibration step includes positioning registration targets (such as bulls eyes, cross-hairs, or the like, e.g., on calibration plates or otherwise) at known positions in 3D space and recording—or otherwise characterizing, e.g., algorithmically—correlations between those positions and the pixel-wise locations of the respective targets in the cameras&#39; fields of view. Related aspects of the invention provide such methods in which one or more of those registration targets, calibration plates, etc., are used to calibrate multiple cameras at the same time, e.g., by way of simultaneous imaging. 
     Other aspects of the invention provide methods as described above in which the calibration step includes discerning a mapping function for each camera that takes into account warping in the field of view. 
     Further aspects of the invention include methods as described above in which the training step includes training functionality associated with the cameras to recognize expected patterns, such as letters, numbers, other symbols (such as registration targets), corners, or other discernible features (such as dark and light spots) of the object and, for example, for which measurement techniques and search/detection models are known in the art. 
     Further related aspects of the invention provide such methods in which the training step includes training the aforementioned functionality as to the “model points,”—i.e., expected locations in 3D space of the patterns (e.g., in absolute or relative terms) on objects that will be inspected at runtime. In combination with the triangulated 3D locations discerned from those images, that information can be used, during the runtime step, to discern the pose of that object. 
     According to aspects of the invention, training as to expected locations of the patterns (i.e., model points) includes finding 2D poses of a reference point (or “origin”) of each such pattern. For patterns that are expected to appear in the fields of view of two or more cameras, such reference points facilitate triangulation, as described below, for purposes of determining the position of those patterns (and, therefore, of the object) in 3D space. 
     Related aspects of the invention provide such methods in which training as to expected patterns includes utilizing—within the functionality associated with each camera—like models for training like expected patterns as between different cameras. This has the benefit of insuring that the reference points (or origins) for patterns found at runtime will coincide as between images obtained by those different cameras. 
     Further related aspects of the invention provide such methods in which training as to expected patterns includes utilizing—within the functionality associated with each camera—different models for like patterns as between different cameras. This facilitates finding patterns, e.g., when pose, viewing angle and/or obstructions alter the way that different cameras will image those patterns. 
     Related aspects of the invention provide such methods that include training the selection of reference points (or origins) of patterns so modeled. Such training can be accomplished, for example, by an operator, e.g., using a laser pointer or otherwise, in order to insure that those reference points (or origins) coincide as between images obtained by those different cameras. 
     Related aspects of the invention provide such methods in which the training step includes discerning the location of the patterns, for example, by utilizing a triangulation methodology similar to that exercised during the runtime phase. Alternatively, the expected (relative) locations of the patterns can be input by the operators and/or discerned by other measurement methodologies. 
     Further related aspects of the invention provide such methods in which the training step includes finding an expected pattern in an image from one (or more) camera(s) based on prior identification of that pattern in an image from another camera. Thus, for example, once the operator has identified an expected pattern in an image taken from one camera, the training step can include automatically finding that same pattern in images from the other cameras. 
     Still further aspects of the invention provide methods as described above in which the training step acquires multiple views of the object for each camera, preferably, such that the origins of the patterns found on those objects are consistently defined. To account for potential inconsistency among images, that produce the highest match score for the patterns can be used. This has the benefit of making the methodology more robust to finding parts in arbitrary poses. 
     Yet in still other aspects of the invention, the runtime step includes triangulating the position of one or more of the patterns in runtime images, e.g., using pattern-matching or other two-dimensional vision tools, and using the mappings discerned during the calibration phase to correlate the pixel-wise locations of those patterns in the respective camera&#39;s fields of view with the aforementioned 3D rays on which those patterns lie. 
     According to related aspects of the invention, triangulation of pattern location may be by “direct” triangulation, e.g., as where the location of a given pattern is determined from the point of intersection (or the point of least squares fit) of multiple 3D rays (from multiple cameras) on which that pattern lies. Alternatively, or in addition, triangulation may be “indirect,” as where the location of a given pattern is determined not only from the ray (or rays) on which that pattern lies, but also from (i) the rays on which the other patterns lie, and (ii) the relative locations of those patterns to one another (e.g., as determined during the training phase). 
     Other aspects of the invention provide methods as described above in which functionality associated with the cameras “times out” if it fails to find an expected pattern in an image of an object—during training or runtime—thereby avoiding undue delay in position determination, e.g., if such a pattern is missing, occluded or otherwise not detected. 
     Yet still other aspects of the invention parallel the methods described above in which ID matrix codes (or other patterns whose appearance and/or positions are pre-defined or otherwise known) are used in place of the patterns discussed above. In these aspects of the invention, the training step is obviated or reduced. Instead, the 2D positions of those codes (or other patterns) can be discerned from the training-phase or runtime images, e.g., by vision tools designed for generic types of features, in order to map to 3D locations. 
     Still other aspects of the invention provide machine vision systems, e.g., including digital processing functionality and cameras, operating in accord with the methods above. These and other aspects of the invention are evident in the drawings and in the description that follows. 
     A still further related aspect of the invention provides such methods and apparatus as permit the inspection of an object, e.g. to determine and validate relative positions of portions thereof. Such methods and apparatus can be used, by way of non-limiting example, to support inspection and verification, for example, during an assembly, quality assurance, maintenance or other operation. 
     Further related aspects of the invention provide such methods and apparatus which infer the absence or misplacement of a part (or other portion) of an object in instances where one or more expected patterns (e.g., associated with that part/portion) are absent from runtime images or are present in those images, but at pixel locations that map to 3D locations that are not expected or desirable. 
     Still further related aspects of the invention provide such methods and apparatus wherein, during the runtime step, the positions of parts or other portions of the object are determined based on subsets of 3D locations corresponding to patterns found in runtime images, and wherein those 3D locations are used to determine expected locations of still further patterns. The expected locations of those further patterns can be compared with their actual 3D locations, e.g., as determined from the runtime images. Where positional differences identified in the comparison exceed a designated tolerance, the system can generate appropriate notifications (e.g., to the operator). 
     Advantages of systems and methods according to the invention are that they are easier to use and more practical than prior art systems approaches—yet, are vision-based and, hence, do not require contact with or prior preparation of objects subject to inspection. Such systems and methods (according to the invention) can be easily setup, and then trained using “show-and-go”. 
     In addition, they provide speedy performance and robustness, e.g., with respect to missing and incorrect results. Thus, for example, methods and apparatus according to aspects of the invention can determine the pose of objects even though some patterns are not found in some (and, under some circumstances, any) of the runtime images, e.g., because the patterns are occluded from view by one or more cameras or because images of those patterns could not be timely acquired. By way of further example, methods and apparatus according to aspects of the invention provide robustness with respect to incorrect results (e.g., caused by misaligned cameras) by triangulating using subsets of the 3D locations corresponding patterns found in runtime images: if one of the subsets results in a lower sum-squared error, that subset can be used for position triangulation, rather than all of the patterns. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       A more complete understanding of the invention may be attained by reference to the drawings, in which: 
         FIG. 1  depicts a digital data processor configured for practice of the invention; 
         FIG. 2  is a flow-chart depicting operation of a system according to the invention; 
         FIG. 3  depicts calibration of a system according to the invention; and 
         FIGS. 4A-4B  depict training and/or runtime operation of a system according to the invention. 
     
    
    
     DETAILED DESCRIPTION OF THE ILLUSTRATED EMBODIMENT 
       FIG. 1  depicts a machine vision system  10  according to the invention capable of determining the pose of an object  12  in three dimensions by triangulation of data gleaned from multiple images of the object. In the illustrated embodiment, the pose is defined position and orientation of the object in three-dimensional space—or, more precisely, the position of the object along x-, y- and z-axes  14 ,  16 ,  18  as well the object&#39;s pitch, roll and yaw relative thereto. In other embodiments, pose might be limited to subsets of these spatial characteristics (e.g., position along axis  16  and yaw; position along axes  14 - 18 ; roll; etc.). Illustrated axes  14 - 18  are aligned with a frame  20  of the vision system  10 ; though, in other embodiments, other frames of reference may be used. Frame  20  of the illustrated embodiment is figuratively represented by camera mounts  20   a  and platform  20   b  depicted with heavy shading; though, in other embodiments, other or no such members need be employed. 
     System  10  further includes digital data processor  22  and image acquisition devices  24 . Digital data processor  22 , here, depicted as an iMac® G5 personal computer for simplicity, may be a mainframe computer, workstation, personal computer (e.g., running a Windows®/Intel Pentium 4 platform, or otherwise), dedicated vision computer, embedded processor or other digital data device, running an proprietary, open source or other operating system, that is programmed or otherwise configured in accord with the teachings hereof to determine the pose of object  12  from images supplied by acquisition devices  24 . The digital data processor may include a display  22   a , as shown, as well as keyboard  22   b , mouse  22   c  and other input/output devices, all of the type known in the art. 
     Image acquisition devices  24  may be machine vision cameras, video cameras, still cameras or other devices capable of acquiring images of object  12  in the visible or other relevant spectrum. Without loss of generality, in the text that follows the devices  24  are typically referred to as “cameras”—though, in practice, they may comprise any manner of image acquisition functionality. In the illustrated embodiment, three such devices  24  are shown, though, in practice any plurality of devices (e.g., two or more) may be employed. Those devices are disposed to acquire images of the object  24  from different respective viewpoints. It will also be appreciated to those skilled in the art that, in some embodiments, the 3D pose of an object under inspection can also be determined using images from a single such device  24  and, hence, that not all embodiments require images from multiple cameras. 
     Digital data processor  22  further includes a central processor (CPU), memory (RAM) and input/output (I/O) functionality of the type known in the art, albeit programmed for operation in accord with the teachings hereof. 
     Particularly, in the illustrated embodiment, these are configured to provide 3D machine vision in accord with the method shown in  FIG. 2 . There, in calibration step  30 , each of the multiple cameras  24  is calibrated to discern a respective mapping function that identifies rays in 3D space emanating from that camera&#39;s lens and that correspond to pixel locations in that camera&#39;s field of view. 
     Referring to  FIG. 3 , in this regard, the calibration step includes positioning registration targets (such as bulls eyes, cross-hairs, or the like, e.g., on calibration plates  40  or otherwise) at known positions in 3D space and recording—or otherwise characterizing, e.g., algorithmically—correlations between those positions and the pixel-wise locations of the respective targets in the cameras&#39; fields of view. Preferably, this mapping takes into account warping in the field of view of each respective camera  24 . 
     In the illustrated embodiment, the registration targets, calibration plates  40 , etc., are used to calibrate multiple cameras  24  at the same time, e.g., by way of simultaneous imaging. Thus, by way of example, the operator can place a target in the field of view of two or more of the image acquisition devices  24 , which simultaneously image the target for calibration purposes. Where calibration plates  40 , or the like, are used for calibration, they preferably show a fiducial  41  (e.g., a unique pattern which differs from the uniform checkerboard pattern) at an origin so that all acquisition devices  24  can be calibrated with respect to the same unique reference point with specified orientation. By so calibrating the devices  24  in a consistent manner, they can all be used to map from their image coordinates (e.g., the pixel-wise locations of pattern origins) to a common reference point or frame. Preferred such fiducials are asymmetric, as in the case of the L-shaped fiducial in the drawing. 
     Underlying methodologies and apparatus for such calibration are taught, by way of non-limiting example, in U.S. Pat. No. 6,748,104, entitled “Methods and apparatus for machine vision inspection using single and multiple templates or patterns”, U.S. Pat. No. 6,639,624, entitled “Machine vision methods for inspection of leaded components”, U.S. Pat. No. 6,301,396, entitled “Nonfeedback-based machine vision methods for determining a calibration relationship between a camera and a moveable object”, U.S. Pat. No. 6,137,893, entitled “Machine vision calibration targets and methods of determining their location and orientation in an image”, U.S. Pat. No. 5,978,521, entitled “Machine vision methods using feedback to determine calibration locations of multiple cameras that image a common object”, U.S. Pat. No. 5,978,080, entitled “Machine vision methods using feedback to determine an orientation, pixel width and pixel height of a field of view”, U.S. Pat. No. 5,960,125, entitled “Nonfeedback-based machine vision method for determining a calibration relationship between a camera and a moveable object,” U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multi-dimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, entitled “Fast high-accuracy multi-dimensional pattern inspection,” the teachings of all of which are incorporated herein by reference. The methodologies and apparatus described in the latter three patents are referred to elsewhere herein by the name “PatMax.” 
     In an optional training step  32 , a module (e.g., a code sequence, subroutine, function, object, other data structure and/or associated software, or other functionality) associated with each respective camera  24  is trained to recognize expected patterns in images to be acquired, during runtime, of the object  12 . These may be letters, numbers, other symbols (such as registration targets), corners, or other features (such as dark and light spots) that are expected to be discernible in the runtime images of the object  12  and, for example, for which measurement techniques and search/detection models are known in the art. Those patterns may be permanently part of, or affixed to, the object. However, they may also be temporary, e.g., as in the case of removable calibration targets. Indeed, they need not be even physically associated with the object. For example, they may be optically or otherwise projected onto objects that are imaged during training and/or runtime phases, e.g., by a laser or other apparatus. 
     In addition to training the modules or other functionality associated with each camera  24  to recognize pattern, training step  32  of the illustrated embodiment includes training them as to the model point locations, i.e., the expected locations of the patterns, e.g., relative to one another (i.e., in 3D space) on objects that will be inspected during runtime. This can be, for example, by utilizing a triangulation methodology similar to that exercised during the runtime phase. Alternatively, the expected (relative) locations of the patterns can be input by the operator and/or discerned by other measurement methodologies (e.g., rulers, calipers, optical distance gauges, and so forth). 
     Regardless of whether the triangulation or other methodologies are used, the training step  32  preferably includes training the modules or other functionality or other functionality associated with each camera  24  as to a reference point (or “origin”) of each such trained pattern. For patterns that are expected to appear in the fields of view of two or more cameras, training as to such reference points facilitate direct and indirect triangulating of the position of those patterns and/or of the object in 3D space. 
     In the illustrated embodiment, such training can be effected by using like models (e.g., “PatMax”, or so forth) for training like expected patterns as between different cameras  24 . This has the benefit of insuring that the reference points (or origins) for patterns found at runtime will coincide as between images obtained by those different cameras. 
     Where pose, viewing angle and/or obstructions alter the way that different cameras  24  will view like patterns, such training can include utilizing different models (for like patterns) as between different cameras. Since different models may tend to identify different reference points for like patterns, the illustrated embodiment permits an operator to train the selection of like reference points for like patterns. 
     This can be accomplished, by way of example, during training step  32 , by simultaneously acquiring images of the pattern from multiple cameras  24  (to be used as a template for searching in step  34 ) and, then, shining a laser pointer at the object. From images acquired with the laser shining, the 3D location of the laser point can be computed, thereby, defining coincident origins on all images of the patterns. (Though described, here, with respect to use disparate models for pattern training, this technique can be applied, as well, in instances where like models are used). To this end, using the images with and without the superfluous laser pointer spot, auto Thresholding and blob analysis can be run to find the center of the spot in all the images, and thereby to determine consistent coincident origins. As discussed elsewhere herein, triangulation can be used to get the 3D position of the spot, thereby, permitting use of this technique for multiple patterns on the (training) object provided, for example, that it does not move. 
     According to one preferred practice of the invention, the training step  32  includes finding an expected pattern in an image from one (or more) camera(s)  24  based on prior identification of that pattern in an image from another camera. Thus, for example, once the operator has identified an expected pattern in an image taken from one camera, the training step can include automatically finding that same pattern in images from the other cameras. 
     In preferred embodiments, step  32  includes acquiring multiple views of the object for each camera  24 , preferably, such that the origins of the patterns found on those objects are consistently defined. To account for potential inconsistency among images, those that produce the highest match score for the patterns can be used. This has the benefit of making the methodology more robust to finding parts in arbitrary poses. 
     As noted above, the training step  32  is optional: in some embodiments of the invention, it is employed in reduced capacity or not at all. For example, if the patterns expected at runtime are susceptible to search via a blob model (e.g., one that looks for bright features), then no patterns training is required—though, position training of the type described above will still be employed. Such is also true, by way of further example, if the patterns are ID matrix codes (or other patterns whose appearance and/or positions are pre-defined or otherwise known) are used in place of the trainable patterns discussed above. Here, the 2D positions of those codes (or other patterns) are discerned from the training-phase or runtime images, e.g., by vision tools designed for generic types of features, in order to map to 3D locations. Such implementations of the invention are useful because industrial parts might always have ID Matrix codes, and multiple training-less sensors could thereby output 3D positions of the ID Matrix code. Furthermore, since an ID Matrix code spans a rectangular area all of the sensors could output the 2D positions of the 4 corners; furthermore, if the ID Matrix is printed with a particular process, then we can know the 3D positions (by virtue of the found size/type of the code) and compute 3D pose. 
     In runtime step  34 , the digital data processor  22  triangulates locations in 3D space of one or more of patterns  42   a - 42   c  on the object  12  based on pixel-wise positions of representations of those patterns in runtime images of the object  12  and from the mappings discerned during calibration step  32 . In the illustrated embodiment, those runtime images are preferably acquired simultaneously, or substantially simultaneously, of the object  12  by the devices  24 . In this regard, substantially simultaneously refers to image acquisition occurring so nearly close in time that movement of the object  12 , devices  24 , frame  20 , or otherwise, does not substantially affect the pixel-wise location of patterns in the runtime images and/or mappings determined therefrom. Such simultaneous acquisition can be achieved by firing the cameras  24  at the same time (or nearly so) or by other means—including, for example, stroboscopically illuminating the imaged object while the camera  24  shutters are open. 
     In the illustrated embodiment, position triangulation is accomplished using pattern matching or other two-dimensional vision tools to discern the pixel-wise location of patterns in the runtime images, and using the mappings discerned during the calibration phase to correlate the pixel-wise locations of those patterns in the respective camera&#39;s  24  fields of view with the aforementioned 3D rays on which those patterns lie. Examples using such 2D vision tools include aforementioned, incorporated-by-reference U.S. Pat. Nos. 6,748,104, 6,639,624, 6,301,396, 6,137,893, 5,978,521, 5,978,080, 5,960,125, 6,856,698, 6,850,646, and 6,658,145. 
     Triangulation of pattern location may be by “direct” triangulation, e.g., as where the location of a given pattern is determined from the point of intersection of multiple 3D rays (from multiple cameras) on which that pattern lies. Alternatively, or in addition, triangulation may be “indirect,” as where the location of a given pattern is determined not only from the ray (or rays) on which that pattern lies, but also from (i) the rays on which the other patterns lie, and (ii) the relative locations of those patterns to one another (e.g., as determined during the training phase) on the imaged object. 
     In the illustrated embodiment, direct and/or indirect triangulation can utilize “least squares fit” or other such methodologies for finding points of intersection (or nearest intersection) as between or among multiple 3D rays (from multiple cameras  24 ) on which pattern(s) appear to lie. For example, where images acquired from two or more cameras  24  indicate that a given pattern (and, more precisely, the apparent origin of that pattern) lies on two or more rays, a least squares fit methodology can be employed to determine a location of intersection of those rays in 3D space or a nearest point thereto (i.e., a point in space that lies nearest those rays). Likewise, where images from the cameras  24  indicate origins for multiple patterns on multiple rays, a least squares fit can be employed using the model points of those patterns on the object to determine the most likely locations of the patterns and/or the object itself. 
     The illustrated embodiment utilizes an optimizer (or “solver”) to find the least squares (or root mean square) fit of rays and patterns. This can be a general purpose tool of the type available in the art and/or it can operate in the manner detailed below. In any event, during runtime step  34 , the solver is supplied with definitions of the 3D rays on which the patterns (and, more precisely, the pattern origins) identified from the runtime images lie, as well as (where relevant) the locations or relative locations of the patterns on the object. 
     Typically, this information defines an over-constrained system (i.e., more information is supplied by way of ray definitions and relative pattern locations on the object than is necessary to infer the actual locations), a fact on which the illustrated system capitalizes for purposes of robustness. Thus, for example, the runtime step  34  can determine object pose, e.g., even where patterns are missing from the object or its runtime image (e.g., as where a pattern is occluded from one or more camera views, or where lighting or other conditions to not permit timely acquisition of a pattern image). And, by way of further example, the runtime step  34  can include trying subsets of the pattern origins (and, more precisely, subsets of the locations corresponding to pattern origins) found by the acquisition devices  24  in order to minimize the root mean square (RMS) error of the fit between the rays and the model points or the triangulation of the rays. If one of the subsets has a lower sum squared error, that subset can be used for position triangulation, rather than all of the pattern origins. 
     Typically, this information defines an over-constrained system (i.e., more information is supplied by way of ray definitions and relative pattern locations on the object than is necessary to infer the actual locations), a fact on which the illustrated system capitalizes for purposes of robustness. Thus, for example, the runtime step  34  can determine object pose, e.g., even when certain patterns are intentionally omitted from consideration (e.g., so as to inspect/validate a pattern&#39;s position by comparing it to the position predicted by the other found patterns). 
     And, by way of further example, the runtime step  34  can include trying subsets of the pattern origins (and, more precisely, subsets of the locations corresponding to pattern origins) found by the acquisition devices  24  in order to minimize the root mean square (RMS) error of the fit between the rays and the model points or the triangulation of the rays. Then, the step can extrapolate the 3D position of the patterns which were not included in the subset (i.e., that were intentionally omitted as mentioned above) and predict the 2D image positions in their respective cameras. The predicted image position can be compared to the actual measured image position: if the distance between the predicted image position and the actual measured image position exceeds some user-specified distance tolerance, then the system can generate an appropriate warning or other notification. Alternatively, or in addition, the extrapolated 3D positions of the omitted patterns can be compared against 3D positions determined by triangulation; again, where the distance between extrapolated (predicted) and actual positions differ, the runtime step  34  can include generating an appropriate warning or other notification. 
     In order to improve the speed of pattern recognition, during both training and runtime phases, the illustrated embodiment can exploit the found position of one pattern to limit the search degrees of freedom for the other pattern. For example, if a first camera  24  finds the pattern at 15 degrees, and another camera is approximately in the same orientation as the first camera, then it may only need to look for the pattern at orientations 15+/−10 degrees. In addition, given the origin&#39;s position from one camera, we know that the origin will lie along a 3D ray; thereby, we can project that ray onto the second camera&#39;s field of view, and only look for the pattern along that line. 
     If two patterns are confusable (i.e., there are two instances similar to the pattern in the camera&#39;s field of view), the illustrated embodiment can try all of the different possible correspondences. For example, using the technology described in aforementioned, incorporated-by-reference U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multidimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, and entitled “Fast high-accuracy multi-dimensional pattern inspection,” patterns such as the character sequences “P”, “ST”, “It”, and “Notes” (from a POST-IT® Notes label) are all different, so when a match is found, we know it is a correct match. 
     Alternatively, the machine vision tool known as “blob” analysis can be used to find patterns (e.g., if they are dark holes). In this case, it could be hypothesized that blob #1 corresponds to 3Dmodel point 1, and blob#2 corresponds to 3Dmodel point2, etc. If that doesn&#39;t work, then the analysis can move on to the next hypothesis: that blob #2 corresponds to 3D model point #2, and blob#1 corresponds to 3D model point #1. 
     A more complete understanding of the triangulation process of the illustrated embodiment may be appreciated from the discussion that follows. 
     To intersect n 3D rays (i.e., to find the point which minimizes the sum squared distance to n 3D rays), first characterize each ray as two separate orthogonal planes (since the squared distance from a point to a ray is the sum of the squared distances of the point to two orthogonal planes intersecting that ray). This is exemplified by the C++ code below: 
     
       
         
           
               
             
               
                   
               
             
            
               
                 static void solveMinimizeSquareErrorEquations( 
               
            
           
           
               
               
            
               
                   
                 const cmStd vector&lt;cc3Vect&gt; &amp;eqs, 
               
               
                   
                 const cmStd vector&lt;double&gt; &amp;val, 
               
               
                   
                 cc3Vect &amp;ans, 
               
               
                   
                 double &amp;rmsError) 
               
            
           
           
               
            
               
                 { 
               
               
                  int size = eqs.size( ); 
               
               
                  assert(size==val.size( )); 
               
               
                  ccNMMatrix func(size,3); 
               
               
                  ccNMMatrix vals(size,1); 
               
               
                  int i; 
               
               
                  for (i = 0; i &lt; size; ++i) 
               
               
                  { 
               
               
                   func.element(i,0,eqs[i].x( )); 
               
               
                   func.element(i,1,eqs[i].y( )); 
               
               
                   func.element(i,2,eqs[i].z( )); 
               
               
                   vals.element(i,0,val[i]); 
               
               
                  } 
               
               
                  ccNMMatrix func2 = func.Tmultiply(func); 
               
               
                  ccNMMatrix vals2 = func.Tmultiply(vals); 
               
               
                  double cnum; 
               
               
                  ccNMMatrix result = 
               
               
                   ccNMMatrix::solve (func2,vals2,true/*symmetric*/, 
               
               
                   cnum,HUGE_VAL); 
               
               
                  // throw in degenerate cases 
               
               
                  if (func2.conditionNumber(false) &gt; 1e12) 
               
               
                   throw ccMathError::Singular( ); 
               
               
                  ans = cc3Vect(result.element(0,0), 
               
            
           
           
               
               
            
               
                   
                 result.element(1,0), 
               
               
                   
                 result.element(2,0)); 
               
            
           
           
               
            
               
                  double sumSqError = 0; 
               
               
                  for (i = 0; i &lt; size; ++i) 
               
               
                  { 
               
               
                   double error = eqs[i].dot(ans)−val[i]; 
               
               
                   sumSqError += error*error; 
               
               
                  } 
               
               
                  rmsError = cfSqrt(sumSqError/size); 
               
               
                 } 
               
               
                 void cfComputePerpendiculars(const cc3Vect &amp;start1, 
               
            
           
           
               
               
            
               
                   
                 const cc3Vect &amp;end1, 
               
               
                   
                 cc3Vect &amp;perp1, 
               
               
                   
                 cc3Vect &amp;perp2) 
               
            
           
           
               
            
               
                 { 
               
               
                  cc3Vect diff = end1 − start1; 
               
               
                  cc3Vect axes[3] = {cc3Vect(1,0,0), 
               
            
           
           
               
               
            
               
                   
                 cc3Vect(0,1,0), 
               
               
                   
                 cc3Vect(0,0,1)}; 
               
            
           
           
               
            
               
                  cc3Vect crosses[3]; 
               
               
                  double lens[3]; 
               
               
                  int i; 
               
               
                  for (i = 0; i &lt; 3; ++i) 
               
               
                   crosses[i] = diff.cross(axes[i]); 
               
               
                  for (i = 0; i &lt; 3; ++i) 
               
               
                   lens[i] = crosses[i].dot(crosses[i]); 
               
               
                  int j; 
               
               
                  for (i = 0; i &lt; 2; ++i) 
               
               
                   for (j = i+1; j &lt; 3; ++j) 
               
               
                    if (lens[i] &lt; lens[j]) 
               
               
                    { 
               
               
                     double tmp = lens[i]; 
               
               
                     lens[i] = lens[j]; 
               
               
                     lens[j] = tmp; 
               
               
                     cc3Vect cross = crosses[i]; 
               
               
                     crosses[i] = crosses[j]; 
               
               
                     crosses[j] = cross; 
               
               
                    } 
               
               
                  perp1 = crosses[0] * 1./lens[0]; 
               
               
                  perp2 = crosses[1] * 1./lens[1]; 
               
               
                 } 
               
               
                 static void intersectLinesInThreeSpace 
               
               
                 (const cmStd vector&lt;cc3DLineSeg&gt; &amp;segs, 
               
               
                  cc3Vect &amp;intersection, 
               
               
                  double &amp;rmsError) 
               
               
                 { 
               
               
                  // Find point which minimizes total squared error between 
               
               
                  // segs.size( )*2 planes 
               
               
                  int size = segs.size( ); 
               
               
                  cmStd vector&lt;cc3Vect&gt; eqs(size*2); 
               
               
                  cmStd vector&lt;double&gt; vals(size*2); 
               
               
                  int i; 
               
               
                  for (i = 0; i &lt; size; ++i) 
               
               
                  { 
               
               
                   cfComputePerpendiculars(segs[i].p1( ),segs[i].p2( ), 
               
               
                   eqs[i*2],eqs[i*2+1]); 
               
               
                   vals[i*2] = segs[i].p1( ).dot(eqs[i*2]); 
               
               
                   vals[i*2+1] = segs[i].p1( ).dot(eqs[i*2+1]); 
               
               
                  } 
               
               
                  solveMinimizeSquareErrorEquations(eqs,vals,intersection,rmsError); 
               
               
                 } 
               
               
                   
               
            
           
         
       
     
     To solve for the pose which best maps the 3D points onto the corresponding 3D rays, we can say that we use the following equations (which are expressed in the Maple math package, which is commercially available from Maplesoft, a division of Waterloo Maple) which is used to generate optimized C code. 
     The approach solves for the pose (which is expressed in terms of the variables a,b,c,d,tx,ty,tz) which minimizes the sum squared error between points p (which are expressed as x,y,z) and planes expressed as (px, py, pz, pt). Note that each  3   d  ray corresponds to two such plane constraints. The approach computes the sum squared error by summing up the coefficients of the algebraic error function. And then, the approach solves for the optimal a,b,c,d,tx,ty,tz using gradient descent. Note that since there are 7 variables (a,b,c,d,tx,ty,tz) and only 6 degrees of freedom, we try 4 different cases—where a is set to 1 and the variables are b,c,d; where b is set to 1 and the variables are a,c,d; where c is set to 1 and the variables are a,b,d; and where d is set to 1 and the variables are a,b,c. 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 quatRot := 
               
               
                   
                  matrix(4,4, 
               
               
                   
                   [[a*a+b*b−c*c−d*d,2*b*c−2*a*d,2*a*c+2*b*d,tx], 
               
               
                   
                    [2*a*d+2*b*c,a*a−b*b+c*c−d*d,2*c*d−2*a*b,ty], 
               
               
                   
                    [2*b*d−2*a*c,2*a*b+2*c*d,a*a−b*b−c*c+d*d,tz], 
               
               
                   
                    [0,0,0,a*a+b*b+c*c+d*d]]); 
               
               
                   
                 val := matrix(1,4,[x,y,z,1]); 
               
               
                   
                 dot := matrix(1,4,[px,py,pz,pt]); 
               
               
                   
                 pos := multiply(quatRot,transpose(val)); 
               
               
                   
                 unit := (a*a+b*b+c*c+d*d); 
               
               
                   
                 weightMat := multiply(dot,pos); 
               
               
                   
                 weight := weightMat[1,1]/unit; 
               
               
                   
                 weightSq := expand(weight*weight); 
               
               
                   
                 weightSqDA := simplify(expand(diff(weightSq,a)*unit*unit)); 
               
               
                   
                 weightSqDB := simplify(expand(diff(weightSq,b)*unit*unit)); 
               
               
                   
                 weightSqDC := simplify(expand(diff(weightSq,c)*unit*unit)); 
               
               
                   
                 weightSqDD := simplify(expand(diff(weightsq,d)*unit*unit)); 
               
               
                   
                 weightSqDTX := simplify(expand(diff(weightSq,tx)*unit*unit)); 
               
               
                   
                 weightSqDTY := simplify(expand(diff(weightSq,ty)*unit*unit)); 
               
               
                   
                 weightSqDTZ := simplify(expand(diff(weightSq,tz)*unit*unit)); 
               
               
                   
                   
               
            
           
         
       
     
     The foregoing will be further appreciated in view of the following, in which GenericPoly( ) is a function which extracts the coefficients of a function. Thus, if the function is x*x+2*x*y+y*y, then the generic function is f0x2y0*x*x+f0x1y1*x*y+f0x0y2*y*y where f0x2y0=1, f0x1y1=2, f0x0y2=1. GenericPoly( ) is included in MARS, a Maple Matlab Resultant Solver system publicly and freely available, e.g., by way of non-limiting example from www.cs.unc.edu/˜geom/MARS. 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 read(‘genericpoly.map‘); 
               
               
                   
                 genPoly:= 
               
               
                   
                 GenericPoly(expand(eval(weightMat[1,1]*weightMat[1,1])), 
               
               
                   
                 array(1..7,[a,b,c,d,tx,ty,tz]),‘f’); 
               
               
                   
                 genPolyDA := simplify(expand(unit*diff(eval(genPoly[1]),a)− 
               
               
                   
                 eval(genPoly[1])*4*a)); 
               
               
                   
                 genPolyDB := simplify(expand(unit*diff(eval(genPoly[1]),b)− 
               
               
                   
                 eval(genPoly[1])*4*b)); 
               
               
                   
                 genPolyDC := simplify(expand(unit*diff(eval(genPoly[1]),c)− 
               
               
                   
                 eval(genPoly[1])*4*c)); 
               
               
                   
                 genPolyDD := simplify(expand(unit*diff(eval(genPoly[1]),d)− 
               
               
                   
                 eval(genPoly[1])*4*d)); 
               
               
                   
                 genPolyDTX := simplify(expand(diff(eval(genPoly[1]),tx))); 
               
               
                   
                 genPolyDTY := simplify(expand(diff(eval(genPoly[1]),ty))); 
               
               
                   
                 genPolyDTZ := simplify(expand(diff(eval(genPoly[1]),tz))); 
               
               
                   
                 C(genPolyDA); 
               
               
                   
                 C(genPolyDB); 
               
               
                   
                 C(genPolyDC); 
               
               
                   
                 C(genPolyDD); 
               
               
                   
                 C(genPolyDTX); 
               
               
                   
                 C(genPolyDTY); 
               
               
                   
                 C(genPolyDTZ); 
               
               
                   
                   
               
            
           
         
       
     
     (Note that since the error function is not just derivative(weightMat*weightMat) but it is actually (a*a+b*b+c*c+d*d)*derivative(weightMat*weightMat) minus 4*a*weightMat*weightMat (for computing the partial derivative with respect to a) (which is written as:
 
unit*diff(eval (genPoly[1]),a)−eval (genPoly[1])*4*a));)
 
     because of the chain rule for quotients:
 
deriv ( F ( x )/ G ( x ))==( G ( x )* F ′( x )− F ( x )* G ′( x ))/( G ( x )* G ( x ))
 
     note that we can ignore the square of the denominator (in the denominator of the chain rule for partial derivatives) for this analysis because the denominator (a*a+b*b+c*c+d*d) applies uniformly to all partial derivatives:
 
 d (( a*a+b*b+c*c+d*d )^2)/ da= 4* a *( a*a+b*b+c*c+d*d ))
 
     By way of further explanation of the foregoing, numerical gradient descent methods make use of an error function, as well as derivatives of that error function. The derivates of an error function can be computed numerically or symbolically. For numerically-computed derivates, one can simply change one of the variables by a small amount, and then recompute the error function, and thusly numerically compute the derivative. For symbolically computed derivatives, one needs a symbolic function corresponding to the derivative—which we have in this case because we have the algebraic expressions describing the error function, and we can symbolically differentiate that algebraic error function. 
     In the illustrated embodiment, a C data structure keeps all of the coefficients for the algebraic expression, as follows: 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 typedef struct ptRayGenericPoly 
               
               
                   
                 { 
               
               
                   
                  double fa0b0c0d0tx0ty0tz2 ; 
               
               
                   
                  double fa0b0c0d0tx0ty1tz1 ; 
               
               
                   
                  double fa0b0c0d0tx0ty2tz0 ; 
               
               
                   
                  double fa0b0c0d0tx1ty0tz1 ; 
               
               
                   
                  double fa0b0c0d0tx1ty1tz0 ; 
               
               
                   
                  double fa0b0c0d0tx2ty0tz0 ; 
               
               
                   
                  double fa0b0c0d2tx0ty0tz1 ; 
               
               
                   
                  double fa0b0c0d2tx0ty1tz0 ; 
               
               
                   
                  double fa0b0c0d2tx1ty0tz0 ; 
               
               
                   
                  double fa0b0c0d4tx0ty0tz0 ; 
               
               
                   
                  double fa0b0c1d1tx0ty0tz1 ; 
               
               
                   
                  double fa0b0c1d1tx0ty1tz0 ; 
               
               
                   
                  double fa0b0c1d1tx1ty0tz0 ; 
               
               
                   
                  double fa0b0c1d3tx0ty0tz0 ; 
               
               
                   
                  double fa0b0c2d0tx0ty0tz1 ; 
               
               
                   
                  double fa0b0c2d0tx0ty1tz0 ; 
               
               
                   
                  double fa0b0c2d0tx1ty0tz0 ; 
               
               
                   
                  double fa0b0c2d2tx0ty0tz0 ; 
               
               
                   
                  double fa0b0c3d1tx0ty0tz0 ; 
               
               
                   
                  double fa0b0c4d0tx0ty0tz0 ; 
               
               
                   
                  double fa0b1c0d1tx0ty0tz1 ; 
               
               
                   
                  double fa0b1c0d1tx0ty1tz0 ; 
               
               
                   
                  double fa0b1c0d1tx1ty0tz0 ; 
               
               
                   
                  double fa0b1c0d3tx0ty0tz0 ; 
               
               
                   
                  double fa0b1c1d0tx0ty0tz1 ; 
               
               
                   
                  double fa0b1c1d0tx0ty1tz0 ; 
               
               
                   
                  double fa0b1c1d0tx1ty0tz0 ; 
               
               
                   
                  double fa0b1c1d2tx0ty0tz0 ; 
               
               
                   
                  double fa0b1c2d1tx0ty0tz0 ; 
               
               
                   
                  double fa0b1c3d0tx0ty0tz0 ; 
               
               
                   
                  double fa0b2c0d0tx0ty0tz1 ; 
               
               
                   
                  double fa0b2c0d0tx0ty1tz0 ; 
               
               
                   
                  double fa0b2c0d0tx1ty0tz0 ; 
               
               
                   
                  double fa0b2c0d2tx0ty0tz0 ; 
               
               
                   
                  double fa0b2c1d1tx0ty0tz0 ; 
               
               
                   
                  double fa0b2c2d0tx0ty0tz0 ; 
               
               
                   
                  double fa0b3c0d1tx0ty0tz0 ; 
               
               
                   
                  double fa0b3c1d0tx0ty0tz0 ; 
               
               
                   
                  double fa0b4c0d0tx0ty0tz0 ; 
               
               
                   
                  double fa1b0c0d1tx0ty0tz1 ; 
               
               
                   
                  double fa1b0c0d1tx0ty1tz0 ; 
               
               
                   
                  double fa1b0c0d1tx1ty0tz0 ; 
               
               
                   
                  double fa1b0c0d3tx0ty0tz0 ; 
               
               
                   
                  double fa1b0c1d0tx0ty0tz1 ; 
               
               
                   
                  double fa1b0c1d0tx0ty1tz0 ; 
               
               
                   
                  double fa1b0c1d0tx1ty0tz0 ; 
               
               
                   
                  double fa1b0c1d2tx0ty0tz0 ; 
               
               
                   
                  double fa1b0c2d1tx0ty0tz0 ; 
               
               
                   
                  double fa1b0c3d0tx0ty0tz0 ; 
               
               
                   
                  double fa1b1c0d0tx0ty0tz1 ; 
               
               
                   
                  double fa1b1c0d0tx0ty1tz0 ; 
               
               
                   
                  double fa1b1c0d0tx1ty0tz0 ; 
               
               
                   
                  double fa1b1c0d2tx0ty0tz0 ; 
               
               
                   
                  double fa1b1c1d1tx0ty0tz0 ; 
               
               
                   
                  double fa1b1c2d0tx0ty0tz0 ; 
               
               
                   
                  double fa1b2c0d1tx0ty0tz0 ; 
               
               
                   
                  double fa1b2c1d0tx0ty0tz0 ; 
               
               
                   
                  double fa1b3c0d0tx0ty0tz0 ; 
               
               
                   
                  double fa2b0c0d0tx0ty0tz1 ; 
               
               
                   
                  double fa2b0c0d0tx0ty1tz0 ; 
               
               
                   
                  double fa2b0c0d0tx1ty0tz0 ; 
               
               
                   
                  double fa2b0c0d2tx0ty0tz0 ; 
               
               
                   
                  double fa2b0c1d1tx0ty0tz0 ; 
               
               
                   
                  double fa2b0c2d0tx0ty0tz0 ; 
               
               
                   
                  double fa2b1c0d1tx0ty0tz0 ; 
               
               
                   
                  double fa2b1c1d0tx0ty0tz0 ; 
               
               
                   
                  double fa2b2c0d0tx0ty0tz0 ; 
               
               
                   
                  double fa3b0c0d1tx0ty0tz0 ; 
               
               
                   
                  double fa3b0c1d0tx0ty0tz0 ; 
               
               
                   
                  double fa3b1c0d0tx0ty0tz0 ; 
               
               
                   
                  double fa4b0c0d0tx0ty0tz0 ; 
               
               
                   
                 } ptRayGenericPoly; 
               
               
                   
                   
               
            
           
         
       
     
     The illustrated embodiment also utilizes a function which adds to the coefficients of the algebraic expression (those functions take as input a 3D point (x,y,z) and a corresponding plane—characterized by px,py,pz,pt): 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 void ptRayGenericPoly_addToVals(ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double x, 
               
               
                   
                 double y, 
               
               
                   
                 double z, 
               
               
                   
                 double px, 
               
               
                   
                 double py, 
               
               
                   
                 double pz, 
               
               
                   
                 double pt); 
               
               
                   
                   
               
            
           
         
       
     
     The illustrated embodiment also utilizes a function which computes the error at a given pose (a,b,c,d,tx,ty,tz) where (a,b,c,d) are quaternion representation of the 3D rotation (roll,pitch,yaw), and (tx,ty,tz) are the translation: 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 double ptRayGenericPoly_eval(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
               
                   
                   
               
            
           
         
       
     
     The illustrated embodiment also provide functions which compute the derivatives: 
     
       
         
           
               
               
             
               
                   
                   
               
             
            
               
                   
                 double ptRayGenericPoly_DA(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericPoly_DB(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz) ; 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericPoly_DC(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericPoly_DD(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericpoly_DTX(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericPoly_DTY(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
            
           
           
               
               
            
               
                   
                 double ptRayGenericPoly_DTZ(const ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double a, 
               
               
                   
                 double b, 
               
               
                   
                 double c, 
               
               
                   
                 double d, 
               
               
                   
                 double tx, 
               
               
                   
                 double ty, 
               
               
                   
                 double tz); 
               
               
                   
                   
               
            
           
         
       
     
     For example, the function which adds to the coefficients can be expressed in a manner consistent with the exemplary excerpts that follow; the complete function is evident in view of the teachings hereof and the Maple code provided: 
     
       
         
           
               
             
               
                   
               
             
            
               
                 void ptRayGenericPoly_addToVals(ptRayGenericPoly *vals, 
               
            
           
           
               
               
            
               
                   
                 double x, 
               
               
                   
                 double y, 
               
               
                   
                 double z, 
               
               
                   
                 double px, 
               
               
                   
                 double py, 
               
               
                   
                 double pz, 
               
               
                   
                 double pt) 
               
            
           
           
               
            
               
                 { 
               
               
                  double x_2 = x*x; 
               
               
                  double y_2 = y*y; 
               
               
                  double z_2 = z*z; 
               
               
                  double px_2 = px*px; 
               
               
                  double py_2 = py*py; 
               
               
                  double pz_2 = pz*pz; 
               
               
                  double pt_2 = pt*pt; 
               
               
                  vals-&gt;fa0b0c0d0tx0ty0tz2 += pz_2; 
               
               
                  vals-&gt;fa0b0c0d0tx0ty1tz1 += 2*py*pz; 
               
               
                  vals-&gt;fa0b0c0d0tx0ty2tz0 += py_2; 
               
               
                  vals-&gt;fa0b0c0d0tx1ty0tz1 += 2*pz*px; 
               
               
                  vals-&gt;fa0b0c0d0tx1ty1tz0 += 2*py*px; 
               
               
                  vals-&gt;fa0b0c0d0tx2ty0tz0 += px_2; 
               
               
                  vals-&gt;fa0b0c0d2tx0ty0tz1 += 2*pt*pz+2*pz_2*z−2*py*y*pz−2*px*x*pz; 
               
               
                  vals-&gt;fa0b0c0d2tx0ty1tz0 += 2*pt*py−2*py_2*y−2*px*x*py+2*pz*z*py; 
               
               
                  vals-&gt;fa0b0c0d2tx1ty0tz0 += 2*pt*px−2*px_2*x−2*py*y*px+2*pz*z*px; 
               
               
                  vals-&gt;fa0b0c0d4tx0ty0tz0 += pz_2*z_2+px_2*x_2+py_2*y_2+pt_2+2*pz*z*pt− 
               
            
           
           
               
               
            
               
                   
                 2*px*x*pt−2*py*y*pt+2*px*x*py*y−2*px*x*pz*z− 
               
               
                   
                 2*py*y*pz*z; 
               
            
           
           
               
            
               
                  vals-&gt;fa0b0c1d1tx0ty0tz1 += 4*pz*z*py+4*pz_2*y; 
               
               
                  ... 
               
               
                   Note that the way that this works is that the fa...&#39;s are the coefficients and that the 
               
               
                 names of the variables encode the degree of each monomial 
               
               
                 F(a,b,c,d,tx,ty,tz) = fa0b0c0d0tx0ty0tz0+ fa0b0c0d0tx0ty0tz1 * tz + 
               
               
                 fa0b0c0d0tx0ty0tz2 * tz{circumflex over ( )}2 + fa0b0c0d0tx0ty1tz1 * ty * tz + ... 
               
               
                 And that you start with a generic zero error function 
               
               
                 fa0b0c0d0tx0ty0tz0 = 0 
               
               
                 fa0b0c0d0tx0ty0tz1 = 0 
               
               
                 ... 
               
               
                   
               
            
           
         
       
     
     Following, this a call is made to a function ptRayGenericPoly_addToVals( ) for each set of points, plane (characterized by (x,y,z,px,py,pz,pt)) and it accumulates the monomial coefficients into the sum error function. 
     Referring to optional step  36  of  FIG. 2 , the illustrated system  10  can re-calibrate image acquisition devices  24  that have gone out of alignment, e.g., if one of the cameras is nudged following calibration. (In this regard, it will be appreciated that in the illustrated embodiment, it is preferably intended that the cameras  24  remain fixed and/or stationary after calibration in order to preserve mappings determined during the calibration phase). This may be detected during location triangulation carried out in step  34  and, possible, during that carried out in step  32 . To this end, if one camera  24  produces images in which the patterns found in runtime images of an object under inspection appear to lie at locations (e.g., when mapped to the 3D rays for that camera) inconsistent and/or in substantial disagreement with images from the other cameras (e.g,. when mapped using their respective 3D rays), pattern locations determined with the images from those other cameras can be used to re-calibrate the one camera using the same calibration methodology described above in connection with step  30 . 
     In this regard, it will be appreciated that the mappings determined in step  30  (as well as in step  36 ) are decomposable into two separate effects: lens distortion, such as pincushioning and other image aberrations, which will remain constant if the camera  24  is nudged (because it is only a function of the lens and because, for example, the lens can be glued in place with respect to the CCD, CMOS or other image sensor), and the pose of the camera  24  with respect to the workspace. It is the latter—the pose—that will change if the camera is nudged. In step  36 , that aspect of the mapping attributable to the pose of the camera in the workspace can be recomputed, e.g., without requiring a calibration plate, because the lens distortion is assumed to remains constant. 
     Illustrated system  10  preferably includes a “time out” feature that prevents undue delay in instances where an expected pattern is not detected in an image acquired during runtime phase  34 . In this regard, the system simply treats a pattern that is not detected within a designated delay interval (e.g., set by the operator or otherwise) as not found and proceeds with position determination on the basis of the other, found patterns. This has the benefit of making the system  10  more robust with respect to missing features and its operation more timely. 
     Described above are methods and apparatus meeting the objects set forth above, among others. It will be appreciated that the methods and apparatus shown in the drawings and described above are merely examples of embodiments of the invention, and that other embodiments incorporating changes therein fall within the scope of the invention.