Increasing accuracy of discrete curve transform estimates for curve matching in higher dimensions

0Associated
Cases 
0Associated
Defendants 
0Accused
Products 
7Forward
Citations 
0
Petitions 
1
Assignment
First Claim
1. A computeraccessible memory medium that stores program instructions for estimating a rotational shift between a first discrete curve and a second discrete curve, wherein the program instructions are executable to perform:
 receiving a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve, wherein the first discrete curve and the second discrete curve each comprises a respective curve in at least three dimensions;
estimating a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating;
$\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively;
updating a cumulative rotational shift based on the estimated rotational shift;
generating a rotationally shifted version of the second discrete curve based on the cumulative rotational shift;
performing said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; and
storing the final estimate of the rotational shift, wherein the final estimate of the rotational shift is useable to perform discrete curve matching.
1 Assignment
0 Petitions
Accused Products
Abstract
System and method for estimating a rotational shift between a first discrete curve and a second discrete curve, where the second discrete curve is a rotationally shifted version of the first discrete curve. First and second discrete curves are received. A rotational shift between the first discrete curve and the second discrete curve is estimated based on the first discrete curve and the second discrete curve. A cumulative rotational shift is updated based on the estimated rotational shift. A rotationally shifted version of the second discrete curve is generated based on the cumulative rotational shift. The estimating, updating, and generating are performed in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve. The final estimate may be used to perform curve matching.
19 Citations
View as Search Results
Gauge monitoring methods, devices and systems  
Patent #
US 20090190795A1
Filed 01/30/2009

Current Assignee
Cypress Envirosystems Inc

Sponsoring Entity
Cypress Envirosystems Inc

Gauge reading device and system  
Patent #
US 20080148877A1
Filed 12/21/2006

Current Assignee
Cypress Envirosystems Inc

Sponsoring Entity
Cypress Envirosystems Inc

IMAGE PROCESSING APPARATUS AND METHOD  
Patent #
US 20130011077A1
Filed 07/13/2012

Current Assignee
Toshiba Corporation

Sponsoring Entity
Toshiba Corporation

Gauge reading device and system  
Patent #
US 8,411,896 B2
Filed 12/21/2006

Current Assignee
Cypress Envirosystems Inc

Sponsoring Entity
Cypress Envirosystems Inc

Gauge monitoring methods, devices and systems  
Patent #
US 8,594,365 B2
Filed 01/30/2009

Current Assignee
Cypress Envirosystems Inc

Sponsoring Entity
Cypress Envirosystems Inc

Image processing apparatus and method  
Patent #
US 8,693,804 B2
Filed 07/13/2012

Current Assignee
Toshiba Corporation

Sponsoring Entity
Toshiba Corporation

Identifying randomly distributed microparticles in images to sequence a polynucleotide  
Patent #
US 9,135,497 B2
Filed 01/27/2012

Current Assignee
National Instruments Corporation

Sponsoring Entity
National Instruments Corporation

Object image search using validated submodel poses  
Patent #
US 6,411,734 B1
Filed 12/16/1998

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Object image search using submodels  
Patent #
US 6,324,299 B1
Filed 04/03/1998

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Machine vision methods and system for boundary pointbased comparison of patterns and images  
Patent #
US 6,381,366 B1
Filed 12/18/1998

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Automated inspection of objects undergoing general affine transformation  
Patent #
US 6,421,458 B2
Filed 08/28/1998

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Apparatus and method for determining the location and orientation of a reference feature in an image  
Patent #
US 6,240,218 B1
Filed 03/14/1995

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Boundary tracking method and apparatus to find leads  
Patent #
US 6,035,066 A
Filed 06/02/1995

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Machine vision method and apparatus for determining the position of generally rectangular devices using boundary extracting features  
Patent #
US 5,933,523 A
Filed 03/18/1997

Current Assignee
Cognex Corporation

Sponsoring Entity
Cognex Corporation

Methods and apparatus for registering CTscan data to multiple fluoroscopic images  
Patent #
US 5,951,475 A
Filed 09/25/1997

Current Assignee
INTEGRATED SURGICAL SYSTEMS

Sponsoring Entity
International Business Machines Corporation

Online handwriting recognition using a prototype confusability dialog  
Patent #
US 5,315,667 A
Filed 10/31/1991

Current Assignee
International Business Machines Corporation

Sponsoring Entity
International Business Machines Corporation

Method and apparatus for online recognizing handwritten patterns  
Patent #
US 4,718,103 A
Filed 10/01/1986

Current Assignee
Hitachi Ltd.

Sponsoring Entity
Hitachi Ltd.

High speed pattern recognizer  
Patent #
US 4,736,437 A
Filed 04/21/1987

Current Assignee
GSI Lumonics Corporation

Sponsoring Entity
View Engineering Inc.

Edge finding in wafers  
Patent #
US 4,752,898 A
Filed 01/28/1987

Current Assignee
Tencor Instruments

Sponsoring Entity
Tencor Instruments

22 Claims
 1. A computeraccessible memory medium that stores program instructions for estimating a rotational shift between a first discrete curve and a second discrete curve, wherein the program instructions are executable to perform:
receiving a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve, wherein the first discrete curve and the second discrete curve each comprises a respective curve in at least three dimensions; estimating a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating; $\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively; updating a cumulative rotational shift based on the estimated rotational shift; generating a rotationally shifted version of the second discrete curve based on the cumulative rotational shift; performing said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; and storing the final estimate of the rotational shift, wherein the final estimate of the rotational shift is useable to perform discrete curve matching.  View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
 19. A method for estimating a rotational shift between a first discrete curve and a second discrete curve, the method comprising:
receiving a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve; estimating a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating; $\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively; updating a cumulative rotational shift based on the estimated rotational shift; generating a rotationally shifted version of the second discrete curve based on the cumulative rotational shift; and performing said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; and storing the final estimate of the rotational shift, wherein the final estimate of the rotational shift is useable to perform discrete curve matching.
 20. A system for estimating a rotational shift between a first discrete curve and a second discrete curve, the system comprising:
a processor; a memory medium coupled to the processor; an input coupled to the processor and the memory medium; and an output coupled to the processor and the memory medium; wherein the input is operable to receive a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve, and wherein the first discrete curve and the second discrete curve each comprises a respective sequence of points in at least three dimensions; wherein the memory medium stores program instructions which are executable by the processor to; estimate a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating; $\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively; update a cumulative rotational shift based on the estimated rotational shift; generate a rotationally shifted version of the second discrete curve based on the cumulative rotational shift; and perform said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; wherein the output is operable to output the final estimate of the rotational shift between the first discrete curve and the second discrete curve, and wherein the final estimate of the rotational shift is useable to perform discrete curve matching.
 21. A system for estimating a rotational shift between a first discrete curve and a second discrete curve, the system comprising:
means for receiving a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve, wherein the first discrete curve and the second discrete curve each comprises a respective curve in at least three dimensions; means for estimating a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating; $\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively; means for updating a cumulative rotational shift based on the estimated rotational shift; means for generating a rotationally shifted version of the second discrete curve based on the cumulative rotational shift; means for performing said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; and means for storing the final estimate of the rotational shift, wherein the final estimate of the rotational shift is useable to perform discrete curve matching.
 22. A programmable hardware element configured for estimating a rotational shift between a first discrete curve and a second discrete curve, wherein the programmable hardware element is configured to perform:
