This invention relates to a method for fast high precision matching.
Pattern search is a simple yet powerful machine vision tool. Given a template pattern and an image, its objective is to find all instances of the patterns in the image. It involves two steps, a search step and a matching step. The search step places the pattern at all valid poses (locations, rotation angles, sizes) of the image being searched. The matching step determines the goodness of the match between the pattern at a given pose and the subset of the image corresponding to the pose. For advanced applications, it is desirable that the matching step produces high precision (that is, subpixel position, subsampling scale and rotation) results.
Normalized correlation method (Manickam, Swami, Roth, Scott D., Bushman, Thomas, “Intelligent and Optimal Normalized correlation for High-Speed Pattern Matching”, NEPCON WEST 2000, February 2000) of fixed rotation and scale has been widely used as the matching method in many machine vision applications. The match score of normalized correlation is largely independent of linear variations in object shading caused by reflectivity or illumination variations.
A rotation and scale invariant pattern matching method was disclosed (Rotation and Scale Invariant Pattern Matching Method, U.S. Pat. No. 6,640,008) that generates a polar coordinate representation of the pattern template image that allows for fast linear search of scale along the radius axis and rotation along the angular axis. A fast regular shaped pattern search method was disclosed (Fast Regular Shaped Pattern Searching, U.S. patent application Ser. No. 10/255,016) that performs fast pattern matching with flexible projection kernels to construct regular-shaped patterns using an accumulation method. A fast invariant searching method was disclosed (Fast Invariant Pattern Search, U.S. patent application Ser. No. 10/302,466). It generates rotation and scale invariant profiles for fast invariant search using the fast regular shaped pattern construction method. In addition, a fast pattern searching method was disclosed (Fast Pattern Searching, U.S. patent application Ser. No. 10/283,380) that performs fast scale and aspect ratio invariant search.
The above prior art approaches are not designed for highly precise sub-pixel and sub-sampling matching. They return the discrete pixel position that yields the best match and the coarse rotation and scale estimate. A surface fitting approach (Gleason, S. S., M. A. Hunt, and W. B. Jatko, “Subpixel Measurement of Image Features Based on Paraboloid Surface fit”, SPEE Vol. 1386. Machine Vision Systems Integration in Industry, 1990) is attempted for subpixel matching. This approach fits the surface of the template matching scores (such as normalized correlation values) and estimates the maximum position from the surface for subpixel matching results. The fitting method suffers from the underlying nonlinear matching functions whose scores cannot be well characterized by the fitting surfaces. This, therefore, could yield misleading subpixel (for shift) or subsampling (for rotation and/or scale) matching results. It is reported that the error of the template matching score fitting based method is about 13% (Frischchlz Robert W. and Spinnler, Klaus P. “Class of algorithms for real-time subpixel registration” Proc. SPIE Vol. 1989, p. 50-59, Computer Vision for Industry, Donald W. Braggins; Ed).
A more accurate approach is to perform subpixel and subsampling interpolation in the image domain. Then, template matching is performed on the interpolated higher resolution image. This could yield more accurate results than performing interpolation on the matching score surface. Depending on the interpolation method, system noise and the number of bits per pixel used to quantized the data, it is expected that a midrange error of 0.01 to 0.05 pixel could be achieved using this method (Frischchlz Robert W. and Spinnler, Klaus P. “Class of algorithms for real-time subpixel registration” Proc. SPIE Vol. 1989, p. 50-59, Computer Vision for Industry, Donald W. Braggins; Ed). However, interpolation on the image domain for high precision matching requires large data volume and matching computation, which is too expensive for deployment in practical applications.
A prior art approach (“Golden template comparison for rotated and/or scaled images” U.S. Pat. No. 5,850,466) stores, in an array, a varied plurality of golden template images, each golden template image being characterized by a different combination of rotation and/or scale and/or sub-pixel translation. The array is indexed by the respective quantized rotation and/or quantized scale and/or sub-pixel translation of each version of the golden template image. This approach still requires a large number of template storage and computational cost for matching at high precision. So it is still impractical.
This invention provides a fast method for high precision matching with the equivalent subpixel and subsampling interpolation in the image or template domain without actual performing the subpixel interpolation and/or subsampling. It achieves the high precision through sampling parameter optimization. Therefore, very fine sampling precision can be accomplished without the difficulty of high resolution image/template storage and expensive computation for actual matching at high resolution.
This invention includes a robust high precision matching method that allows the matching of noisy or imperfect data by limiting the contribution from each pixel and/or weighting the pixels by their significance/reliability, etc. The speed advantage is applicable to the robust matching methods of this invention.
This invention is generalized to include the high precision scale and rotation invariant matching through parameter optimization on log-converted radial-angular coordinate. This invention can be easily generalized to three-dimensional or higher dimensional invariant high precision pattern search and can achieve even greater speed advantage comparing to the prior art methods. Therefore, it can be used in applications such as 3D medical imaging, dynamic medical imaging, confocal microscopy, live cell assays in drug discovery, or ultrasound imaging.
A further objective of this invention is to allow the software implementation of the fast high precision matching method in a general computer platform without any special hardware to reduce cost and system complexity.
A fast high precision matching method receives an input image and a template. An initial search method uses the input image and the template to create an initial search result output. A high precision match uses the initial search result, the input image, and the template to create a high precision match result output. The high precision match method estimates high precision parameters by image interpolation and interpolation parameter optimization. The high precision match method also performs robust matching by limiting pixel contribution or pixel weighting. An invariant high precision match method estimates subpixel position and subsampling scale and rotation parameters by image interpolation and interpolation parameter optimization on the log-converted radial-angular transformation domain.
The preferred embodiment and other aspects of the invention will become apparent from the following detailed description of the invention when read in conjunction with the accompanying drawings, which are provided for the purpose of describing embodiments of the invention and not for limiting same, in which:
I. Application Scenarios
A high precision matching produces highly precise results such as subpixel matching positions, high precision angles, scales, and/or focus positions. The processing flow of a fast high precision matching application scenario of this invention is shown in
As shown in
The initial search includes non-invariant and invariant searches. Similarly, the high precision match includes non-invariant and invariant high precision matches. Non-invariant search and match methods search and match template position(s) from an input image 100. The invariant search and match methods search and match template 102 and input image position subject to rotation, scale, and other variations such as focus changes, etc.
II. Non-Invariant High Precision Match
The non-invariant high precision match method produces sub-pixel matching results. In one embodiment of the invention, the basic formula of the non-invariant high precision match is described in the following section.
II.1. Matching Function
The typical matching operation is based on the normalized correlation method. The normalized correlation based matching function between two images I and J, Mat(I,J), can be described by the following formula:
Where COV(I,J) is the covariance between images I and J and is described by the following formula
and the variance of image I, VAR(I) is described as
The image region area N is described as
The variance of image J, VAR(J) can be similarly defined.
II.2. High Precision by Image Interpolation
The high precision is achieved by image interpolation. In one embodiment of the invention, the image interpolation is performed by linear interpolation. As an example, we describe bilinear interpolation between four pixels in this section.
Let the interpolated image of input image I be Kαβ. Where α and β (0≦α,β<1) are subpixel values in x and y dimensions. In the bilinear interpolation method, the pixel value of the interpolated image is described by the following formula:
Kαβ[x][y]=(1−α)(1−β)I[x][y]+α(1−β)I[x+1][y]+β(1−α)I[x][y+1]+αβI[x+1][y+1]
Those skilled of art should recognize that any linear interpolation method such as weighted linear interpolation could be used in the invention for high precision matching. Furthermore, the interpolation could include more than 4 pixels.
The covariance of the Kαβ and J can be written as
The variance of the Kαβ and J can be written as
From the above formula, the matching function Mat(I,J), can be described as a function of the subpixel values α and β.
The high precision match result around a pixel position (x,y) is the subpixel values a and β correspond to the maximum value of the above matching function. When the initial search accuracy is within one pixel precision, the high precision match can be performed for the optimal subpixel values within each of the initial search result position (x,y). The processing flow of the high precision match within one pixel range is shown in
Those skilled in the art should recognize that multiple within one pixel range high precision matches can be used if the initial search result includes multiple candidate positions.
When the initial search result is not within one pixel precision, the high precision match can be performed for the optimal subpixel values within the pixel or the neighboring pixel of each of the initial search result position (x,y). The subpixel position whose maximum matching function is the highest among those of the pixel or the neighboring pixel is the optimal subpixel position of the high precision matching. The processing flow of the high precision match beyond one pixel range is shown in
As shown in
The initial search result position (x,y) 200 and its neighboring positions, 302, . . . , 304, are used to perform matching function maximization 202 for their respective within one pixel position. The maximum values for each position 306, 308, . . . , 310, are compared and the global maximum is selected by the maximum and position determination module 312. The optimal subpixel values 204 are the values correspond to the position having the highest matching function value among the initial search result position (x,y) 200 and its neighboring positions, 302, . . . , 304.
In another embodiment of the invention, the beyond one pixel range high precision matches is performed by using more than four pixels for bi-linear interpolation. For example 16 pixels could be used for interpolation.
Those skilled in the art should recognize that multiple beyond one pixel range high precision matches can be applied if the initial search result includes multiple candidate positions.
II.3. Matching Function Maximization
The matching function maximization method finds the maximum parameters that yield the maximum matching function. The matching function maximization can be performed using optimization methods such as the random optimization method, first order, second order, or quadratic fitting, etc.
To determine Mat(I,J) as a function of α and β, Mat(α,β), we rewrite COV(Kαβ,J) and VAR(Kαβ) as:
COV(Kαβ,J)=A1αβ+A2α+A3β+A4
Where
The necessary condition for maximizing the matching function is
Equivalently,
Where M(α,β)=[MAT(α,β)]2. This results in
From the above formula, for a given β (0≦β<1), the best α can be determined by the following formula:
Where
Since α is between 0 and 1. So we set α=0 if the above ax calculation results in α<0. Similarly, we set α=1 if the above a calculation results in α>1. The formula for determining the best β value when an a is given, can be calculated using a similar method.
In one embodiment of the invention, the matching function maximization method that finds the α and β is performed by an iterative procedure as shown in
As shown in
Those skilled in the art should recognize that other methods of optimization could be applied to determine the optimal subpixel values.
II.4. Fast High Precision Match
The matching function, Mat(I,J), described in section II.1 matches two images I and J. If we assume that I is the input image and J is the template, then we need to calculate the variance parameters B1, B2, B3, B4, B5, B6, B7, B8, and B9 for each candidate regions of the input image since the interpolation is performed on the input image. This could be time consuming if there are many candidate regions for matching. A fast high precision matching can be achieved by interpolating on the template. In this case, the matching function can be described as:
Wherein the variance parameters B1, B2, B3, B4, B5, B6, B7, B8, and B9 of the variance VAR[Itmp(α,β)] can be pre-calculated for the fixed template. Therefore, only the covariance parameters A1, A2, A3, and A4 of the covariance term COV[I,Itmp(α,β)] has to be calculated during the high precision matching process for each input region.
II.5. Fast High Precision Projection Match
Image projection is often performed in fast template search to reduce the search dimensions. A fast regular shaped pattern search method was disclosed (Fast Regular Shaped Pattern Searching, U.S. patent application Ser. No. 10/255,016) that performs fast pattern matching with flexible projection kernels to construct regular-shaped patterns using an accumulation method. The high precision match method of this invention could be applied to projected images.
The image projection profile P of an image I can be described as the summation over a given geometric region R.
We interpolate image pixel values by bilinear combination as follows:
Iαβ[x][y]=(1−α)(1−β)I[x][y]+α(1−β)I[x+1][y]+β(1−α)I[x][y+1]+αβI[x+1][y+1]
Then the projection profile values of the interpolate image pixel values are the bilinear combination of the non-interpolated projection values. That is, image interpolation first then projection is equal to image projection first and then interpolate on the projection profiles.
Based on this property, the above disclosed matching function optimization method could be similarly applied to achieve fast high precision match on projected image. The processing flow of the fast high precision projection match is shown in
As shown in
II.6. Robust Matching
In many practical applications the input image could be degraded due to noise, artifact, distortion, missing features, etc. To achieve high precision matching results, robust matching scheme may be required. Two high precision robust matching methods are provided in this invention: limiting pixel contribution and pixel weighting. The speed advantage is applicable to the high precision robust matching methods of this invention.
In one embodiment of the invention, the limiting pixel contribution method limits the contribution of each pixel to the covariance value calculation by the following rule:
Where Cmax is the maximum allowable cross product value for a pixel.
Based on the new covariance calculation formula, the matching function, Mat(I,J), is updated and the same procedure for high precision parameter estimation applies. Therefore, the speed advantage is preserved.
In another embodiment of the invention, the robust matching is accomplished by weighing pixels with their significance/reliability. Pixels with noise, distortion, etc. are given lower weights for matching.
In this case, the variance and covariance can be calculated by the following rule:
Where the total weight
Based on the new variance and covariance calculation formula, the matching function, Mat(I,J), is updated and the same procedure for high precision parameter estimation applies. Therefore, the speed advantage is maintained.
In yet another embodiment of the invention, the limiting pixel contribution and the pixel weighting methods can be combined. The combined covariance calculation formula is as follows:
The combined covariance can be used for fast high precision match.
III. Invariant High Precision Match
The invariant high precision match method handles scale and rotation invariant matching and produces sub-pixel position and high precision rotation angle and scale values as matching results. In one embodiment of the invention, the basic formula for the high precision scale and rotation invariant match is described in the following section.
III.1. Matching Function with Scale and Rotation Invariance
In addition to the sub-pixel matching, the scale and rotation invariant matching requires sub-sampling on scale and rotation adjustment. The scale and rotation sampling is nonlinear in regular pixel coordinate. The prior art approach performs nonlinear re-sampling to achieve scale and rotation invariance, which is time consuming and error prone.
Therefore, we perform radial-angular coordinate transformation first. The rotation angle is linear in the radial-angular coordinate. However, the scale factor is still nonlinear in the radial-angular coordinate. This invention performs log-converted radial-angular transformation that is linear in both scale and rotation sampling.
III.2. Log-Converted Radial-Angular Transformation
The log-converted radial-angular coordinate transformation takes advantage of the relationship log(θr)=log θ+log r to the radial-angular coordinate transformed domain. Therefore, the effect of the scale factor is an offset in the log-converted radial-angular coordinate system.
Considering the radial-angular (r, θ) coordinate system, where r denotes radial distance from the center (xc, yc) and θ denotes angle. Any (x,y) point can be represented in radial-angular coordinates (r, θ):
Let ρ=log r, the coordinate transformation between the Cartesian coordinate system and the log-converted radial-angular coordinate system is described by the following formula:
x=exp(ρ)cos θ
y=exp(ρ)sin θ
The area element is
dxdy=exp(2ρ)dρdθ=r2dσdθ.
Let the image Ψ be the weighted transform image of the log-converted radial-angular coordinate as follows:
Ψ[θ][ρ]=exp(ρ)I[θ][ρ].
In the transformed domain, the matching function for images Ψ, Φ can be defined as
Where
This matching function bears the same form as the shift invariant matching function. Therefore, the bilinear interpolation or other linear interpolation methods can be used for invariant high precision match.
III.3. Sub-Pixel and Sub-Sampling Shift, Rotation and Scale Invariant Matching
In this invention, sub-pixel and sub-sampling image interpolation are used for high precision shift, rotation and scale invariant matching. In the following we describe the method in two dimensional case. Those skilled in the art should recognize that this method is also applicable to higher dimensional case by adding more interpolation parameters for optimization.
In the two dimensional case, the shift, rotation and scale invariant matching is accomplished by interpolation using four parameters. Two of the parameters, α and β, are interpolation parameters for position shift (translation). The other two parameters, γ and δ, are interpolation parameters for fine rotation and scale values. The quad-linear interpolated images in log-converted radial-angular coordinate system is represented as
Where Ψ00[θ][ρ] is the weighted log-converted radial-angular coordinate transformed image of (x0, y0). Ψ10[θ][ρ] is the weighted log-converted radial-angular coordinate transformed image of (x0+1, y0). Ψ01[θ][ρ] is the weighted log-converted radial-angular coordinate transformed image of (x0, y0+1), and Ψ11[θ][ρ] is the weighted log-converted radial-angular coordinate transformed image of (x0+1, y0+1). Rewriting the above equation as
Where
The covariance of Ψ, Φ is therefore
and the variance of Ψ is
The matching score between Ψ, Φ as a function of the high precision interpolation parameters is
The best subpixel and subsampling matching can be determined by finding parameters α, β, γ, δ and a that correspond to the maximum value of the MatΨ(Φ;α,β,γ,δ). The parameters are the invariant high precision match result. This is an optimization problem similar to the above non-invariant high precision match. Many optimization methods can be used for determining the four parameters. Typical methods include random optimization (RO), bi-directional RO (BRO), improved BRO (IBRO), gradient method, alternative gradient method, and golden section method, etc.
In one embodiment of the invention, the method to find α, β, γ, and δ is described as follows.
Rewriting the COV(Ψ,Φ) and VAR(Ψ) as
COV(Ψ,Φ)={right arrow over (u)}T{right arrow over (f)}
and
VAR(Ψ)=
where {right arrow over (f)}=[f1, f2, f16]T, {right arrow over (u)}=[COV(Λ1,Φ), COV(Λ2,Φ), . . . , COV(Λ16,Φ)]T, and
Given β, γ, and δ, the value a for the optimum matching function is
Similarly, for given α, γ and δ, the value β for the optimum matching function is
For given α, β, and γ, the value δ for the optimum matching function is
For given α, β, and γ, the value δ for the optimum matching function is
In one embodiment of the invention, the matching function maximization method that finds α, β, γ, and δ is performed by an iterative procedure as shown in
As shown in
Those skilled in the art should recognize that other methods of optimization could be applied to determine the optimal subpixel and subsampling values.
When Ψ is the template image and the Φ is the input image, the terms in VAR(Ψ) can be pre-calculated from the template. Only the terms of COV(Ψ,Φ) have to be calculated for each input image regions of interest. This will speed up the invariant high precision match process.
III.3. Robust Matching
The robust matching method described in section II.6 for non-invariant high precision match can be similarly applied for invariant high precision match. The robust matching methods include limiting pixel contribution and pixel weighting.
The invention has been described herein in considerable detail in order to comply with the Patent Statutes and to provide those skilled in the art with the information needed to apply the novel principles and to construct and use such specialized components as are required. However, it is to be understood that the inventions can be carried out by specifically different equipment and devices, and that various modifications, both as to the equipment details and operating procedures, can be accomplished without departing from the scope of the invention itself.
Number | Name | Date | Kind |
---|---|---|---|
4567610 | McConnell | Jan 1986 | A |
4972499 | Kurosawa | Nov 1990 | A |
5982912 | Fukui et al. | Nov 1999 | A |
6088483 | Nakano et al. | Jul 2000 | A |
6272247 | Manickam et al. | Aug 2001 | B1 |
6603882 | Oh et al. | Aug 2003 | B2 |
6640008 | Lee et al. | Oct 2003 | B1 |
6789925 | DeGregorio | Sep 2004 | B1 |
6798925 | Wagman | Sep 2004 | B1 |
6859550 | Oh et al. | Feb 2005 | B2 |
6944331 | Schmidt et al. | Sep 2005 | B2 |
7039229 | Lin et al. | May 2006 | B2 |
7054492 | Lee et al. | May 2006 | B2 |
7110603 | Lee et al. | Sep 2006 | B2 |
7139764 | Lee | Nov 2006 | B2 |
7142718 | Lee et al. | Nov 2006 | B2 |
7164796 | Silver et al. | Jan 2007 | B1 |
20030086616 | Oh et al. | May 2003 | A1 |
20060147105 | Lee et al. | Jul 2006 | A1 |
Number | Date | Country | |
---|---|---|---|
20050114332 A1 | May 2005 | US |