This patent document contains material subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document, as it appears in the U.S. Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever.
1. Field of the Invention
Aspects of the invention relate to certain machine vision systems. Other aspects of the invention relate to visually inspecting a nonlinearly spatially distorted pattern using machine vision techniques.
2. Description of Background Information
Machine vision systems are used to inspect numerous types of patterns on various objects. For example, golf ball manufacturers inspect the quality of printed graphical and alphanumerical patterns on golf balls. In other contexts, visual patterns of objects are inspected, including, e.g., printed matter on bottle labels, fixtured packaging, and even credit cards.
These systems generally perform inspection by obtaining a representation of an image (e.g., a digital image) and then processing that representation. Complications are encountered, however, when the representation does not accurately reflect the true shape of the patterns being inspected, i.e., the representation includes a nonlinearly spatially distorted image of the pattern.
A nonlinearly spatially distorted image comprises a spatially mapped pattern that cannot be described as an affine transform of an undistorted representation of the same pattern. Nonlinear spatial distortions can arise from the process of taking an image of the object (e.g., perspective distortions may be caused by changes in a camera viewing angle) or from distortions in the object itself (e.g., when a credit card is laminated, an image may stretch due to melting and expansion caused by heat during lamination).
Current machine vision methods encounter difficulties in inspecting patterns with nonlinear spatial distortions. For example, after a system has been trained on an image of a flat label, the system could not then be used to reliably inspect the same label wrapped around a curved surface, such as a bottle. Instead, the distorted pattern will cause the system to falsely reject a part because its image comprises a nonlinearly spatially distorted pattern.
An embodiment of the present invention provides a method for training a system to inspect a nonlinearly distorted pattern. A digitized image of an object, including a region of interest, is received. The region of interest is further divided into a plurality of sub-regions. A size of each of the sub-regions is small enough such that inspecting methods can reliably inspect each of the sub-regions. A search tool and an inspecting tool are trained for a respective model for each of the sub-regions. A search tree is built for determining an order for inspecting the sub-regions. A coarse alignment tool is trained for the region of interest.
A second embodiment of the invention provides a method for inspecting a spatially distorted pattern. A coarse alignment tool is run to approximately locate the pattern. Search tree information and the approximate location of a root sub-region found by the coarse alignment tool are used to locate a plurality of sub-regions, sequentially in an order according to the search tree information. Each of the sub-regions are small enough such that inspecting methods can reliably inspect each of the sub-regions. Each of the sub-regions is inspected.
Illustrative embodiments of the invention are described with reference to the following drawings in which:
An embodiment of the invention addresses the problem of inspecting patterns having nonlinear spatial distortions by partitioning an inspection region into an array of smaller sub-regions and applying image analysis techniques over each of the sub-regions. Because the image is broken down into smaller sub-regions, those image analysis techniques need not be complex or uniquely developed (e.g., existing simple and known techniques can be used such as golden template comparison and correlation search). The illustrated system works well in situations in which there are no discontinuities in a two-dimensional spatial distortion field. An independent affine approximation is used to model the distortion field over each local sub-region. This results in a “piece-wise linear” fit to the distortion field over the full inspection region.
Image processing system 100 includes storage 6 for receiving and storing the digital image. The storage 6 could be, for example, a computer memory.
Region divider 8 divides a region of interest, included in the image, into an array of smaller sub-regions, such that each of the sub-regions is of a size which can be inspected reliably using an inspecting method.
A coarse alignment trainer 10 and a trainer 12 train respective models for each of the sub-regions. The coarse alignment trainer 10 trains the model for a coarse alignment mechanism 14 and the trainer trains respective models for each of the sub-regions for a search mechanism 20 and for an inspector 18.
A search tree builder 14 builds a search tree using results from training the search mechanism 20. A coarse alignment mechanism 14 approximately locates and establishes a root sub-region which is then used by the search tree builder 14 as a starting point for building the search tree.
The search mechanism 20 searches for each of the sub-regions using results from the coarse alignment mechanism 14 in order to determine where to begin the search and information from the search tree produced by the search tree builder 14 to determine which of the sub-regions for which to search next. The search tree builder 14 establishes the search tree such that an order of transformation information for located ones of the sub-regions is used to minimize a search range for neighboring ones of the sub-regions.
A search mechanism 20 searches for the sub-regions. The information from the search tree is used to determine an order of sub-regions for which to search. The search mechanism may be, for example, PatMax, which is a search tool available from Cognex Corporation of Natick, Mass. The search tool may also be, for example, a correlation search, as well as other search tools which may be known or commercially available.
When a sub-region is not properly trained, for example, due to a lack of features, an interpolator 22 uses transformation information from located neighboring ones of the sub-regions to predict registration results, or location information, for the untrained sub-region.
An inspector 18 inspects each of the sub-regions and produces a difference image and a match image for each of the sub-regions. A difference image combiner 24 combines the difference images from all of the sub-regions into a single difference image, and a match image combiner 26 combines the match images from all of the sub-regions into a single match image.
A vector field producer 28 compares a pattern in a sub-region at run time with a trained model pattern in a corresponding sub-region, and produces a vector field for the sub-region. The vector field indicates a magnitude and a direction of a distortion of the pattern at run time, as compared with the model pattern.
A comparing mechanism 30 compares the vector field for each sub-region against user defined tolerances, and based on results of the comparison makes a pass/fail decision.
At P202 a region of interest within the digitized image is divided into a plurality of sub-regions.
At P204, respective models for each of the sub-regions are trained for a search tool. The search tool could be, for example, PatMax, which is available from Cognex Corporation of Natick, Mass. However, other search tools or methods can be used; for example, a correlation search method may be used. Note that if a sub-region cannot be located by the search tool due to, for example, spatial distortion, the sub-region can be further sub-divided into smaller sub-regions in an effort to find a sub-region size which could be located by the search tool. However, if, for example, due to a lack of features, a sub-region cannot be located, location information can be predicted from transformation information from neighboring sub-regions. In other words, transformation information, for example, scale, rotation and skew, from located sub-regions can be used to interpolate transformation information for a sub-region when the sub-region cannot be located.
At P206, respective models for each of the sub-regions are trained for an inspection tool. The inspection tool could be, for example, PatInspect, which is available from Cognex Corporation of Natick, Mass. Other search tools or methods can also be used; for example, a tool using a golden-template-comparison method may be used.
At P208, a search tree is built based upon the training information from training the search tool (P204). With reference to
At P210, a coarse alignment tool is trained. If distortion of the pattern is small, the whole pattern may be used for training. Otherwise a smaller region of interest may be used, based upon, for example, user input describing expected distortion and an algorithm for performing the coarse alignment.
At P402, the search tree information is used to provide an order of searching, while applying a search tool to locate the sub-regions. The coarse alignment tool provides an approximate location for a root sub-region. The search tool may be PatMax, as described previously, or any other search tool, such as one that uses a correlation search.
When a sub-region cannot be properly located, for example, due to a lack of features, an interpolator 22 uses transformation information from located neighboring ones of the sub-regions to predict registration results, or location information.
At P404 an inspection tool is executed to inspect each of the sub-regions. The inspection tool produces a match image and a difference image for each of the sub-regions.
At P406 and P408, the difference images for the sub-regions and the match images for the sub-regions are combined into single difference and match images for the region of interest, respectively.
At P410, the location information obtained by the search tool is used to produce a distortion vector field.
At P412, the distortion vector fields are compared against user-specified tolerances, and based on results of the comparison, a pass/fail decision is made.
In addition, the combined match or difference images could be used to locate defects. For example, if there are no defects, the difference image will be black.
The invention may be implemented by hardware or a combination of hardware and software. The software may be recorded on a medium for reading into a computer memory and executing. The medium may be, but is not limited to, for example, one or more of a floppy disk, a CD ROM, a writable CD, a Read-Only-Memory (ROM), and an Electrically Alterable Programmable Read Only Memory (EAPROM).
While the invention has been described by way of example embodiments, it is understood that the words which have been used herein are words of description, rather than words of limitation. Changes may be made, within the purview of the appended claims, without departing from the scope and spirit of the invention in its broader aspects. Although the invention has been described herein with reference to particular means, materials, and embodiments, it is understood that the invention is not limited to the particulars disclosed. The invention extends to all equivalent structures, means, and uses which are within the scope of the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
5271068 | Ueda et al. | Dec 1993 | A |
5465152 | Bilodeau et al. | Nov 1995 | A |
5581276 | Cipolla et al. | Dec 1996 | A |
5604819 | Barnard | Feb 1997 | A |
5627915 | Rosser et al. | May 1997 | A |
5673334 | Nichani et al. | Sep 1997 | A |
5699443 | Murata et al. | Dec 1997 | A |
5777729 | Aiyer et al. | Jul 1998 | A |
5825483 | Michael et al. | Oct 1998 | A |
6009213 | Miyake | Dec 1999 | A |
6088482 | He et al. | Jul 2000 | A |
6285799 | Dance et al. | Sep 2001 | B1 |
6330354 | Companion et al. | Dec 2001 | B1 |
6370197 | Clark et al. | Apr 2002 | B1 |