receiving a first discrete curve and a second discrete curve, wherein the second discrete curve is a rotationally shifted version of the first discrete curve, wherein the first discrete curve and the second discrete curve each comprises a respective curve in at least three dimensions; estimating a rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve, wherein said estimating the rotational shift between the first discrete curve and the second discrete curve based on the first discrete curve and the second discrete curve comprises calculating; $\mathrm{\alpha =\frac{\begin{array}{c}\underset{}{\overset{}{\sum n=1N\{({z}_{n\phantom{\rule{0.3em}{0.3ex}}1{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)({y}_{n+11}{y}_{n\phantom{\rule{0.3em}{0.3ex}}1)}}}}}\end{array}}{}}$ wherein y_{n }and z_{n }refer to points in the first discrete curve and the second discrete curve, respectively; updating a cumulative rotational shift based on the estimated rotational shift; generating a rotationally shifted version of the second discrete curve based on the cumulative rotational shift; performing said estimating, said updating, and said generating in an iterative manner using the respective rotationally shifted discrete curve for each iteration until a stopping condition occurs, thereby determining a final estimate of the rotational shift between the first discrete curve and the second discrete curve; and storing the final estimate of the rotational shift, wherein the final estimate of the rotational shift is useable to perform discrete curve matching.
1 Specification
This application is a Continuation of U.S. patent application Ser. No. 10/430,546, titled “Increasing Accuracy of Discrete Curve Transform Estimates for Curve Matching”, filed May 6, 2003, now U.S. Pat. No. 7,327,887 which is a ContinuationInPart of U.S. patent application Ser. No. 10/263,560, titled “Pattern Matching System Utilizing Discrete Curve Matching with a Mapping Operator”, filed on Oct. 3, 2002, now U.S. Pat. No. 7,171,048 which claims priority to U.S. Provisional Application Ser. No. 60/371,474 titled “Pattern Matching System Utilizing Discrete Curve Matching with a Mapping Operator”, filed Apr. 10, 2002.
The present invention relates to the field of geometric pattern matching, and more specifically to a system and method for estimating rotational shifts between discrete curves. For example, the invention may relate to locating portions of a target data set that match an object of interest, e.g., in a template data set, with respect to various boundary information, e.g., luminance, color, etc.
In many applications it is necessary or desired to determine the presence of an object of interest in a data set, such as a target image. For example, in many image processing applications it is desirable to find one or more matches of a template image in a larger target image. Exemplary machine vision applications include process monitoring, feedback control, and laboratory automation; image and video compression; and jitter compensation in video cameras, among others. Various characteristics may be used in classifying a location in the target image as a match, including luminance pattern information, color pattern information, and color information.
Additionally, the object of interest in the target data set or image may be transformed relative to the known object information, e.g., in the template data set or image. For example, the object of interest in the target image may be shifted, scaled, rotated, or may have other geometric or topological transformations.
Prior art pattern recognition systems have typically used a template matching technique wherein the stored image or pattern to be located is iteratively compared with various portions of a target image in which it is desired to locate the template.
Typically, the pattern matching algorithm involves comparing the template image, or a subset of sample pixels representing the template image, against locations in the target image on a horizontal pixel column basis and horizontal scan line basis. In other words, the sample pixels representing the template image are compared against a portion of the pixels in the target image, such as by using a 2D correlation, the sample pixels representing the template are then moved down or across a one pixel scan line or one pixel column in the target image, and the pattern matching algorithm is repeated, etc. Thus, the pattern matching algorithm generally involves comparing the template image pixels against all possible locations in the target image in an iterative fashion. The pattern matching may produce the location of the match in the image, the quality of match and possibly the orientation, size and/or scaling of the match.
The template is typically compared with portions of the target image by utilizing a correlation based pattern matching, i.e., using normalized two dimensional correlation (normalized 2D correlation). This 2D correlation is performed by placing the template over the respective portion of the image and performing a complete normalized 2D correlation between the pixels in the template and the pixels in the corresponding portion of the image, using values associated with the pixels, such as grayscale values. This correlation generally produces a correlation value which indicates the degree of correlation or match. For example, the correlation value may range between −1 and +1, wherein +1 indicates a complete match, 0 indicates no match, i.e., that the two images are uncorrelated, and −1 indicates that the two images are anticorrelated, i.e., a complete reversal of a match.
The normalized 2D correlation operation is based on a pointwise multiplication wherein the template is first conceptually placed over a portion of the image, the value associated with each point or pixel of the template is multiplied with the corresponding pixel value in the respective portion of the target image, and the result is summed over the entire template. Also, as noted above, the template image is generally compared with each possible portion of the target image in an iterative fashion. This approach is thus very computationally intensive.
Various optimizations or algorithms have been developed to provide a more efficient pattern matching technique. One prior art technique is to use selected samples or pixels from the template image, referred to as sample pixels, to represent the template image and hence to reduce the number of computations in the correlation.
Another prior art technique for performing pattern matching utilizes hue plane or color information, either alone or in combination with pattern matching. Utilizing color information can often be used to simplify a grayscale pattern matching problem, e.g., due to improved contrast or separation of an object from the background. Also, some applications may utilize color information alone, i.e., not in conjunction with pattern information, to locate target image matches, e.g., for cases when an application depends on the cumulative color information in a region and not how the colors are arranged within the region or the spatial orientation of the region.
In machine vision applications, color is a powerful descriptor that often simplifies object identification and extraction from a scene. Color characterization, location, and comparison is an important part of machine vision and is used in a large class of assembly and packaging inspection applications. Inspection involves verifying that the correct components are present in the correct locations. For example, color information may be used in inspecting printed circuit boards containing a variety of components; including diodes, resistors, integrated circuits, and capacitors. These components are usually placed on a circuit board using automatic equipment, and a machine vision system is useful to verify that all components have been placed in the appropriate positions.
As another example, color information is widely used in the automotive industry to verify the presence of correct components in automotive assemblies. Components in these assemblies are very often multicolored. For example, color characterization may be used to characterize and inspect fuses in junction boxes, i.e., to determine whether all fuses are present and in the correct locations. As another example, it is often necessary to match a fabric in one part of a multicolor automobile interior. A color characterization method may be used to determine which of several fabrics is being used.
Another prior art technique for performing pattern matching is referred to as geometric pattern matching, which may also be referred to as curve matching or shape matching. Geometric pattern matching generally refers to the detection and use of geometric features in an image, such as boundaries, edges, lines, etc., to locate geometrically defined objects in the image. The geometric features in an image may be reflected in various components of the image data, including, for example, luminance (grayscale intensity), hue (color), and/or saturation. Typically, geometric features are defined by boundaries where image data changes, e.g., where two differently colored regions abut. Geometric pattern matching techniques are often required to detect an object regardless of scaling, translation, and/or rotation of the object with respect to the template image. For further information on shape or geometric pattern matching, see “StateoftheArt in Shape Matching” by Remco C. Veltkamp and Michiel Hagedoorn (1999), and “A Survey of Shape Analysis Techniques” by Sven Loncaric, which are both incorporated herein by reference.
An issue that arises in many pattern matching applications is that the target image being analyzed may contain other objects besides the object of interest, i.e., the template image. The presence of these other objects may complicate the pattern matching process, in that the other objects may differ from the template image to various degrees, with some of the objects being fairly similar, and others being quite different from the template image. For a simplified example, assume an application where the template image is a square, and the target image contains a square, two rectangles, and a circle. To reliably match/detect the square in the target image, a pattern matching technique must not only distinguish between the square and the circle, but also between the square and each of the rectangles. However, in many cases, a pattern matching algorithm which successfully distinguishes a square from a circle may not reliably distinguish a square from a rectangle. Conversely, a pattern matching algorithm which successfully distinguishes a square from a rectangle may not reliably distinguish a square from a circle. Thus, when the target image presents a complex scene, the task of distinguishing between the object of interest and objects not of interest may become difficult. This issue becomes increasingly important when pattern matching is performed with ‘real world’ image data, i.e., when the target image is not preprocessed to facilitate pattern matching with the particular pattern matching algorithm used.
In many curve matching applications, two discrete curves, e.g., a first curve and a second curve, may differ by a small rotational shift, where the second curve is a slightly rotated version of the first curve. Prior art curve matching methods have typically involved cyclically shifting (rotating) the second curve by increments of the angular distance between successive points in the curve. However, such “quantized” cyclic shifting may substantially limit the accuracy with which the curves may be prepared, e.g., aligned or corrected, for pattern matching purposes.
Therefore, improved methods are desired for preparing discrete curves for comparison, e.g., for a curve matching application.
Various embodiments of a system and method for estimating a small shift α between two discrete curves, y and z, are presented, where curve z is a slightly rotated version of curve y. The curves have preferably been normalized with respect to position and length. In various embodiments, the curves may be 2 dimensional, 3 dimensional, or of higher dimensionality. Each curve preferably includes a sequence of points, where the angular difference between successive points in the discrete curve may be considered an intrinsic angular resolution of the curve. In one embodiment, the curves may each be represented by a respective sequence of points in the complex plane. In other embodiments, the curves may comprise respective point sequences in 3D or higher dimensions.
A current estimate may be made of a rotational shift between the first and second discrete curves, and may be used to update a cumulative rotational shift. A rotationally shifted version of z may be calculated using the computed value of the estimated rotational shift. In one embodiment, rotationally shifting the curve z may include interpolating the curve. Any of various interpolation methods may be used, but quadratic or spline interpolations generally preserve the original shape better than linear interpolations and so may be used in preferred embodiments. Note that the new version of z may be computed by rotating the original curve z by the updated cumulative rotational shift, or alternatively, may be computed by rotating the previous version of z by the current estimate. The former approach is preferably used to minimize accumulated numerical errors.
A determination may be then be made as to whether a stopping condition occurs. If a stopping condition is not detected, then the method may repeat iteratively, calculating a new estimate using the rotationally shifted version of z, performing the above steps in an iterative manner until the stopping condition obtains. Note that since the new estimate is based on the rotationally shifted version of z, the magnitude of the new value will generally be less than that of the current (i.e., previous) value, and thus, as each successive computation of the estimate is made, the values will tend toward zero, although the progression may include both positive and negative values.
In one embodiment, the stopping condition may occur when the magnitude of the estimated rotational shift is less than some specified threshold value (e.g., epsilon, representing a sufficient level of accuracy), typically after only a few iterations (possibly even just one). Alternatively, in another embodiment, the stopping condition may occur when a certain number of iterations have elapsed. Of course, any other stopping condition may be used as desired.
If a stopping condition is determined to occur, then results may be output, e.g., a final cumulative estimated rotational shift may be output, e.g., to a display device, to a file, to a process, to an external system, and so forth, where the final cumulative estimated rotational shift is an improved estimate of the rotational difference between the two curves y and z.
In one embodiment, the most recent version of curve z (e.g., z^{k}, where k is the index value of the last iteration) may be output, e.g., to a matching process, where curves y and z^{k }may be analyzed to determine whether or to what degree the curves match.
In one embodiment, the estimated rotational shift may be normalized with respect to the index, i.e. a value of 1 may stand for a rotation or cyclic shift of exactly 1 index point. It is noted, however, than in general the computed value of the estimate will be substantially less than 1, i.e., the value will generally be less than the intrinsic angular resolution of the discrete curves.
In one embodiment, 2D or 3D discrete curves may be augmented with additional image data to generate discrete curves in higher dimensions. For example, in one application of the method 2D curves may be augmented with grayscale information related to the curves, e.g., to improve the accuracy in geometric pattern matching. In other words, grayscale information may be used as an additional dimension, effectively making the 2D curves into 3D curves. To this end the shape information (two spatial coordinates in the 2D case) may be augmented by the grayscale information (a third spatial coordinate in the 2D case) at each point. Thus, the grayscale information may be interpreted as an extra dimension in the curves. The method described above may then be used to determine subangle rotational differences between the two (originally 2D) curves.
It should be noted that this approach is also applicable in even higher dimensions, where, for example, other additional image data may be included as corresponding additional dimensions to be added to curves that are originally 2D or 3D (or of even higher dimensionality). For example, where the first discrete curve and the second discrete curve each comprise a respective sequence of points, each point may include a respective two or more spatial coordinates, and a respective one or more additional coordinates, where each additional coordinate is based on respective additional image data associated with the point. Each of the one or more additional coordinates may then be interpreted as additional spatial coordinates for the point. Thus, the effective dimensionality of the curves may be increased by including additional image data for each point as additional spatial coordinates or dimensions, where the additional information may improve the accuracy of curve matching of the two curves. For example: a 2D curve augmented by 3D color information may result in a 5D representation.
Thus, various embodiments of the above methods may be used to determine subangle accuracy for two and threedimensional discrete curves (or even higherdimensional curves), where a second curve is a slightly rotated version of a first curve. Once the second curve has been rotated in accordance with the computed final estimate, the curves may be tested or processed to determine whether and/or to what extent they match.
A better understanding of the present invention can be obtained when the following detailed description of the preferred embodiment is considered in conjunction with the following drawings, in which:
While the invention is susceptible to various modifications and alternative forms specific embodiments are shown by way of example in the drawings and are herein described in detail. It should be understood, however, that drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed. But on the contrary the invention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.
The following patent applications are hereby incorporated by reference in their entirety as though fully and completely set forth herein:
U.S. patent application Ser. No. 09/227,506 titled “Pattern Matching System and Method Which Performs Local Stability Analysis for Improved Efficiency” filed on Jan. 6, 1999, whose inventors are Dinesh Nair, Lothar Wenzel, Nicolas Vazquez, and Samson DeKey; and
U.S. Provisional Application Ser. No. 60/371,474 titled “Pattern Matching System Utilizing Discrete Curve Matching with a Mapping Operator”, filed Apr. 10, 2002.
The following publications are hereby incorporated by reference in their entirety as though fully and completely set forth herein:
The National Instruments IMAQ™ IMAQ Vision Concepts Manual; and
“Efficient Matching Of Discrete Curves”, by Lothar Wenzel, National Instruments, Austin, Tex.
The following is a glossary of terms used in the present application:
Memory Medium—Any of various types of memory devices or storage devices. The term “memory medium” is intended to include an installation medium, e.g., a CDROM, floppy disks 104, or tape device; a computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; or a nonvolatile memory such as a magnetic media, e.g., a hard drive, or optical storage. The memory medium may comprise other types of memory as well, or combinations thereof. In addition, the memory medium may be located in a first computer in which the programs are executed, or may be located in a second different computer which connects to the first computer over a network, such as the Internet. In the latter instance, the second computer may provide program instructions to the first computer for execution. The term “memory medium” may include two or more memory mediums which may reside in different locations, e.g., in different computers that are connected over a network.
Carrier Medium—a memory medium as described above, as well as signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as a bus, network and/or a wireless link.
Programmable Hardware Element—includes various types of programmable hardware, reconfigurable hardware, programmable logic, or fieldprogrammable devices (FPDs), such as one or more FPGAs (Field Programmable Gate Arrays), or one or more PLDs (Programmable Logic Devices), such as one or more Simple PLDs (SPLDs) or one or more Complex PLDs (CPLDs), or other types of programmable hardware. A programmable hardware element may also be referred to as “reconfigurable logic”.
Medium—includes one or more of a memory medium, carrier medium, and/or programmable hardware element; encompasses various types of mediums that can either store program instructions/data structures or can be configured with a hardware configuration program.
FIG. 3—Computer System
The computer system 102 may perform a pattern characterization method of a template image and may use information determined in this analysis to determine whether a target image matches the template image and/or to locate regions of the target image which match the template image, with respect to pattern information. Images that are to be matched are preferably stored in the computer memory and/or received by the computer from an external device.
The computer system 102 preferably includes one or more software programs operable to perform the pattern match determination and/or location. The software programs may be stored in a memory medium of the computer system 102. The term “memory medium” is intended to include various types of memory, including an installation medium, e.g., a CDROM, or floppy disks 104, a computer system memory such as DRAM, SRAM, EDO RAM, Rambus RAM, etc., or a nonvolatile memory such as a magnetic medium, e.g., a hard drive, or optical storage. The memory medium may comprise other types of memory as well, or combinations thereof. In addition, the memory medium may be located in a first computer in which the programs are executed, or may be located in a second different computer which connects to the first computer over a network. In the latter instance, the second computer may provide the program instructions to the first computer for execution.
Various embodiments further include receiving or storing instructions and/or data implemented in accordance with the foregoing description upon a carrier medium. Suitable carrier media include a memory medium as described above, as well as signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as networks and/or a wireless link.
Also, the computer system 102 may take various forms, including a personal computer system, mainframe computer system, workstation, network appliance, Internet appliance, personal digital assistant (PDA), television system or other device. In general, the term “computer system” can be broadly defined to encompass any device having a processor which executes instructions from a memory medium.
The software program(s) may be implemented in any of various ways, including procedurebased techniques, componentbased techniques, graphical programming techniques, and/or objectoriented techniques, among others. For example, the software program may be implemented using ActiveX controls, C++ objects, Java Beans, Microsoft Foundation Classes (MFC), or other technologies or methodologies, as desired. A CPU, such as the host CPU, executing code and data from the memory medium comprises a means for performing pattern match location according to the methods or flowcharts described below.
FIG. 4—Machine Vision System
In the machine vision system of
FIG. 5—Image Acquisition System Block Diagram
As shown in
In this embodiment, the host computer system 102 also includes a video capture board 214 which is adapted for coupling to the video source 112. The video capture board 214 is preferably coupled to the peripheral bus 212. In addition to the video capture board 214, other peripheral devices (216 and 218) may be coupled to the peripheral bus 212, such as audio cards, modems, graphics cards, network cards, etc.
The video source 112 supplies the analog or digital video signals to the video capture board 214. The video capture board 214 transfers digitized video frames to the system memory 206 through peripheral bus 212 and bus bridge 204. In this embodiment, the video capture board 214 acquires the target image and transfers it to system memory 206. One or more regions of interest (ROI) may be specified in the target image which are desired to be searched for regions having pattern information that matches the pattern information of a template image, or the entire target image may be searched.
The system memory 206 may store a template image. The system memory 206 may also receive and/or store one or more other images, such as selected regions of interest (ROIs) in the template image or another image, or acquired target images. The system memory 206 also preferably stores software according to the present invention which operates to analyze the pattern information of the template and target images. The software may also be executable to perform various pattern match location methods, as described below. The system memory 206 may store the pattern information of the template image for comparison to various regions in the target image during the pattern match location process.
The term “image,” as used herein, may refer to any of various types of images. An image may be obtained from any of various sources, including a memory medium. An image may, for example, be obtained from an image file, such as a BMP, TIFF, AIPD, PNG, JPG, or GIF file, or a file formatted according to another image format. An image may also be obtained from other sources, including a hardware device, such as a camera, framegrabber, scanner, etc. An image may be a complex image, in which pixel values (positions) have a real part and an imaginary part.
It is noted that, in a pattern match application, the pattern information of the template image may be precalculated and stored in the computer, and the actual template image is then not required to be stored or used for subsequent pattern match determination/location operations with respective target images. Thus, when a target image is acquired, the software may compare the pattern information of the target image with the precomputed pattern information of the template image.
The present invention is preferably implemented in one or more software programs which are executable by a processor or CPU. The software program(s) of the present invention are preferably stored in a memory medium of a computer as described above.
Although many of the embodiments described herein relate to images and image processing, it is noted that the techniques described are broadly applicable to data sets and data processing. In other words, various embodiments of the invention may be used to perform discrete curve matching where the discrete curves are determined from data as opposed to just images.
Certain concepts related to SturmLiouville Theory and curve matching may be useful in understanding various embodiments of the present invention, and thus are presented below.
SturmLiouville Theory
The SturmLiouville theory is a wellestablished mathematical topic with numerous applications in science and engineering (e.g. Chirikjian and Kyatkin [2001]). Some results and methods of this theory are presented below. It should be noted that for brevity, the most general version of the theory is not presented.
Let s(x), w(x), and q(x) be realvalued differentiable functions on the real finite and closed interval [a,b], where s(x) and w(x) are positive functions on the given interval. The solutions of differential equation:
in the unknown function y for different eigenvalues λ and appropriate boundary conditions generate sets of orthogonal eigenfunctions y(x). It has been shown (Birkhoff and Rota [1960]) that the eigenfunctions of SturmLiouville differential equations (1) form a complete set of functions in L^{2}([a,b],R). Perhaps the most familiar situation is s(x)=1, w(x)=1, and q(x)=0, [a,b]=[0,2π], where the boundary conditions are y(a)=y(b) and y′(a)=y′(b). The differential equation (1) reduces to:
The eigenvalues and realvalued eigenfunctions are:
λ=0 and y(x)=1
λ=n^{2 }and y(x)=sin(nx), y(x)=cos(nx) for n=1, 2, . . . (3)
Functions f in L^{2 }([a, b], R) can be represented in the L^{2 }sense by a series:
It is common to normalize functions y_{n}(x), i.e. the denominator in (4) vanishes. The function w is called the weight function. Many of the resulting orthogonal function systems {y_{n}(x)} satisfy threeterm recurrence relations:
y_{n+1}(x)=C_{1}(x,n)y_{n}(x)+C_{2}(x,n)y_{n−1}(x) (5)
Particularly, in the case when {y_{n}(x)} is a set of polynomials, the functions C_{1 }and C_{2 }are of the form C_{1}(x,k)=a_{k}x+b_{k }and C_{2 }(x,k)=c_{k}, respectively. All numbers a, b, and c depend only on k. It can be shown that the threeterm recurrence relation:
p_{n}(x)=(a_{n}x+b_{b})p_{n−1}(x)+c_{n}p_{n−2}(x) (6)
generates all possible systems of orthogonal polynomials, where
Let p_{k}(x) be a complete system of orthonormal polynomials over [−1,1], where w(x) is a nonnegative weight function used to define the scalar product in this space. Let x_{0}, x_{1}, . . . x_{n }be the roots of p_{n+1}, and let w_{0}, w_{1}, . . . , w_{n }w_{0 }be the solution of (Gaussian quadrature):
It can be shown that
for any polynomial of order not exceeding 2n+1. In particular,
Gaussian quadrature provides tools that translate continuous orthonormality relations into discrete ones. Equation (10) can be interpreted as follows. The zeros of such an orthonormal polynomial (basis function) may be used to efficiently sample curves, as described below with reference to
Shape Based Geometrical Description
Shape analysis has many applications in engineering, biology, chemistry, geography, medicine, and imagine processing. General shape spaces are well understood, e.g. Kendall et al. [1999], Kendall [1977, 1984], Came [1990]. Such spaces are based on specific sets of transformation groups G that lead to Riemannian metrics and Lie group theoretical approaches. An example is Kendall'"'"'s shape space Σ_{m}^{k }of k points in an mdimensional Euclidean space where the group G of transformations consists of translation, rotation, and scaling. A suitable distance in Σ_{m}^{k }is the Riemannian metric ρ. This metric can be defined as follows. Let A_{p }and B_{p }be socalled preshapes of two configurations A and B. A and B are point sets of same size k in R^{m}. Preshapes are normalized versions of the original shape (centered at 0 and Euclidean norm 1). The Riemannian metric ρ in shape space is defined as ρ(A,B)=arccos {trace(Λ)} where the matrix Λ is the diagonal m by m matrix with positive elements given by square roots of the eigenvalues of A_{p}^{T}B_{p}^{T}B_{p}^{T}A_{p}, except the smallest diagonal element which is negative if det(B_{p}^{T}A_{p})<0. Related distances are full and partial Procrustes distances (see e.g. Kent [1992]). The term ‘full’ stands for minimization over the full set of similarity transforms and the term ‘partial’ stands for minimization only for translation and rotation.
The special case of shapes in R^{2 }can be interpreted as the study of point sets in the complex plane, C. In doing so it can be shown that the full and partial Procrustes distances in Kendall'"'"'s shape space for point in R^{2 }can be obtained as the solution to complex linear regression problems of the form:
B=rAe^{ia}+1_{k}c+E
where c is the complex location, r is the scale, α the angle of rotation. After centering and resealing A and B as before symmetric measures of residual discrepancy can be derived.
d_{full}^{2}=1−A*BB*A
d_{partial}^{2}=2(1−∥A*B∥) (11)
The former distance will be used in this paper to develop robust and efficient geometric pattern matching algorithms based on shapes.
In general, matching of shapes in higher dimensional spaces R^{m }cannot be cast as a problem in linear regression. After preshaping two given configurations A and B (centered at 0 and Euclidean norm 1) symmetric residual discrepancy measures are:
d_{m,full}^{2}=1−trace(Λ)^{2 }
d_{m,partial}^{2}=2(1−trace(Λ))
where
A_{p}^{T}B_{p}=VΛU^{T} (12)
is the singular value decomposition.
There are generalizations of distances to affine spaces and ktuplets in a differentiable Riemannian manifold where G is a Lie group.
Optimal Discrete Open Curve Descriptors
Depending on the group of transformation, numerous open curve descriptors can be developed, including shift and scale invariant, shift, scale, and rotation invariant curve descriptors, as described below. In general, curve descriptors may be determined which may provide effective means for performing shape/pattern matching between discrete curves representing image objects in acquired images, as described below with reference to
Shift and Scale Invariance
Given a set S={c_{1}, . . . , c_{M}} of M discrete open and oriented curves in the plane, where all curves consist of exactly N discrete points. It is assumed that all curves are equally sampled, i.e. the distance between two adjacent points of a given curve is constant. The goal is the construction of a similarity measure that reflects the fact that all these curves are perpendicular to each other in a space of discrete open curves, where shift and scale invariance is achieved. To this end, a nonnegative weight vector w=w_{1}, . . . , w_{N }may be generated that minimizes (in a certain sense) deviations from the orthonormality property of all curves in S.
Curves c_{i }(i=1, . . . , M) can be regarded as point sets in the complex plane C. Because of the desired shift and scale invariance a normalization procedure (mean value equal to zero, sum of lengths of all complex numbers in c_{i }is equal to 1) is quite natural. Let all curves in S={c_{1}, . . . , c_{M}} be normalized in the described sense. The desired orthonormality property results in a linear system:
where the unknowns w_{1}, . . . , w_{N }are nonnegative real numbers (the weight vector). If (13) is replaced with the matrix notation Cw=d, it follows that
(C^{T})*Cw=(C^{T})*d (14)
Both the matrix on the left side and the vector on the right are realvalued. Thus, expression (13) may provide a set of equations with which each W_{m }may be solved. In practical applications, usually the system (13) is highly overdetermined. Note that there are many more equations than terms in w, thus the system of equations comprises an overdetermined linear system which may be solved via Single Value Decomposition. Standard methods can be applied to generate the best solution in the meansquared sense in a numerically stable and fast manner.
Because of the special structure of (13), typically, many components of the unknown vector w are positive. Even if this were not the case, the computed weight vector w could be used to determine distances between given curves, where these curves are variations of S. To take advantage of the SturmLiouville theory, it must be guaranteed that all components of w are nonnegative. In other words, linear systems with constraints such as:
w>0 or upper≧w≧lower≧0
in conjunction with (14) must be solved. Efficient algorithms for this class of problems exist, e.g. Active Set Method or Hildrethd'"'"'Esopo Algorithm (e.g. Bronshtein and Semendyayev [1997]).
FIG. 6A6B—ReSampling of Discrete Curves
In a certain sense, a nonnegative weight function w, as described above, may describe a given set of open curves in an efficient way. According to equations (5) and (6), the derived weight function w can be used to construct a set of orthonormal polynomials where w is the weight function underlying the definition of a scalar product. Based on this, the corresponding Gaussian quadrature can be derived. The latter can be regarded (via calculation of the roots of specific polynomials of the aforementioned set of orthonormal functions) as an efficient resampling strategy for all given discrete open curves.
FIG. 6A—Method for ReSampling Discrete Curves
As
After all of the discrete curves have been normalized, then, in 724, the weight vector w may be computed based on the discrete curves. In one embodiment, the weight vector w may comprise a nonnegative weight function w such that c_{n}, c_{m}_{w}=δ_{nm }is satisfied in the leastsquare sense for all n and m, as noted above in (15) and (16). In one embodiment, the weight vector may be operable to transform discrete curves into a form which emphasized or amplifies the differences between the discrete curves.
In 746, a set of orthonormal polynomials may be calculated based on the weight vector w. As described above in the section on SturmLiouville Theory, the set of polynomials may serve as basis functions for representing functions in L^{2}([a,b],R), analogous to sine functions in Fourier Theory. In particular, the mapping operator w may be regarded as a weight function defined on [−1,1] from which the set of orthonormal polynomials may be calculated, as shown in (10). In other words, w may be regarded as a nonnegative function defined on [−1,1] and equations (6) and (1) applied to construct a set of orthonormal polynomials representing w.
As noted above, Gaussian quadrature provides tools which translate continuous orthonormality relations into discrete orthonormality relations suitable for discrete curve operations. It is noted that the set of polynomials includes polynomials of any (or all) orders.
In 748, a polynomial may be selected from the set of polynomials of 746. In one embodiment, the polynomial may be selected such that the number of zeros (i.e., the order) of the polynomial equals the number of samples or points desired in the resampled discrete curve. For example, if the resampled discrete curve is to be represented by 60 points, then a polynomial of order 60 may be selected from the set of polynomials.
In 750, the zeros of the selected polygon may be determined. In other words, the points are determined at which the polynomial function crosses the horizontal axis in the interval [−1,1]. The determined zero points on the interval [−1,1] indicate efficient sampling points along the discrete curve. In other words, the zero points provide an optimal sampling strategy for representing the discrete curve.
Finally, in 752, the discrete curves may be resampled according to the determined zero points. The zero points will tend to be clustered around regions of relative complexity of the discrete curve, such as curves or bends, while leaving straight, i.e., simple or uninteresting, regions sparsely sampled. It should be noted that the zero points may capture the characteristic regions of each and all of the curves, and so for a given curve, the sample points may include clusters in regions which are simple, i.e., the sampling strategy which results is the same for all of the curves. Thus, characteristic details defining each curve may be captured by the sampling strategy. Results of such a sampling strategy are presented below with reference to
FIG. 6B—Examples of ReSampled Discrete Curves
As
FIG. 7—Discrete Curve Pattern Match Method
In one embodiment, a variant of equation (13) may be used to generate mapping operators W_{m }which may be used to perform curve matching between a received target discrete curve and a plurality of template discrete curves. Is should be noted that the terms “target” and “template” are labels only, and are not intended to limit the techniques described herein to any particular types of discrete curves.
As
After the mapping operator has been determined, in 604 pattern matching, e.g., geometric pattern matching, e.g., curve matching, may be performed on one or more target images using the determined mapping operator to locate one or more instances of the object of interest. This step is referred to as the matching stage of the process. In one embodiment, after normalizing and/or resampling discrete curves from the target image(s), the curves may be compared to the mapped template discrete curves. In another embodiment, the mapping operator determined in 602 may be applied to objects or curves in the target images, and pattern matching performed between these curves and the mapped curves from the template image (from 602 above). Performing pattern matching on the one or more target images may generate pattern matching results, including, for example, which, if any, of the one or more target images match the object of interest. Further details of the matching stage are described below with reference to
After the pattern matching has been performed, in 606 the pattern matching results may be output, for example, to a memory store on the computer, to a display screen, and/or to an external system coupled to the computer, such as a server computer system. In one embodiment, the pattern matching results may be used to trigger an action. For example, in the machine vision system illustrated in
FIG. 7A—Learning Stage
As
In 704, a set of discrete curves may be determined from the acquired template image. Note that as used herein, the term “discrete curve” refers to a sequence of points or vector, i.e., an ordered set of points, which characterizes a curve, edge, or boundary in an image or data set. The set of discrete curves may represent different objects in the image, may represent different aspects of a single object, or a combination of both. Note that as used herein, the terms “curve”, “boundary”, and “edge” are used interchangeably. For example, in one embodiment, determining the discrete set of curves from the template image may include performing boundary or edge detection on the template image to determine boundaries or edges of objects present in the target image. More specifically, the method may operate to detect at least one boundary or edge present in the template image corresponding to a shape of an object in the target image. The method may then determine at least one discrete curve, i.e., sequence of points, from the detected boundary or edge. It is noted that in some cases, the edges may not be visible by human eyesight, yet may be detectable by image analysis, e.g., by computer vision processes.
In one embodiment, sequences of points may comprise sequences of pixels, where each pixel has a position based on its location in the image. It should also be noted that in some embodiments, the points may be considered to be in the complex plane. In other words, the plane of the image may be considered to be the complex plane. For example, if a point in the image has a regular position (x,y), then its complex position is (x, iy), which may be represented by the complex number x+iy, thus each curve may be considered a vector of complex values. Thus, the template image and/or the target image is interpretable as a complex plane, where the sequences of points comprise sequences of pixels, and where positions of the pixels comprise complex values. A detailed description of one embodiment of a method for determining the set of discrete curves is presented below with reference to
After determining the set of discrete curves, in 706 a mapping operator may be determined based on the set of discrete curves. The mapping operator may be operable to emphasize differences between respective objects in an image. In one embodiment, the mapping operator may comprise nonnegative components. In another embodiment, the mapping operator may comprise complex components, as described below with reference to
In 708, the mapping operator may be applied to the set of discrete curves to generate a set of mapped discrete curves for the template image. In other words, the mapping operator may be applied to the point sequences which define the discrete curves of the template image, thereby generating mapped point sequences which define corresponding mapped discrete curves.
Finally, in 710, the mapping operator and the set of mapped discrete curves may be stored, for example, in a storage medium of the computer system 102 or an external computer system coupled to the computer system 102, such as a server computer. The stored mapping operator and mapped curves may be useable to perform pattern (shape) matching on one or more target images, as described in 604 above.
FIG. 7B—Determining the Set of Discrete Curves
In 712, a curve detection threshold may be determined. The curve detection threshold may be used to distinguish between curves, e.g., edges or boundaries, and clusters. A cluster is a point set which does not qualify as a discrete curve for the purposes of pattern matching in a given application. For example, if the threshold is set too low, meaning that the curve detection is too sensitive, then noise in the image may be detected as one or more curves which do not accurately reflect the object or objects to be characterized. Setting the threshold too low generally results in a large number of “detected curves” which are actually clusters. Conversely, setting the threshold too high may result in legitimate curves in the image going undetected. Thus, the threshold may need to be “tuned” for a particular application to effectively detect curves without also detecting too many clusters. The curve detection threshold may be based on various metrics, including one or more of curve length, e.g., number of points in the curve (or cluster), size, such as area spanned by the points, curvature, such as standard deviation of the curve, or any other metric useable to distinguish between curves and clusters.
Once a curve detection threshold has been determined, then in 714, edge detection, i.e., curve detection, may be performed on the image, using the determined curve detection threshold to identify curves and clusters in the image. The identification of curves and clusters in the image may result in respective numbers of detected curves and clusters.
In 716, the number of detected curves and clusters may be analyzed, and the threshold value adjusted accordingly. For example, if the number of curves detected is too great, then the threshold may be raised, or, if the number of curves detected is too small, the threshold value may be lowered.
As
Finally, the results may be output, as indicated in 718. Outputting the results may simply mean storing the results in a particular area of storage for later use, or may include sending the results to another program or system.
FIG. 7C—Determining the Mapping Operator(s)
As
After the curves have each been normalized, then in 724, a mapping operator W_{m }for each curve may be determined which operates to emphasize differences between the curves. One way to do this is to compute W_{m }for each curve c_{m }such that for each pair of curves c_{n }and c_{m},
c_{n},c_{m}w_{m}=δ_{nm} (15)
where δ_{nm }is the Kronecker delta, is (substantially) satisfied. In other words, if c_{n }and c_{m }are very similar, then the inner or scalar product of the two curves will be close to 1, and if the two curves are dissimilar, the product will be close to zero. The application of W_{m }to the curves may thus serve to emphasize or amplify differences between the curves. As noted above, in one embodiment, the points which define each curve may be complex valued, and so the inner product may be calculated thus:
where the product is between c_{n }and the complex conjugate of c_{m}, as is well known in the art. It should be noted that the complex vectors c_{n}, c_{m}, and each W_{m }preferably all have the same number of elements. Thus, expression (16) for each pair of curves may provide a set of equations with which each W_{m }may be solved. It should also be noted that in one embodiment, a perfect solution of W_{m }(with respect to the formal definition of δ_{nm}) is not necessary, but that an approximate solution may suffice. In other words, the solution W_{m }may not meet the constraints of equation (16) exactly for every pair of curves, but may still operate to effectively discriminate between dissimilar curves.
FIG. 7D—Normalization of Discrete Curves
In 732, each of the one or more discrete curves may optionally be resampled to a common sample basis. In other words, the discrete curves may be resampled such that each discrete curve has the same number of points. In one embodiment, the discrete curves may be resampled uniformly, i.e., the sample points along each discrete curve may be evenly distributed. In another embodiment, each discrete curve may be resampled in accordance with the resampling scheme described above with reference to
In one embodiment, each point in the discrete curve or point sequence may be normalized based on the geometric center of the sequence of points. Thus, in 734, a center or average position may be calculated for each discrete curve. In this case, assuming N sequential points with respective positions (x_{n}), where n=1, N, the center x_{c }may be calculated thus:
Each point (x_{n}) may then be normalized by subtracting the center, giving a new, normalized sequence of points:
(x_{1}−x_{c}), . . . , (x_{N}−x_{c})=x_{1}′, . . . , x_{N}′. (18)
Then, in 738, the moment of the sequence or discrete curve may be normalized, for example, to 1. In this case, the moment of each sequence or discrete curve may be calculated by:
The normalized point sequence is then:
Finally, in 740, the normalized discrete curves may be output, such as to a display, memory location, or external system, among others. Thus, each discrete curve may be normalized based on its respective moment. As noted above, other normalization schemes are also contemplated for use in various embodiments of the present invention.
It should be noted that although the method is generally described in terms of matching a single discrete curve (sequence of points), multiple discrete curves (sequences of points) may also be detected and matched according to the method described. In other words, the template image may include multiple discrete curves, each corresponding to a template image object, or to different aspects of a single object, or a combination of both. A purpose of the matching phase may be to match any of the plurality of discrete curves in the template image to any of the discrete curves present in one or more target images. As mentioned above, although the methods are described in terms of images, the methods are broadly applicable to nonimage data as well, i.e., image data is but one type of data contemplated for use in various embodiments of the methods described herein. It is further noted that in various embodiments, some of the steps may occur in a different order than shown, or may be omitted. Additional steps may also be performed.
As
In 804, a target image discrete curve may be determined from the target image, corresponding to a respective object in the target image. In other words, the target image discrete curve may correspond to one or more geometric features of the respective object. As noted above, the term “discrete curve” is herein used interchangeably with the term “sequence of points”. Similarly, the terms “boundary” and “edge” are used interchangeably. For example, in one embodiment, determining the target image discrete curve from the target image may include performing boundary or edge detection on the target image to determine boundaries or edges of objects present in the target image. More specifically, the method may operate to detect at least one boundary or edge present in the target image corresponding to a shape of an object in the target image. The method may then determine a sequence of points from the detected boundary or edge which defines the target image discrete curve.
In one embodiment, a plurality of target image discrete curves may be determined from the target image. Each of the plurality of target image discrete curves may correspond to a respective image object or to a respective portion of an image object in the target image. Said another way, there may be multiple objects (or aspects of a single object) in the target image, each represented by discrete curve.
As
In an alternate embodiment, illustrated in 806 of
Thus, in this alternate embodiment, after the target image discrete curve (or target image discrete curves) has been determined, then in 806, the target image discrete curve may be mapped to a different mapped target image discrete curve using a mapping operator. The mapping operator, W(x), may operate to transform the target image discrete curve into a form (the mapped target image discrete curve) which is more easily distinguishable from (mapped) discrete curves corresponding to objects not of interest in the target image. In other words, the mapping operator may operate to emphasize differences between respective objects, or aspects of objects. In the descriptions that follow, references to target discrete curves and comparisons between the target discrete curves and the mapped template discrete curves may be interpreted in terms of the method of
In an embodiment where the target image includes a plurality of target image discrete curves, curve matching may be performed on each of the target image discrete curves relative to the mapped template image discrete curve. In this case a distance measure may be computed for each of the target image discrete curve relative to the mapped template image discrete curve. In the alternate embodiment described above, each of the target discrete curves may have been mapped to a corresponding plurality of mapped target image discrete curves prior to, or as part of, the computation of the distance measure.
It should be noted that in some embodiments, the template image may include multiple discrete curves, i.e., object of interest sequences of points, or there may be multiple template images from which the template discrete curves may be determined. In other words, there may be a plurality of objects of interest, or, the object of interest may include a plurality of subobjects, each represented by a respective discrete curve. In this case, curve matching may be performed on each of the target image discrete curves relative to each of the mapped template image discrete curves, computing a distance measure for each of the target image discrete curves relative to each of the mapped template image discrete curves.
In one embodiment, the mapped template image discrete curve may be generated from a characterization of the object of interest. In other words, the method may include characterizing the object of interest to produce the mapped template image discrete curve, for example, in the learning stage, as described above with reference to
It is noted that because the mapping operator emphasizes differences between curves, i.e., sequences of points, the distance between the target image discrete curve (or the mapped target image discrete curve) and the mapped template image discrete curve may be greater than a distance computed between the target image discrete curve and the template image discrete curve. In other words, the distance computed between the target image discrete curve and the template image discrete curve indicates a degree of difference between the original detected discrete curve in the target image (the target image discrete curve) and the original detected discrete curve in the template image (the template image discrete curve, i.e., the object of interest), while the distance between the (mapped) target image discrete curve and the mapped template image discrete curve indicates a degree of difference between the (mapped) discrete curve in the target image and the mapped discrete curve from the template image (the mapped template image discrete curve). Because the mapping operator serves to amplify the differences between the original curves, the mapped curve(s) reflect a greater distance measure.
In one embodiment, the mapping operator may be a discrete curve mapping operator which maps a first discrete curve to a second discrete curve. As mentioned above, the term “discrete curve” refers to an ordered set or sequence of points which have a certain direction. Furthermore, concatenated versions of these points do not generate intersections. In other words, the curve is simple, although in various embodiment, the curve may be open or closed. In various embodiments, the mapping operator may be a linear mapping operator, and/or a nonlinear mapping operator. In one embodiment, the mapping operator may be a SturmLiouville operator. For more information on SturmLiouville operators, please see the Theory section above.
In one embodiment, the mapped discrete curve (either the mapped template discrete curve or the mapped target discrete curve) may be a unique discrete curve generated from the template or target image discrete curve. In other words, for any template or target image discrete curve, the mapping operator may be operable to generate a second, unique discrete curve. The mapped image discrete curve may be more stable to image disturbances than the original image discrete curve. Said another way, the mapped image discrete curve may be more robust or less susceptible to disturbances, e.g., noise, distortions, or perturbations, than the original image discrete curve.
It is noted that in one embodiment, the boundary (or boundaries) detected in the target image may correspond to or define at least one visual boundary that is visually identifiable in the target image, i.e., the boundary may be a visibly distinguishable geometric feature of an object in the target image. In contrast, the mapped target image discrete curve may not define a visual boundary that is visually identifiable in the target image. In other words, the mapping operator may transform the boundary or edge defined by the target image discrete curve into a curve (defined by the mapped target image discrete curve) which bears little resemblance to the original curve (e.g., the original edge or boundary).
Similarly, whereas the boundary (or boundaries) detected to be present in the target image may correspond to or define at least one shape that is visually identifiable in the object, the mapped target image discrete curve may not define a shape that is visually identifiable in the object. Said another way, the target image discrete curve may define at least one shape or visual boundary that is visually identifiable in the target image, while the mapped target image discrete curve may define a shape or visual boundary that is not visually identifiable in the target image.
In embodiments where nonimage data are analyzed, each discrete curve may correspond to a respective data object, or to a portion of a data object. In other words, each discrete curve may define a boundary, edge, or shape in the data.
In one embodiment mapping the template or target image discrete curve to the different mapped template or target image discrete curve may include applying the mapping operator to each point in the template or target image discrete curve to generate corresponding points in the mapped template or target image discrete curve. For example, the target image discrete curve may be considered to be a first vector, where the mapping operator W and the first discrete curve vector have the same number of elements. In this embodiment, mapping the target image discrete curve to the different mapped target image discrete curve may include multiplying each element of the mapping operator W with corresponding elements in the first vector to generate a second vector. The elements of the second discrete curve vector may then comprise the mapped target image discrete curve. This description applies to the template image discrete curve(s), as well.
As also mentioned above, in some embodiments, the elements of the first discrete curve vector may be complex. In this case, multiplying each element of the mapping operator W with corresponding elements in the first discrete curve vector may comprise multiplying each element of the mapping operator W with complex conjugates of corresponding elements in the first discrete curve vector, as is wellknown in the art.
In 808A of
Alternately, in the embodiment of
Finally, in 810, pattern matching results may be generated based on the distance or distances computed in 808 (A or B). In one embodiment, the computed distance may be compared to a threshold value, and if the distance is less than the threshold value, the object in the target image represented by the (mapped) target image discrete curve may be considered a match with respect to the object of interest represented by the mapped template image discrete curve. It is noted that a computed distance value of zero indicates a perfect match. In one embodiment, a matching score for the target image object may be calculated based on the proximity of the distance value to zero. Thus, generating pattern matching results may comprise generating information indicating one or more matches for the object of interest in the target image.
In an embodiment where the target image includes a plurality of target image discrete curves, each of which may be optionally mapped to a corresponding plurality of mapped target image discrete curves, pattern matching results may be generated based on the distance measures for each of the (optionally mapped) target image discrete curves with respect to the mapped template image discrete curves. Similarly, when the template image includes a plurality of discrete curves, pattern matching results may be generated based on the distance measures for each of the (optionally mapped) target image discrete curves with respect to each of the mapped template image discrete curves.
In one embodiment, after the pattern matching results have been generated in 810, the method may include outputting the pattern matching results. In various embodiments, outputting the pattern matching results may include, for example, sending the results to an external system, such as to an external computer over a network, displaying the results on a display, such as a computer display or a printer, storing the results in a particular memory location or log, or signaling a system or program to perform a task.
In one embodiment, the mapping operator(s) may be recalculated to more effectively match and/or discriminate between template image discrete curves and target image discrete curves, e.g., using information related to one or more target images. For example, a new or modified mapping operator W (or a plurality of new or modified mapping operators W_{m}) may be computed using the template image discrete curves and discrete curves from additional target images or discrete curves which may not have been included in the first calculation of W. In various embodiments, the original mapping operator(s) W may be replaced, or may simply be modified using the additional discrete curve information. Thus, some or all of the terms of the mapping operator(s) may be configurable for different objects of interest. In other words, the mapping operator may be computed or adjusted to “tune” the operator for particular objects or sets of objects.
In one embodiment, the mapping operator may include at least one parameter that is configurable to enhance differences between respective objects of interest and objects not of interest. In other words, the mapping operator may include a parameter which may be adjusted to “tune” the operator for particular objects or sets of objects. Said another way, given an object of interest and one or more objects not of interest, the at least one parameter may be adjustable to particularly emphasize differences between that object of interest and the one or more objects not of interest.
For example, in one embodiment, first information may be received regarding the object of interest, e.g., which characterizes the template image. Second information regarding one or more objects that are not of interest may also be received. At least one parameter for the mapping operator may then be determined based on the first and second information, where the parameter may be determined to enhance a distance between mapped discrete curves or point sequences corresponding to the object of interest and mapped discrete curves or point sequences corresponding to the one or more objects that are not of interest. The mapping operator may then be configured according to the determined parameter(s).
Thus, the mapping operator may be computed, adjusted or tuned to enhance or increase a distance between mapped discrete curves (point sequences) corresponding to the object of interest and mapped discrete curves (point sequences) corresponding to objects that are not of interest.
Shift, Scale, and Rotation Invariance
A more difficult situation arises when rotations of all discrete curves are also valid transforms. Conceptually, formulas (13) and (14) can still be used to perform the matching procedure. However, in this approach, instead of looking for numbers in formula (1) that are close to 1, the goal is to look for a complex number that has a magnitude close to 1. The phase of the complex number represents the relative angle between the original curve and the match found.
Let c_{1}, . . . , c_{M }be complex discrete curves of same size in the complex plane. The best match to a curve c must be determined.
As
After all of the discrete curves have been normalized, then, in 904, mapping operators W_{m }may be computed based on the discrete curves, as described above with reference to
In 908, degenerate (rotated) discrete curves may optionally be removed from the template image curves. In other words, if one (or more) of the numbers c_{n},c_{m}_{w}_{m }for n≠m has (have) a magnitude of close to 1, then the curves are not independent. In other words, they are rotated versions of other curves in S, thus, it may be necessary to eliminate such curves from S.
It may be noted that steps 722, 904, and 908 above together may compose one embodiment of a learning stage 602A, as referred above with reference to
Once the degenerate curves have (optionally) been removed from the set of discrete curves S, then in 910, a curve c from a target image (or data set) may be acquired and normalized and/or resampled. In other words, curve c may be acquired from the target image, then normalized and/or resampled such that the discrete curve c has the same number of points as each of the template curves. Additionally, in one embodiment, the curve c may be resampled in accordance with a sampling scheme used for each of the template curves.
Then, in 912, for each template image curve c_{m}, the complex value c,c_{m}_{w}_{m }may be computed. Once all of the complex values for c,c_{m}_{w}_{m }have been calculated, then in 914, the maximum value may be determined, where the maximum value corresponds to a best match among the template image discrete curves. In other words, the magnitudes of all of the computed complex numbers may be determined, and the maximum magnitude ascertained. The index m belonging to this maximum represents the best match among the given set c_{1}, . . . , c_{M}. The phase of this complex number may be used to determine the angle between c and c_{m}.
As noted above, in one embodiment, the mapping operator may be considered to be W_{m}^{1/2}, in which case the mapping operator may be applied to both the template image curve c_{m }and the target curve c.
Finally, in 606, the output pattern matching results may be output, e.g., for use by the system, or by an external system, as desired. It is noted that steps 910, 912, and 914 above together compose one embodiment of a matching stage 604A, as referred above with reference to
NonPositive Weights
The original nonnegativity constraint of the weight function W follows directly from the identity:
where v is a complex weight function, and y and z are discrete curves in the plane. The constraint may be expressed thusly: w_{n}=v_{n}v_{n}*=v_{n}^{2}. The quality of matching routines may be further improved when formula (21) is replaced with the more general version:
where w is a complex discrete weight function that can vary with z. Compared to (21) the new formula (22) may offer many new degrees of freedom.
As
After all of the discrete curves have been normalized, then, in 905, complex mapping operators W_{m }may be computed based on the discrete curves, as described above with reference to
In 908, degenerate (rotated) discrete curves may optionally be removed from the template image curves, and in 910, a curve c from a target image may be acquired and normalized. Then, in 912, for each template image curve c_{m}, the complex value c,c_{m}_{w}_{m }may be computed. Once all of the complex values for c,c_{m}_{w}_{m }have been calculated, then in 914, the maximum value may be determined, where the maximum value corresponds to a best match among the template image discrete curves. The curve from the set which produces the maximum magnitude represents the best match among the given set c_{1}, . . . , c_{M}. As noted above, the phase of this complex number may be used to determine the angle between c and c_{m}.
Finally, in 606, the output pattern matching results may be output, e.g., for use by the system, or by an external system, as desired.
The method of
Optimal Discrete Closed Curve Descriptors in 2D
The above methods provide means for matching discrete open curves. However, there are many cases where the curves to be analyzed and matched are closed curves. Closed curves do not have a unique start and end, and so a matching process must take into account the fact that rotations are possible. As described below, a function may be defined which provides a similarity measure between closed curves.
Let y=(y_{1}, . . . , y_{N}) and z=(z_{1}, . . . , z_{N}) be two discrete closed curves in the complex plane, C. Let y and z be normalized, i.e.
According to the first part of (5), the distance between these two curves y and z is
Formula (23) can be used to define a similarity measure between y and z that is constant when y and/or z are shifted cyclically and/or are rotated in reverse order.
FIG. 10A—Discrete Closed Curves
The above equation (23) provides a basis for the following theorem:
Theorem 1:
Let
d is a metric in the space f representing all normalized discrete closed curves of size N in the complex plane. The derived distance in the space of arbitrary discrete closed curves in the complex plane (d applied to normalized curves) is a semimetric.
According to Theorem 1, two discrete closed curves in the complex plane can be regarded as similar if and only if the cyclic crosscorrelation or cyclic convolution of normalized versions of y and z generate a maximal magnitude of almost 1. In what follows it is assumed that there is a natural order of all points in y and z in the complex plane, i.e. there is no need to take cyclic convolutions into account.
This definition of distances in spaces of discrete closed curves works very well for all mathematically defined curves. However, in many application fields one has to deal with noisy data and more robust methods are desirable that are based on additional information regarding the structure of the underlying discrete curves. Optical character recognition and geometrically oriented pattern matching are two examples, among many others.
For that reason discrete closed curves without symmetry properties should generate crosscorrelations with a pronounced peak when the shift is 0. Unfortunately, peaks are rarely extremely sharp for typical curves. For example, the crosscorrelation of the character “D” in
More precisely, let be given a discrete closed curve d=(d_{1}, . . . , d_{N}) of size N in the complex plane. Let W be an unknown complex weight function. Ideally, W is a smooth discrete closed curve itself and satisfies equations
In practical situations this goal is not attainable. However, the weaker system
where W_{N+1}=W_{1 }can be solved in the leastsquare sense. The new curve dW* can be normalized. The second expression expresses the idea that W should be “continuous”, i.e. that differences between neighboring terms of W should be relatively small.
A robust matching routine can be derived based on (25), as described below with reference to
FIG. 10B—Matching Against a Given Discrete Closed Curve
As
In 1008, the curve dW* may be normalized. In other words, once the complex mapping operator W is computed in 1004, the complex conjugate of W may be applied to the curve d and the resulting curve normalized.
In 1010, a target discrete closed curve c may be acquired and normalized, e.g., as described above. Then, in 1012, for each cyclic shift of the curve d, the complex number c,d^{k}_{W }may be calculated, i.e., c,d^{k}_{W }for k=0, . . . , N−1 It should be noted that cyclically permuting c rather than d gives the same results, and is equivalent.
Then, in 1014, the maximum of the complex values computed in 1012 may be determined and compared to unity to determine the best match among the template image discrete curve cyclic shifts d^{k}. The comparison of the best match to unity is useful in that in general, the match is acceptable if and only if the corresponding magnitude is close to 1 in value. The particular cyclic shift k of the best match indicates the angle of rotation.
Finally, in 606, the pattern matching results, e.g., the best match, may be output, as described above.
Thus, the method “orthogonalizes” the given closed curve. In other words the original curve is as “orthogonal” to all rotated versions as possible. This enables the method to decide (a) whether two closed curves match and (b) determine the angle of rotation reliably. Thus, an embodiment of the method of
FIG. 10C—Example of Closed Curve Matching
One can even give up the requirement that W is a weight function, i.e. the optimization problem can be reformulated as
The approach (26), though more general, may be numerically less robust than (25). Thus, in preferred embodiments of the present invention, the use of (25) is preferred to that of (26).
The generalization of the method of
denote the weighted scalar product of closed curves c_{n }and c_{m}, where the former is cyclically shifted by i and the latter by j. The unknowns W_{1}, . . . , W_{N }are nonnegative real numbers (composing the mapping operator). To improve the quality of the matching procedure, it is desirable that the following identities hold true.
c_{n}^{i},c_{m}^{j}_{W}=δ_{n+i,m+j} (28)
In practical applications (28) cannot be achieved exactly. Equation (28) may be replaced with the following weaker optimization problem.
It can be shown that (29) results in an optimization problem of the form
W^{T}CW=min!
AW=b
W_{1}, . . . , W_{N}≧0 (30)
where the matrix C is square, symmetric, and positive definite. It may be shown that b=(1, . . . , 1)^{T}, A is a square real matrix with positive entries, where the rows are normalized in the sumofsquares sense. It follows that W=(1, . . . , 1)^{T }is a first feasible solution. Again, efficients algorithms for (30) exist, e.g. Active Set Method or Hildrethd'"'"'Esopo Algorithm (e.g. Bronshtein and Semendyayev [1997]).
FIG. 11—Matching Against a Set of Discrete Closed Curves
As
Then, in 1104, using the normalized set of discrete closed curves, a nonnegative mapping operator w may be computed such that equations (29) and (30) hold. In other words, w satisfies:
In 1010, a target discrete closed curve c may be acquired and normalized, e.g., as described above.
Then, in 1012, for each template discrete closed curve d, the complex number c, d^{k}_{W }may be calculated for each cyclic shift of the respective curve d, i.e., c, d_{m}^{k}_{W }for k=0, . . . , N−1, m=1, . . . M. As noted above, an equivalent calculation is c^{k}, d_{m}^{k}_{W }for k=0, . . . , N−1, m=1, . . . M, where curve c is cyclically shifted, rather than d_{m}.
Then, in 1014, the maximum of the complex values computed in 1012 may be determined and compared to unity to determine the best match among the template image discrete curve cyclic shifts d^{k }for each curve d_{m}. The match is acceptable if and only if the corresponding magnitude is close to 1 in value. The particular cyclic shift k of the best match curve indicates the angle of rotation between curve c and the optimal match d^{k}_{m}.
Finally, in 606, the pattern matching results, e.g., the best match, may be output, as described above.
Closed Curve Descriptors in 3D
In some applications, it may be desirable to analyze and match higher dimensional curves, for example, 3dimensional curves. The following describes an approach for matching rotated versions of a 3D curve.
Let y=(y_{1}, . . . , y_{N}) and z=(z_{1}, . . . , z_{N}) be two discrete closed curves in R^{3}, i.e., in realvalued 3D space. Let y and z be normalized, i.e.
Let the 3D curve z be a rotated version of y. For mathematical reasons, the rotation angle between the two curves is required to be somewhat larger than zero, i.e., the algorithm is not applicable for small rotations. However, this is not problematic because one can easily check whether y and z are identical beforehand.
A fast method for generating the underlying rotation is desired. To this end let q be the axis of rotation and τ be the angle of rotation about this axis q. The vector q is perpendicular to all vectors y_{n}−z_{n}. Moreover, q is parallel to all of the vectors (y_{n+1}−z_{n+1})×(y_{n}−z_{n}) i.e. (31) provides a good estimate for the axis of rotation q.
Assume q=(0,0,1). In a second step it will be shown how to reduce the case of a general vector q to this specific situation.
In case of q=(0,0,1) the matching process in 3D can be translated into two separate routines in the complex plane C, and on the real number line, R. To this end, a 3D vector may be split into components as follows:
(y_{n,1},y_{n,2},y_{n,3})(y_{n,1}+iy_{n,2}) and (y_{n,3})
(z_{n,1},z_{n,2},z_{n,3})(z_{n,1}+iz_{n,2}) and (z_{n,3})
The center of each of these objects is 0, but they are not normalized. Using the matching strategies in C and R it follows that:
In (32) all the terms are equal if and only if for all n it is the case that:
y_{n,1}+iy_{n,2}=e^{iτ}(z_{n,1}+iz_{n,2})
y_{n,3}=z_{n,3} (33)
where τ is a fixed real number.
Equations (32) and (33) can be interpreted as a distance measure between y and z where all rotations are valid operations. The curves y and z have distance 0 if and only if the projection curves in C and R have this property.
Arbitrary unit vectors q=(q_{1}, q_{2}, q_{3}) in (31) can be treated in the following way:
The matrix
is orthogonal and maps q onto (0,0,1). In other words, it is sufficient to determine the distance between the curves Qy_{1}, . . . , Qy_{N }and Qz_{1}, . . . , Qz_{N}. According to (31) the new q is identical to (0,0, 1).
FIGS. 12A and 12B—Numerical Improvements and Alternatives
A number of possible improvements may be considered for some embodiments of the above described methods. For example, for performance reasons it may be desirable to replace the computation of full crosscorrelation according to (25) with faster methods. Two such approaches are illustrated in
FIG. 12A—Scalar Product as CrossCorrelation Replacement
In some applications, one can further manipulate weight functions in such a way that there is no need to compute a full crosscorrelation. In fact, the calculation of one scalar product may be enough to generate a valid estimate for the best possible match. To achieve this goal the correct match may be encoded as phase information.
Consider:
The constants f_{k }are chosen appropriately, e.g. 1 for k close to 1 and 0.5 for all the other k.
FIG. 12B—Scalar Product as CrossCorrelation Replacement Using Linearization of Angle
FIGS. 1313B—SubAngle Accuracy
In some applications, it may be desirable to estimate small angular shifts between curves. For example, in geometric pattern matching applications, two discrete curves to be tested for a match may only differ by a small rotation. Prior art methods have typically been limited to determining corrective rotations equal to or greater than the angular difference between successive points in the discrete curves, which may be considered as an intrinsic angular resolution of the curves. In contrast, embodiments of the methods described herein may operate to determine corrective rotations of angles substantially less than these angular differences, hence the term “subangle accuracy”. Note that as used herein, the terms “angular shift” and “cyclic shift” refer to rotations, and that in this section, the term “shift” may also be used to refer to such rotations, where the fact that the shift is an angular or cyclic shift is assumed. The following describes one approach to that end.
Given a smooth continuous closed curve y and a second smooth curve z in the complex plane of the same length (without loss of generality, let the length be 1) such that y and z almost match, and where the mismatch is entirely based on slight rotational shifts, i.e., rotations, between y and z. In other words,
z(τ)=y(τ+α)
where α is a small but unknown real number and τ is the arclength. To estimate α, the term
may be minimized, which results in
where denotes the realvalued portion of the expression. Formula (35) can be translated directly into expressions valid for discrete closed curves y=(y_{1}, . . . , y_{N}) and z=(z_{1}, . . . , z_{N}) where the latter is a slightly rotated (rotationally shifted) version of the former. Assume both curves were sampled equidistantly. The discrete version of the estimate (35) is
In (36) the value of α is normalized with respect to the index, i.e. a value of 1 represents a shift or rotation of exactly 1 index point. It is noted, however, that in general, the computed value of α will be substantially less than 1, i.e., the value will generally be less than the intrinsic angular resolution of the discrete curves.
FIG. 13—Method For Determining SubAngle Accuracy
As
Then, in 1304, an interpolated (reshifted or rerotated) version of z may be calculated using the computed value of α. It is noted that various interpolation methods may be used. Quadratic or spline interpolations generally preserve the original shape better than linear interpolations and so may be used in preferred embodiments.
In 1306, a determination may be made as to whether further improvements may be made. If further improvements may be made, then the method may return to 1302, calculating a new value of α using the interpolated (reshifted or rerotated) version of z, and continuing as described above. If no further improvements may be made, then the results, i.e., α, may be output, as indicated in 1308.
Note that since the new value of α is based on a “corrected” version of curve z, the new value of α is preferably added to the original or current value to produce an estimate of the rotational angle between the two original curves y and z, and thus, with each iteration the “cumulative” α may be updated. In other words, the resultant α is given by:
where i is the iteration index, and α_{i }refers to each computed value. The results output in 1308 are preferably this cumulative α.
A more detailed embodiment of the method of
It should be noted that equations (35), (36), and the method of
FIG. 13A—Method for Determining SubAngle Accuracy for 2D Discrete Curves
As
Then, in 1302, a current estimate of the rotational shift, referred to as α_{i}, may be computed according to equation 36, where α_{i }is an estimate of the angle of rotation between y and z, and where i is an iteration index. Note that for iteration purposes, the curve z is denoted by z^{i}, indicating successive versions of the curve for each iteration.
In 1303, α may be updated. More specifically, the current estimate of the rotational shift α_{i }may be used to update the cumulative rotational shift α (originally equal to zero) where
and α_{i }refers to each computed rotation estimate, as noted above.
Then, in 1304, a rotationally shifted version of z may be calculated using the computed value of α_{i}. In other words, z^{i+1 }may be generated. As noted above, various interpolation methods may be used, but quadratic or spline interpolations generally preserve the original shape better than linear interpolations and so may be used in preferred embodiments. Note that the new version of z may be computed by rotating the original curve z by the updated cumulative rotational shift α, or alternatively, may be computed by rotating the previous version of z by the current estimate α_{i}. The former approach is preferably used to minimize accumulated numerical errors.
In 1316, a determination may be made as to whether a stopping condition occurs. If a stopping condition is not detected, then the method may return to 1302 and proceed iteratively, i.e., i=i+1, calculating a new value α_{i }using the current rotationally shifted version of z, performing the above steps in an iterative manner until the stopping condition obtains. Note that since the new value of α_{i }(i.e., α_{i+1}) is based on the rotationally shifted version of z, the magnitude of the new value will generally be less than that of the current (i.e., previous) value, and thus, as each successive computation of α_{i }is made, the values will tend toward zero, although the progression may include both positive and negative values.
In one embodiment, the stopping condition may occur when the magnitude of the computed value of α_{i }is less than some specified threshold value (e.g., epsilon, representing a sufficient level of accuracy), typically after only a few iterations (possibly even just one). Alternatively, in another embodiment, the stopping condition may occur when a certain number of iterations have elapsed. Of course, any other stopping condition may be used as desired.
If in 1316, a stopping condition is determined to occur, then the results may be output as indicated in 1308, e.g., a final cumulative value of α may be output, e.g., to a display device, to a file, to a process, to an external system, and so forth, where α is an improved estimate of the rotational difference between the two curves y and z.
In one embodiment, the most recent version of curve z (e.g., z^{k}, where k is the index value of the last iteration) may be output, e.g., to a matching process, where curves y and z^{k }may be analyzed to determine whether or to what degree the curves match.
Is should be noted that equations (35), (36), and the method of
SubAngle Accuracy in Spatial Curves
With some modification, the above subangle techniques may be applied to spatial curves, e.g., 3dimensional discrete curves. Applications of the techniques described herein are also contemplated for higherdimensional curves, as well, e.g., discrete curves of four dimensions or higher.
Given a smooth continuous closed spatial curve y and a second smooth spatial curve z of same length (without loss of generality, let the length be 1) such that y and z almost match where the mismatch is entirely based on slight rotations between y and z of the following form:
z(τ)=y(τ+α),
where α is a small but unknown real number and τ is the arclength. An estimate of α is desired. To this end the term
is minimized (y and z contain three components each) which results in
Equation (37) may be directly translated into expressions valid for discrete closed curves y=((y_{11}, y_{12}, y_{13}), . . . , (y_{N1}, y_{N2}, y_{N3})) and z=((z_{11}, z_{12}, z_{13}), . . . , (z_{N1}, z_{N2}, z_{N3})) where the latter is a slightly rotated version of the former in the aforementioned sense. In a preferred embodiment, both curves are sampled substantially equidistantly. The discrete version of the estimate (37) is
In one embodiment, the value of α in (38) may be normalized with respect to the index, i.e. a value of 1 may stand for a rotation or cyclic shift of exactly 1 index point. It is noted, however, that in general, the computed value of α will be substantially less than 1, i.e., the value will generally be less than the intrinsic angular resolution of the discrete curves.
FIG. 13B—Method for Determining SubAngle Accuracy for Spatial Curves
As
Then, in 1312, a current estimate of the rotational shift, referred to as α_{i}, may be computed according to equation 38, where α_{i }is an estimate of the angle of rotation between y and z, and where i is an iteration index. As noted above, for iteration purposes the curve z is denoted by z^{i}, indicating successive versions of the curve with each iteration.
In 1303, α may be updated. More specifically, the current estimate of the rotational shift α_{i }may be used to update the cumulative rotational shift α (originally equal to zero) where
and α_{i }refers to each computed rotation estimate, as noted above.
Then, in 1314, a rotationally shifted version of the spatial curve z may be calculated using the computed value of α_{i}. In other words, z^{i+1 }may be generated. In one embodiment, rotationally shifting the curve z may include interpolating the curve. As noted above, quadratic or spline interpolations are preferably used, although various other interpolation methods may also be used as desired. As also noted above, the new version of z may be computed by rotating the original curve z by the updated cumulative rotational shift α, or alternatively, may be computed by rotating the previous version of z by the current estimate α_{i}, although the former approach is preferably used to minimize accumulated numerical errors.
In 1316, a determination may be made as to whether a stopping condition occurs. If a stopping condition is not detected, then the method may return to 1322 and proceed iteratively, calculating a new value of α_{i }(i.e., α_{i+1}) using the current rotationally shifted version of z, and performing the above steps in an iterative manner until the stopping condition obtains.
As described above, in one embodiment, the stopping condition may occur when the computed value of α_{i }is less than some specified threshold value (e.g., epsilon, representing a sufficient level of accuracy), or, alternatively, the stopping condition may occur when a certain number of iterations have elapsed. Any other stopping condition may also be specified as desired.
If in 1316 a stopping condition is determined to occur, then the results may be output, as indicated in 1308, e.g., a final cumulative value of α may be output, e.g., to a display device, to a file, to a process, to an external system, and so forth, where α is an improved estimate of the rotational difference between the two curves y and z.
In one embodiment, the most recent version of curve z (e.g., z^{k}, where k is the index value of the last iteration) may be output, e.g., to a matching process, where curves y and z^{k }may be analyzed to determine whether or to what degree the curves match, as described above.
Thus, various embodiments of the above methods may be used to determine subangle accuracy for two and threedimensional discrete curves (or even higherdimensional curves), where a second curves is a slightly rotated version of a first curve. Once the second curve has been rotated in accordance with the computed value of α, the curves may be tested or processed to determine whether and/or to what extent they match, as described above.
Applications of the Spatial Curve SubAngle Technique
The method of
Artificial 3D Curves
In addition to these standard 3D applications, there are other, less obvious, applications. For example, in one application of the method of
For example, in one embodiment, the spatial curve approach described above with reference to
In contrast, in the present approach, the grayscale information is not discarded, but instead may be reintroduced, i.e., to the curves as an extra dimension. It is noted that a sharp transition can be based on completely different grayscale values, in that edges are determined by gradients, e.g., by relative differences, rather than by absolute values, and so in an alternative embodiment, the edge detection may be performed in the grayscale domain. Thus, for each point in the curves, a number representing the grayscale value may be added to the existing (x,y) coordinates, resulting in an “artificial” spatial curve (x,y, grayscale).
Now, the method of
Example Application: Wafer Manufacturing and Quality Control
In an automated manufacturing facility where semiconductor wafers are produced, consider an image of a wafer (circle on background) where there are notches on the perimeter of the wafer. The notches may be encoded or represented by grayscales, e.g., the notches are darker or brighter than the background. Classical geometric pattern matching approaches (for slightly rotated curves) are not adequate because a circle is radially symmetric, and so rotations of the (black and white) 2D image are all degenerate. However, using the above approach, the grayscale information may be included as a third dimension, in which case the image may be rotated to attempt to align the notches, and so facilitate pattern matching, e.g., for quality control.
It should be noted that this approach is also applicable in higher dimensions, where, for example, other additional image data may be included as corresponding other dimensions to be added to curves that are originally 2D or 3D (or even higher dimensionality). For example, where the first discrete curve and the second discrete curve each comprise a respective sequence of points, each point may include a respective two or more spatial coordinates, and a respective one or more additional coordinates, where each additional coordinate is based on respective additional image data associated with the point. Each of the one or more additional coordinates may then be interpreted as additional spatial coordinates for the point. Thus, the effective dimensionality of the curves may be increased by including additional image data for each point as additional spatial coordinates or dimensions (for example: 3 color dimensions).
FIGS. 14A and 14B—Alternative 2D Matching Method
Let y=(y_{1}, . . . , y_{N}) and z=(z_{1}, . . . , z_{N}) be two discrete closed curves in the complex plane. Let s be a fixed natural number. Generally, s will have a value of 1, however, in various embodiments, other choices are possible and even desirable from a numerical standpoint. Let y and z be normalized in the following sense:
where the index notation is understood cyclically. It is the case that
In (38) a complex number is defined where the magnitude is less than 1 unless z is an exact rotated version of y (CauchyHoelderSchwarz inequality).
(38) generates a new class of curve matching algorithms. Theorem 1, described above, uses complex vectors y and z to match discrete closed curves. According to (38) many other approaches are valid and may offer numerical advantages. In particular, the choice s=N/2 may reduce the computational load in cases where the y and zcomponents are equally distributed.
The following method matches two discrete closed planar curves y and z of size N in the complex plane where shift, scaling, and rotation are valid operations.
FIG. 14A—Matching 2D Discrete Curves
As
In 1404, the two discrete curves, y and z, may be normalized, in accordance with equation (37) above. In other words, the normalized curves have N 2D points, and the lengths satisfy equation (37).
In 1406, all complex numbers
may be calculated for k=1, . . . , N.
In 1408, the values of k for which p approaches unity may be determined to indicate matches. In other words, if any of the calculated complex numbers has a magnitude close to 1, a match has been found.
Finally, in 606, the pattern match results may be output.
FIG. 14B—Illustration of 2D Curve Matching
It may also be possible to apply schemes used in (25) and the method of
where W is a complex weight function.
A second method may be based on the simple observation that (y_{1}y_{1}*, . . . , y_{N}, y*_{N}) and (z_{1}z_{1}*, . . . , z_{N}z_{N}*) can be regarded as realvalued versions of the original discrete and normalized curves y and z (sum of norms is equal to 1). In other words, matching of discrete curves in the complex plane can be translated into matching of discrete curves in the real number line. The latter is faster and an implementation is more straightforward. This approach is valid because of the following observation. A perfect matching of (y_{1}y_{1}*, . . . , y_{N}, y_{N}*) and (z_{1}z_{1}*, . . . , z_{N}z_{N}*) is achievable, if and only if these two sequences are exactly the same. Furthermore, the discrete curves y and z are equally sampled and have the same orientation in the complex plane. It therefore follows that the discrete curves y and z coincide in the complex plane.
FIG. 15—Matching 3D Closed Curves
As
A unit rotation axis vector q may then be computed based on equation (31), as indicated in 1504. Then, in 1506, a determination may be made as to whether q=(0,0,1), i.e., whether q is equal to the zaxis. If q=(0,0,1), then the method continues with step 1514 below.
If q is not equal to (0,0,1), then an orthonormal matrix Q may be computed based on q, in accordance with equation (34), as indicated by 1508. Then, in 1510, y (or y′)=Qy and z=Qz may be computed. In other words, each curve may be multiplied by the matrix Q.
In 1512, the expression:
may be calculated where n refers to a particular point in the curve, and the second subscripts indicate the first, second, and third components of the data point, i.e., the x, y, and z components.
In 1514, the value of p computed in 1512 may be compared to unity to determine whether the curves y and z match, where y and z match if and only if p is close to 1.
Finally, in 606, the pattern matching results may be output, as described above. It should be noted that if one is to perform matching between y and all cyclically shifted versions of z (or between z and all cyclically shifted versions of y), the above steps must be performed N times.
Applications
Two typical applications related to machine vision that may be successfully solved with methods described herein are now described.
Geometric Pattern Matching Based on Edges
In geometric pattern matching, e.g., discrete curve matching, a known template may be characterized geometrically (based on shape). It is common to use edge information. From a realtime prospective, the socalled learning phase is less demanding and lists of efficient descriptors of detected curves can be built up carefully. During the matching process itself the template may be searched for in a continuous (realtime) stream of images. In many cases the actual template is a shifted, rotated, and/or scaled version of the original template.
Optical Character Recognition (OCR)
Various embodiments of the method presented herein are particularly suited for optical character recognition. More specifically, the mapping of standard alphanumeric characters to forms more easily discriminated using a computed weighting function or mapping operator may greatly improve the reliability of OCR, such as may be used in optical scanners and reading machines for the visually impaired, among others applications.
Although the embodiments above have been described in considerable detail, numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.