Next Article in Journal
Visible Particle Series Search Algorithm and Its Application in Structural Damage Identification
Previous Article in Journal
Capacitive Sensor and Alternating Drive Mixing for Microfluidic Applications Using Micro Diaphragm Pumps
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

On Quadratic Interpolation of Image Cross-Correlation for Subpixel Motion Extraction †

1
COSYS-SII, Université Gustave Eiffel, IFSTTAR, 44344 Bouguenais, France
2
Inria, 35042 Rennes, France
*
Author to whom correspondence should be addressed.
This paper is an extended version of the 28th European Signal Processing conference paper: Analysis of Quadratic Surface Fitting for Subpixel Motion Extraction from Video Images.
Sensors 2022, 22(3), 1274; https://doi.org/10.3390/s22031274
Submission received: 20 December 2021 / Revised: 24 January 2022 / Accepted: 30 January 2022 / Published: 8 February 2022
(This article belongs to the Section Sensing and Imaging)

Abstract

:
Digital image correlation techniques are well known for motion extraction from video images. Following a two-stage approach, the pixel-level displacement is first estimated by maximizing the cross-correlation between two images, then the estimation is refined in the vicinity of the cross-correlation peak. Among existing subpixel refinement methods, quadratic surface fitting (QSF) provides good performances in terms of accuracy and computational burden. It estimates subpixel displacement by interpolating cross-correlation values with a quadratic surface. The purpose of this paper is to analytically investigate the QSF method. By means of counterexamples, it is first shown in this paper that, contrary to a widespread intuition, the quadratic surface fitted to the pixel-level cross-correlation values in the neighborhood of the cross-correlation peak does not always have a maximum. The main contribution of this paper then consists in establishing the mathematical conditions ensuring the existence of a maximum of this fitted quadratic surface, based on a rigorous analysis. Algorithm modifications for handling the failure cases of the QSF method are also proposed in this paper, in order to consolidate it for subpixel motion extraction. Experimental results based on two typical types of images are also reported.

1. Introduction

Computer vision techniques for motion extraction are widely developed in a huge variety of applications, including motion tracking, motion compensation, image registration [1], remote sensing [2], biomedicine [3], satellite imagery [4] and vibration analysis [5]. Within this scope, techniques of digital image correlation (DIC) are known to provide accurate results with a high computational efficiency, along with good robustness against noises. Various variants of DIC exist in the literature, for example, phase-only correlation (POC) [2], upsampling cross-correlation (UCC) [6], Fourier-based correlation [1] and virtual image correlation [7].
In this paper, a well-known image correlation technique for subpixel motion extraction is analytically investigated. Subpixel accuracy is particularly important for video-based structural health monitoring (SHM) [5,8] and for aerial or satellite imagery [4]. In such applications, the region of interest may be represented by a small number of pixels in the captured images. It is then important to extract both multipixel and subpixel motions information from video images.
A large variety of correlation-based techniques for motion extraction with subpixel accuracy have been compared in [1,2]. The most widespread techniques are performed in a two-step process. At the pixel level, displacement is estimated by maximizing the cross-correlation between two images. To achieve subpixel accuracy, displacement estimation is then refined in the vicinity of the cross-correlation peak. Among such refinement methods, quadratic surface fitting (QSF) provides a good trade-off between accuracy and computational burden, particularly suitable for video-based SHM, as reported in [9]. This method and its variant forms have also been investigated in [1,2,10,11,12,13,14]. Its good performance has been confirmed by our own experiments.
The purpose of this paper is to mathematically analyze the QSF method. By means of counterexamples, it will be shown that, contrary to a widespread intuition, the quadratic surface fitted to the cross-correlation values in the 3 × 3 pixels neighborhood of the correlation peak does not always have a maximum, despite the fact that the maximum pixel-level cross-correlation value is located at the center of this 3 × 3 pixels neighborhood. This absence of maximum leads to a failure of the QSF method, which should determine the subpixel displacement by maximizing the fitted quadratic surface interpolating the cross-correlation values in the vicinity of the cross-correlation peak. However, experiences reported by different authors and conducted by ourselves show that usually the QSF method produces satisfactory results. Then it is important to understand the conditions under which this method works correctly. In this paper, the conditions ensuring the existence of a maximum of the fitted quadratic surface will be formally analyzed. Then these conditions will be completed to make sure that the maximum is within the one-pixel vicinity of the pixel-level cross-correlation peak. Solutions will also be proposed to handle the failures cases of the QSF method by constrained optimization ensuring that the estimated subpixel displacement is within one pixel. These modifications apply only when a failure occurs, hence the extra numerical computation cost is insignificant.
This paper is an extended version of the conference paper [15]. It is organized as follows. The considered problem is formulated in Section 2. The QSF method is recalled in Section 3. Examples showing failures of the QSF method are presented in Section 4. The QSF method is then analyzed in Section 5. Handling of the failure cases is proposed in Section 6. Experimental results based on two typical types of images are reported in Section 7. Finally, conclusions are drawn in Section 8.

2. Problem Statement

A locally rigid moving object is observed with a camera. It is assumed that the displacement of the observed object is small between successive images, with negligible rotation and negligible motion along the optical axis direction. Correlation processing will focus on a rectangular template, also known as region of interest (ROI), which includes either the whole moving object or some part of the object. The intensity of each pixel at instant t is denoted by I ( n , m , t ) where the integer pair ( n , m ) indicates the position of the pixel in an image.
Instead of the usual row and column indexes, in this paper the pair ( n , m ) denotes pixel integer coordinates in a Cartesian system, as illustrated in Figure 1. It will serve both to describe pixel positions in an image and to fit quadratic surfaces in the QSF method. In the second usage, the origin ( x , y ) = ( 0 , 0 ) corresponds to zero subpixel displacement. This notation choice is more suitable for the surface fitting problem formulated in the Cartesian coordinate system, in agreement with usual mathematical notations.
Motion extraction will be carried out by determining the horizontal and vertical shifts of the selected template between two images captured at instants t and t + Δ t . The horizontal image shift (in number of pixels) is decomposed into an integer part n ˜ and a fractional (subpixel) part x with | x | < 1 , and similarly the vertical image shift is decomposed into an integer part m ˜ and a fractional part y with | y | < 1 , so that:
Total horizontal shift = n ˜ + x
Total vertical shift = m ˜ + y .
Given two images (frames) captured at time instants t and t + Δ t , as illustrated in Figure 2, template shifts are usually estimated through a two-step process [9]. The pixel level (integer) shifts ( n ˜ , m ˜ ) are first estimated by maximizing the cross-correlation between the two image templates. At the second step, the cross-correlation is somehow interpolated in the vicinity of the cross-correlation peak to estimate the subpixel shifts ( x , y ) .
At the pixel level, let the cross-correlation be denoted by
r ( n ˜ , m ˜ ) ( n , m ) T I ( n , m , t ) I ( n n ˜ , m m ˜ , t + Δ t ) ,
where T denotes the set of integer pairs ( n , m ) corresponding to the pixels belonging to the considered template. The dependences on I ( n , m , t ) and on I ( n , m , t + Δ t ) are omitted in the notation r ( n ˜ , m ˜ ) for a lighter presentation. The search for the cross-correlation peak is formulated as:
( n ˜ * , m ˜ * ) = arg max N ˜ n ˜ N ˜ M ˜ m ˜ M ˜ r ( n ˜ , m ˜ ) ,
where N ˜ and M ˜ are two positive integers specifying the search ranges respectively for horizontal and vertical shifts.
In order to gain subpixel accuracy, at the second step, the cross-correlation r ( n ˜ , m ˜ ) is somehow interpolated for non integer shifts so that the correlation maximization (3) can be generalized to subpixel shifts.
In the QSF method, this interpolation is made by fitting, in the least squares sense, a second degree polynomial (or, geometrically, a quadratic surface) to the value of r ( n ˜ * , m ˜ * ) and to the 8 neighboring cross-correlation values r ( n ˜ , m ˜ ) , namely r ( n ˜ * + n , m ˜ * + m ) with n , m { 1 , 0 , + 1 } . Then the maximum of the fitted polynomial yields the estimated subpixel shifts between the two templates [9].
More formally, the integer shifts ( n ˜ * , m ˜ * ) being already estimated, let p ( x , y ) denote the second degree polynomial fitted, in the least squares sense, to r ( n ˜ * + x , m ˜ * + y ) for x , y { 1 , 0 , + 1 } . Then, the subpixel shifts are estimated as
( x * , y * ) = arg max ( x , y ) R 2 p ( x , y ) ,
and the estimated total shifts amount to:
( n ˜ * + x * , m ˜ * + y * ) .
Satisfactory experimental results of this method have been reported by different authors, for example, [1,2,9]. Our own experiments also confirm its good performance compared to other existing methods for subpixel shift estimation. The main purpose of this paper is to consolidate the theoretical basis of this method.
More specifically, the QSF method, as recalled above, assumes implicitly that the second degree polynomial p ( x , y ) fitted to the nine correlation values r ( n ˜ * + n , m ˜ * + m ) , with n , m { 1 , 0 , + 1 } , always has a unique global maximum, corresponding to ( x * , y * ) located in the one-pixel vicinity of ( x , y ) = ( 0 , 0 ) , so that the total shifts as expressed in (5) do not fall too far from the pixel level optimal shifts ( n ˜ * , m ˜ * ) . This paper will investigate the following issues.
1.
Does the quadratic surface fitted in the QSF method always have a maximum in the one-pixel vicinity of the pixel-level cross-correlation peak?
2.
If the answer to the first question is no, what are the conditions ensuring that the fitted quadratic surface has a maximum, and moreover, the maximum is located in the one-pixel vicinity of the pixel-level cross-correlation peak?
3.
What should the algorithm do if the fitted quadratic surface ever has no maximum, or if its maximum is outside the one-pixel vicinity of the pixel-level cross-correlation peak?

3. Quadratic Surface Fitting for Subpixel Refinement

The QSF method is recalled in this section before its analysis in the next sections.
Let ( n ˜ * , m ˜ * ) be resulting from the pixel level maximization (3).
The nine integer pairs ( n , m ) , with n , m { 1 , 0 , + 1 } , form a 3 × 3 grid (The grid G is formed by nine integer pairs organized in three rows and three columns. It is also seen as a set with the integer pairs as elements, so that notations like ( 1 , 1 ) G can be used.):
G = ( 1 , 1 ) ( 0 , 1 ) ( 1 , 1 ) ( 1 , 0 ) ( 0 , 0 ) ( 1 , 0 ) ( 1 , 1 ) ( 0 , 1 ) ( 1 , 1 ) .
Accordingly, the nine cross-correlation values r ( n ˜ * + n , m ˜ * + m ) normalized by the maximum cross-correlation value r ( n ˜ * , m ˜ * ) and denoted by:
γ ( n , m ) r ( n ˜ * + n , m ˜ * + m ) r ( n ˜ * , m ˜ * )
form a matrix
Γ γ ( 1 , 1 ) γ ( 0 , 1 ) γ ( 1 , 1 ) γ ( 1 , 0 ) γ ( 0 , 0 ) γ ( 1 , 0 ) γ ( 1 , 1 ) γ ( 0 , 1 ) γ ( 1 , 1 ) .
The central entry of Γ
γ ( 0 , 0 ) = r ( n ˜ * + 0 , m ˜ * + 0 ) r ( n ˜ * , m ˜ * ) = 1
is the maximum cross-correlation value r ( n ˜ * , m ˜ * ) normalized by itself, hence this central entry γ ( 0 , 0 ) = 1 is the maximum value among all the nine entries of Γ .
The second degree polynomial:
p θ ( x , y ) = θ 1 + [ θ 2 θ 3 ] x y + x y θ 4 θ 5 / 2 θ 5 / 2 θ 6 x y ,
with the vector θ R 6 collecting the scalar coefficients θ 1 , , θ 6 , is then fitted to the entry values of Γ for ( x , y ) G , by solving the least squares problem:
min θ R 6 ( n , m ) G [ p θ ( n , m ) γ ( n , m ) ] 2 ,
where G is the grid defined in (6).
Does this fitted second degree polynomial p θ ( x , y ) always have a unique global maximum?
As explained above, the central entry of the matrix Γ , namely γ ( 0 , 0 ) = 1 , is the maximum value among all the nine entries of Γ . It then seems reasonable to expect that the second degree polynomial (or quadratic surface) p θ ( x , y ) fitted to the nine entries of Γ has a maximum somehow close to the (maximum) central entry of the matrix Γ , which corresponds to the origin ( x , y ) = ( 0 , 0 ) of the coordinate system characterizing the fitted quadratic surface.
Unfortunately, the fact that the central entry γ ( 0 , 0 ) is the maximum value among the nine entries of Γ does not really ensure that the fitted second degree polynomial p θ ( x , y ) always has a global maximum, as demonstrated by the following counterexamples.

4. Counterexamples

Three examples with either synthetic or real-world images are presented below to show that the quadratic surface fitted in the QSF method does not always have a maximum in the close vicinity of the pixel-level cross-correlation peak.

4.1. Example 1

The first counterexample with synthetic images was chosen for its simplicity so that it can be easily reproduced. The Matlab code for generating the presented result is available for download [16]. To show the robustness of this counterexample, the Matlab code can be optionally run with some random noises added to the generated synthetic images, though the result presented below is noise-free. Counterexamples based on true images (as presented in Examples 2 and 3) are also included in [16].
Consider two binary images of 18 × 18 pixels as shown in Figure 3, with the template (ROI) chosen as the red square window of 8 × 8 pixels in each image. The template in the first image contains a diagonal pattern. In the second image, this diagonal pattern is shifted by one pixel toward the right and also by one pixel toward the bottom. In these binary images, the intensity is 1 at the darker pixels and 10 at the brighter pixels.
The normalized 3 × 3 cross-correlation matrix around the peak as defined in (8) is:
Γ = 0.2236 0.2236 0.8059 0.2236 1 0.2236 0.8059 0.2236 0.2236 .
Fitting the second degree polynomial p θ ( x , y ) to Γ for ( x , y ) G by solving the least squares problem (11) yields the solution:
θ * = 0.5256 0.0000 0.0000 0.0647 0.2911 0.0647 .
The corresponding quadratic surface p θ * ( x , y ) exhibits a saddle point, as illustrated in Figure 4. It has no global maximum, despite the fact that the central entry of the matrix Γ is its largest entry.
This counterexample clearly invalidates the widespread intuition that the fitted polynomial p θ ( x , y ) in the QSF method always has a global maximum.

4.2. Example 2

This example is based on true images of the moon, included in Matlab as a part of its image examples. The Matlab code generating the presented results are available for download [16]. Two images of the moon with 537 × 358 pixels are shown in Figure 5. As in Example 1, with some chosen template (ROI), cross-correlations between the two images are computed, and a quadratic surface is fitted to the normalized 3 × 3 cross-correlation matrix around the peak. In most situations, the fitted surface has a maximum close to the pixel-level cross-correlation peak, but unexpected cases do happen with some particular template choices.
For the chosen template illustrated by the red windows in Figure 5, the fitted quadratic surface is shown in Figure 6. The surface exhibiting a saddle point has no maximum. This result can be reproduced with the Matlab code downloadable from [16].

4.3. Example 3

This example is based the same images of the moon as in Example 2, but with another choice of the template for cross-correlation computation, as illustrated by the red windows in Figure 7. The fitted quadratic surface shown in Figure 8 has a maximum located at
( x * , y * ) = ( 13.76 , 4.28 ) ,
as indicated by the cyan dot on the surface. This maximum is far outside the square area of the one-pixel vicinity of the pixel-level cross-correlation peak delimited by the red dotted lines on the bottom plane in Figure 8. As a subpixel refinement, the maximum of the fitted surface should satisfy | x * | < 1 and | y * | < 1 , which is not the case in this example. The details of this result are available from [16].
The examples presented in this section confirm that, in some rare situations, the quadratic surface fitted in the QSF method does not have a maximum, or has a maximum far away from the square area of the one-pixel vicinity of the pixel-level cross-correlation peak.
After the answer to the first question raised at the end of Section 2, the following sections will then answer the other two remaining questions.

5. Conditions for the Existence of a Maximum

In elementary algebra, it is well known that the second degree polynomial p θ ( x , y ) as expressed in (10) has a unique global maximum if its Hessian matrix,
H θ 4 θ 5 / 2 θ 5 / 2 θ 6 ,
is negative definite [17]. However, this simply stated fact does not directly help us to understand how the normalized cross-correlation values γ ( n , m ) (those filling up the Γ matrix in (8)) should be, so that the fitted p θ ( x , y ) has a global maximum. Because the polynomial coefficients θ 1 , , θ 6 are determined from the values of γ ( n , m ) by solving the least squares problem (11), it is straightforward to express the negative definiteness condition of H in terms of γ ( n , m ) . Then, in principle, the condition for the existence of a global maximum of p θ ( x , y ) will be formulated in terms of the normalized cross-correlation values γ ( n , m ) . Nevertheless, this approach results in sophisticated conditions, notably an inequality involving the determinant of H expressed in terms of γ ( n , m ) . For a better understanding, the result presented below will be formulated with simple and easily interpretable inequalities about the values γ ( n , m ) filling up Γ . For instance, one of these simple inequalities states that the central entry γ ( 0 , 0 ) of Γ is its largest entry. As shown by the previously presented counterexamples, this condition alone is not sufficient. It is then completed by similar simple inequalities.
Theorem 1.
If the normalized cross-correlation values γ ( n , m ) filling up the matrix Γ satisfy:
γ ( 0 , 0 ) γ ( n , m ) f o r a l l n , m { 1 , 0 , + 1 }
γ ( 0 , m ) > γ ( n , m ) f o r a l l n , m { 1 , + 1 }
γ ( n , 0 ) > γ ( n , m ) f o r a l l n , m { 1 , + 1 } ,
then the second degree polynomial p θ ( x , y ) fitted to the entries of Γ by solving the least squares problem (11) has a unique global maximum.
Interpretation of the conditions of Theorem 1.
  • Inequalities (15): the central entry γ ( 0 , 0 ) has the largest value among all the 9 entries of Γ .
  • Inequalities (16): the middle entry γ ( 0 , ± 1 ) is the largest entry of the top or the bottom row of Γ .
  • Inequalities (17): the middle entry γ ( ± 1 , 0 ) is the largest entry of the right or the left column of Γ .
Proof of Theorem 1.
In order to shorten lengthy equations and inequalities, let us introduce more compact notations for the normalized cross-correlation values γ ( m , m ) filling up the matrix Γ defined in (8), so that Γ is rewritten as:
Γ = a e b f i g c h d .
Remark that the letters a , b , d , , i fill Γ first at the four corners, then the middles of side rows and columns, before finishing at the central entry.
With these compact notations, the least squares solution (11) leads to
9 θ 1 = 2 ( e + f + g + h ) + 5 i ( a + b + c + d )
6 θ 2 = ( b a ) + ( g f ) + ( d c )
6 θ 3 = ( a c ) + ( e h ) + ( b d ) 6 θ 4 = ( e a ) + ( e b ) + ( h c ) + ( h d )
+ ( i f ) + ( i g )
4 θ 5 = ( b a + c d ) 6 θ 6 = ( f a ) + ( f c ) + ( g b ) + ( g d )
+ ( i e ) + ( i h ) .
As already mentioned in this paper, the negative definiteness of the Hessian matrix H defined in (14) ensures that the polynomial p θ ( x , y ) has a global maximum. Based on Sylvester’s criterion (Usually Sylvester’s criterion [18] is about the positive definiteness of a real symmetric (or complex Hermitian) matrix. It is trivial to translate this criterion to the case of negative definiteness; this negative definiteness will be checked through:
θ 4 < 0
det ( H ) > 0 .
According to the inequalities assumed in (16), e (or h, resp.) is the largest entry of the top (or bottom, resp.) row of Γ , then
e a > 0 , e b > 0
h c > 0 , h d > 0
and according to (15), i is the largest entry of Γ , then
i f 0 , i g 0 .
These inequalities together with (19d) immediately imply (20).
It is more involved to check (21). The inequalities in (22) imply:
1 + 3 4 ( e a ) > 0 > 1 + 3 4 ( e b ) ,
then
( e a ) + ( e b ) > 3 4 ( e a ) + 3 4 ( e b )
= 3 4 ( b a ) .
Repeat the reasoning from (25) to (27) while interchanging the positions of ( e a ) and ( e b ) :
1 + 3 4 ( e b ) > 0 > 1 + 3 4 ( e a ) ,
leading to
( e a ) + ( e b ) > 3 4 ( b a ) .
Combining (27) and (29) yields
( e a ) + ( e b ) > 3 4 | b a | .
This result expresses a relationship between the entries in the top row of the matrix Γ . A similar reasoning then leads to the following relationship between the entries in the bottom row of Γ :
( h c ) + ( h d ) > 3 4 | c d | .
According to the inequalities assumed in (15), i is the largest entry of Γ , then
i f 0 , i g 0 .
Take the sums of the respective sides of the four inequalities in (30)–(32), then
( e a ) + ( e b ) + ( h c ) + ( h d ) + ( i f ) + ( i g )
> 3 4 | b a | + 3 4 | c d |
3 4 | b a + c d | .
This result then implies that 6 θ 4 and 4 θ 5 , as expressed respectively in (19d) and (19e), satisfy:
6 θ 4 > 3 4 | 4 θ 5 | ,
hence
θ 4 > 1 2 | θ 5 | 0 .
Following the same approach, it is then similarly shown that
θ 6 > 1 2 | θ 5 | 0 .
This last result can also be deduced from a certain “symmetry” between the formulae expressing θ 4 and θ 6 in (19d) and (19f).
It then follows from (14), (36) and (37) that
det ( H ) = θ 4 θ 6 1 4 θ 5 2 > 0 .
Therefore, the two inequalities (20) and (21) ensuring the negative definiteness of H are successfully checked. It is then established that the second degree polynomial p θ ( x , y ) has a unique global maximum. □
When the fitted polynomial p θ ( x , y ) has a unique global maximum, it may happen that this maximum is far away from the origin ( x , y ) = ( 0 , 0 ) corresponding to the optimized integer shifts ( n ˜ * , m ˜ * ) , outside the square area of the one-pixel vicinity of the cross-correlation peak. Such situations are not desirable, since the subpixel refinement should not modify the estimated shifts by more than one pixel. The following result ensures that the maximum of p θ ( x , y ) stays inside the one-pixel vicinity, under easily interpretable conditions.
Theorem 2.
If, in addition to the conditions of Theorem 1, the normalized cross-correlation values γ ( n , m ) filling up the matrix Γ satisfy, for all n , m { 1 , + 1 } ,
γ ( 0 , m ) γ ( n , m ) > 1 5 γ ( 0 , m ) γ ( n , m )
γ ( n , 0 ) γ ( n , m ) > 1 5 γ ( n , 0 ) γ ( n , m ) ,
then the maximum of the fitted polynomial p θ ( x , y ) is located at ( x * , y * ) such that | x * | < 1 and | y * | < 1 .
Interpretation of the conditions of Theorem 2.
The conditions inherited from Theorem 1 ensure that the middle entry in each row or column of Γ is the largest entry of the row or column, without imposing any “degree of symmetry”. For example, among the top row of Γ as expressed in (8), inequalities formulated in (16) ensure that γ ( 0 , 1 ) is the largest entry, but the ratio [ γ ( 0 , 1 ) γ ( 1 , 1 ) / [ γ ( 0 , 1 ) γ ( 1 , 1 ) ] can be any positive number. Two of the inequalities in the extra condition (39) of Theorem 2 constrain this ratio between 1 / 5 and 5, thus limiting the dissymmetry between γ ( 1 , 1 ) and γ ( 1 , 1 ) .
Proof of Theorem 2.
Based on Theorem 1 (its conditions are inherited here), the fitted polynomial p θ ( x , y ) has a unique global maximum in R 2 , which is located at
x * = 2 θ 2 θ 6 θ 3 θ 5 θ 5 2 4 θ 4 θ 6
y * = 2 θ 3 θ 4 θ 2 θ 5 θ 5 2 4 θ 4 θ 6 .
In order to prove | x * | < 1 , it will be shown that the numerator of | x * | is smaller than its denominator. The proof for proving | y * | < 1 will be made similarly.
With the compact notations filling up the matrix Γ introduced in (18) for the normalized correlation values γ ( n , m ) , one of the inequalities contained in (39), namely
γ ( 0 , 1 ) γ ( 1 , 1 ) > 1 5 γ ( 0 , 1 ) γ ( 1 , 1 ) ,
is translated into
e a > 1 5 ( e b ) ,
which is rewritten as
5 2 ( e a ) > 1 2 ( e b ) ,
or in a slightly different form
1 + 3 2 ( e a ) > 1 + 3 2 ( e b ) .
Then
( e a ) + ( e b ) > 3 2 ( e b ) 3 2 ( e a )
= 3 2 ( a b ) .
A similar reasoning (by interchanging the positions of ( e a ) and ( e b ) ) leads to
( e b ) + ( e a ) > 3 2 ( e a ) 3 2 ( e b )
= 3 2 ( a b ) .
Combining (48) and (50) then amounts to
( e a ) + ( e b ) > 3 2 | b a | .
This last inequality concerns the entries in the top row of Γ as in (18). Similar reasonings about the bottom row, the left and right columns of Γ then lead to
( h c ) + ( h d ) > 3 2 | c d | .
( f a ) + ( f c ) > 3 2 | a c | .
( g b ) + ( g d ) > 3 2 | b d | . .
Because i is the largest entry of Γ (condition inherited from Theorem 1),
i f 0 , i d 0 .
Summarizing (51), (52) and (55) then implies that θ 4 as expressed in (19d) satisfies:
6 θ 4 = ( e a ) + ( e b ) + ( h c ) + ( h d )
+ ( i f ) + ( i g )
> 3 2 | b a | + 3 2 | c d |
3 2 | b a + c d | .
This result, together with (19e), then yields to:
θ 4 > | θ 5 | 0 .
Some similar reasonings (due to a certain “symmetry” between θ 4 and θ 6 in (19) then lead to
θ 6 > | θ 5 | 0 .
Add together the respective sides of (19b) and (19d), then,
6 ( θ 2 θ 4 ) = 2 ( e a ) + ( h c ) + ( i f ) .
Every parenthesis at the right hand side of (61) is positive, due to conditions inherited from Theorem 1. Then,
θ 2 θ 4 > 0 .
Similarly,
6 ( θ 2 + θ 4 ) = 2 ( e b ) + ( h d ) + ( i g ) < 0 .
Based on the last 2 inequalities, θ 4 satisfies:
θ 4 > ± θ 2 ,
hence
θ 4 > | θ 2 | 0 .
In the same manner, combining (19c) and (19f) yields:
6 ( θ 3 θ 6 ) = 2 ( f c ) + ( g d ) + ( i h ) > 0
6 ( θ 3 + θ 6 ) = 2 ( f a ) + ( g b ) + ( i e ) < 0 ,
then
θ 6 > | θ 3 | 0 .
The following steps of the proof will be essentially based on:
| θ 4 | > | θ 5 |
| θ 6 | > | θ 5 |
| θ 4 | > | θ 2 |
| θ 6 | > | θ 3 | ,
respectively, due to (59), (60), (65) and (68).
On the one hand, (71), (72) and (69) imply (the step leading to (74) below)
| 2 θ 2 θ 6 θ 3 θ 5 | 2 | θ 2 | | θ 6 | + | θ 3 | | θ 5 |
< 2 | θ 4 | | θ 6 | + | θ 6 | | θ 4 |
= 3 | θ 4 | | θ 6 | ;
and on the other hand, (69) and (70) lead to (the step leading to (78) below)
| θ 5 2 4 θ 4 θ 6 | | 4 θ 4 θ 6 | | θ 5 2 |
= 4 | θ 4 | | θ 6 | | θ 5 | | θ 5 |
> 4 | θ 4 | | θ 6 | | θ 4 | | θ 6 |
= 3 | θ 4 | | θ 6 | .
Therefore
| 2 θ 2 θ 6 θ 3 θ 5 | < | θ 5 2 4 θ 4 θ 6 | .
It is then concluded that x * as expressed in (41) satisfies
| x * | < 1 .
In the same way, it is also proved that:
| y * | < 1 .
The proof of Theorem 2 is thus completed. □

6. Handling Failures of the QSF Method

There are two possible failure cases:
  • Case 1, the fitted polynomial p θ ( x , y ) has no global maximum;
  • Case 2, p θ ( x , y ) has a global maximum, reached at ( x * , y * ) , but | x * | 1 and/or | y * | 1 .
In the first case, the only reasonable proposition is to retain the optimized integer shifts ( n ˜ * , m ˜ * ) as the estimated total shifts.
In the second case, solutions on the boundary satisfying | x * | 1 and | y * | 1 are accepted. If | x * | > 1 and/or | y * | > 1 , then the subpixel shifts are estimated by solving the constrained optimization problem:
( x , y ) = arg max | x | 1 , | y | 1 p θ ( x , y ) ,
and the estimated total shifts amount to:
( n ˜ * + x , m ˜ * + y ) .
As p θ ( x , y ) is a second degree polynomial, the constrained optimization problem (83) can be solved by quadratic programming algorithms. In this considered Case 2, the unique unconstrained maximum of p θ ( x , y ) is outside the square area constrained by | x | 1 and | y | 1 , hence the constrained solution is certainly on the boundary of the constrained square area, on one of its sides or on one of its corners. Given the simplicity of this quadratic problem, instead of applying a general quadratic programming tool, the constrained optimization problem (83) can be solved as follows:
  • Compute the values of p θ ( x , y ) at the four corners of the square, namely p θ ( ± 1 , ± 1 ) ;
  • Find the maximums of p θ ( x , ± 1 ) in x and p θ ( ± 1 , y ) in y:
    x ± = arg max x R p θ ( x , ± 1 ) = θ 2 ± θ 5 2 θ 4 ;
    y ± = arg max y R p θ ( ± 1 , y ) = θ 3 ± θ 5 2 θ 6 .
    Eliminate any result(s) not satisfying | x ± | 1 or | y ± | 1 .
  • Find the maximum value among the four corner values p θ ( ± 1 , ± 1 ) and the non-eliminated values p θ ( x ± , ± 1 ) and/or p θ ( ± 1 , y ± ) , if any. The solution of the constrained optimization problem (83) is then given by the location of this maximum.

7. Assessment Based on Two Typical Types of Images

The original QSF method and the modified method are tested with two typical types of images for failure rate evaluation. As already stated in the introduction, the original QSF method works correctly in most situations. The occurrence frequency of its failures depends on the type of processed images. Two typical examples are presented below in this section.
For the moon example already considered in Section 4, when the template window is close to a corner of the left side of the images, as shown in Figure 5, the selected region of interest has a diagonally dominant pattern, sharing a common characteristic with the synthetic example shown in Figure 3. For this reason, the QSF method is more likely to encounter difficulties with these images.
A second example comes from the publicly available DIC Challenge database [19,20] provided by the Society for Experimental Mechanics. The tested images contain uniform patterns, as shown in Figure 9.
For each trial with the original QSF method, the template window is placed at a different position in the processed images, as illustrated in Figure 5 and Figure 9. Among all the trials, the number of cases where the fitted quadratic surface exhibits a saddle point (absence of maximum) is counted. The second type of failures, with maximum outside the one-pixel vicinity, is also counted. The results are summarized in Table 1.
As expected, the moon example leads to more failures (0.21% and 4.79% of the two types of failures over the total number of trials) due to the existence of diagonally dominant patterns. For the second type of failures, the maximum of the fitted surface can be far away from the the one-pixel vicinity, up to 52 pixels. On the other hand, the DIC Challenge example with uniform patterns has very few failures (8.74 ppm and 52.4 ppm).
Though failures of the original QSF method rarely happen, it is important to prevent them for reliable applications.
After modifications of the QSF method as proposed in Section 6, for each the trials with the above two examples, the modified method successfully finds a subpixel displacement ( x * , y * ) such that | x * | < 1 and | y * | < 1 .

8. Conclusions

In this paper, within the scope of digital image correlation techniques, some theoretical aspects of the QSF method have been investigated. It has been shown that, contrary to a widespread intuition, the quadratic surface fitted in the QSF method does not always have a maximum. Then, for a better understanding of this method, it is analyzed by providing mathematical conditions ensuring expected results. Algorithm modifications have also been proposed to handle unexpected cases. Finally, experimental results based on two typical types of images have been reported. These results will contribute to consolidating both the theory and the practice of the QSF method.

Author Contributions

Conceptualization, Q.Z.; Investigation, B.X. and Q.Z.; Writing—original draft, Q.Z. and B.X.; Writing—review & editing, V.B. All authors have read and agreed to the published version of the manuscript.

Funding

EU Research Fund for Coal and Steel 2017: DESDEMONA; Bretagne region: ARED UGE-Cosys department.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

This work has been supported by the Bretagne region, the UGE-Cosys department, and the DESDEMONA project of the EU Research Fund for Coal and Steel 2017 programme.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Alba, A.; Vigueras-Gomez, J.F.; Arce-Santana, E.R.; Aguilar-Ponce, R.M. Phase correlation with sub-pixel accuracy: A comparative study in 1D and 2D. Comput. Vis. Image Underst. 2015, 137, 76–87. [Google Scholar] [CrossRef]
  2. Tong, X.; Ye, Z.; Xu, Y.; Gao, S.; Xie, H.; Du, Q.; Liu, S.; Xu, X.; Liu, S.; Luan, K.; et al. Image Registration With Fourier-Based Image Correlation: A Comprehensive Review of Developments and Applications. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2019, 12, 4062–4081. [Google Scholar] [CrossRef]
  3. Yoshikawa, H.; Yamamoto, T.; Tanaka, T.; Kawabata, K.I.; Yoshizawa, S.; Umemura, S.I. Ultrasound Sub-pixel Motion-tracking Method with Out-of-plane Motion Detection for Precise Vascular Imaging. Ultrasound Med. Biol. 2020, 46, 782–795. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  4. Mohamed, S.A.; Helmi, A.; Fkirin, M.A.; Badwai, S. Subpixel Accuracy Analysis of Phase Correlation Shift Measurement Methods Applied to Satellite Imagery. Int. J. Adv. Comput. Sci. Appl. 2012, 3, 202–206. [Google Scholar] [CrossRef] [Green Version]
  5. Feng, D.; Feng, M.Q. Computer vision for SHM of civil infrastructure: From dynamic response measurement to damage detection—A review. Eng. Struct. 2018, 156, 105–117. [Google Scholar] [CrossRef]
  6. Guizar-Sicairos, M.; Thurman, S.T.; Fienup, J.R. Efficient subpixel image registration algorithms. Opt. Lett. 2008, 33, 156–158. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Semin, B.; Auradou, H.; François, M. Accurate measurement of curvilinear shapes by Virtual Image Correlation. Eur. Phys. J. Appl. Phys. 2011, 56, 10701. [Google Scholar] [CrossRef]
  8. Spencer, B.F.; Hoskere, V.; Narazaki, Y. Advances in Computer Vision-Based Civil Infrastructure Inspection and Monitoring. Engineering 2019, 5, 199–222. [Google Scholar] [CrossRef]
  9. Zhang, D.; Guo, J.; Lei, X.; Zhu, C. A High-Speed Vision-Based Sensor for Dynamic Vibration Analysis Using Fast Motion Extraction Algorithms. Sensors 2016, 16, 572. [Google Scholar] [CrossRef] [PubMed]
  10. Hung, P.C.; Voloshin, A.S. In-plane strain measurement by digital image correlation. J. Braz. Soc. Mech. Sci. Eng. 2003, 25, 215–221. [Google Scholar] [CrossRef] [Green Version]
  11. Pan, B.; Xie, H.M.; Xu, B.Q.; Dai, F.l. Performance of sub-pixel registration algorithms in digital image correlation. Meas. Sci. Technol. 2006, 17, 1615–1621. [Google Scholar] [CrossRef]
  12. Pallotta, L.; Giunta, G.; Clemente, C. Subpixel SAR Image Registration Through Parabolic Interpolation of the 2-D Cross Correlation. IEEE Trans. Geosci. Remote Sens. 2020, 58, 4132–4144. [Google Scholar] [CrossRef] [Green Version]
  13. Tomás, M.B.; Ferrer, B.; Mas, D. Influence of Neighborhood Size and Cross-Correlation Peak-Fitting Method on Location Accuracy. Sensors 2020, 20, 6596. [Google Scholar] [CrossRef] [PubMed]
  14. Lei, X.; Jin, Y.; Guo, J.; Zhu, C. Vibration extraction based on fast NCC algorithm and high-speed camera. Appl. Opt. 2015, 54, 8198–8206. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  15. Xiong, B.; Zhang, Q.; Baltazart, V. Analysis of Quadratic Surface Fitting for Subpixel Motion Extraction from Video Images. In Proceedings of the EUSIPCO 2020–28th European Signal Processing Conference, Amsterdam, The Netherlands, 18–21 January 2021; pp. 695–699. Available online: https://hal.inria.fr/hal-03129172/file/main.pdf (accessed on 24 January 2022).
  16. Xiong, B.; Zhang, Q.; Baltazart, V. Matlab Code of QSF Counterexamples. Available online: http://people.rennes.inria.fr/Qinghua.Zhang/QSFexample.zip (accessed on 24 January 2022).
  17. O’Meara, O.T. Introduction to Quadratic Forms; Springer: Berlin/Heidelberg, Germany, 1973. [Google Scholar]
  18. Meyer, C.D. Matrix Analysis and Applied Linear Algebra; SIAM: Philadelphia, PA, USA, 2010. [Google Scholar]
  19. Society for Experimental Mechanics. DIC Challenge. Previous DIC Challenge 1.0 Data, Sample3.zip. Available online: https://idics.org/challenge/ (accessed on 24 January 2022).
  20. Reu, P.; Toussaint, E.; Jones, E.; Bruck, H.; Iadicola, M.; Balcaen, R.; Turner, D.; Siebert, T.; Lava, P.; Simonsen, M. DIC Challenge: Developing Images and Guidelines for Evaluating Accuracy and Resolution of 2D Analyses. Exp. Mech. 2017, 58, 1067–1099. [Google Scholar] [CrossRef]
Figure 1. Illustration of the Cartesian coordinate system and integer coordinates ( n , m ).
Figure 1. Illustration of the Cartesian coordinate system and integer coordinates ( n , m ).
Sensors 22 01274 g001
Figure 2. Template shifts between two successive images.
Figure 2. Template shifts between two successive images.
Sensors 22 01274 g002
Figure 3. Two synthetic images of 18 × 18 pixels. The intensity is 1 at the darker pixels and 10 at the brighter pixels, The template (ROI) is selected as the red square window of 8 × 8 pixels.
Figure 3. Two synthetic images of 18 × 18 pixels. The intensity is 1 at the darker pixels and 10 at the brighter pixels, The template (ROI) is selected as the red square window of 8 × 8 pixels.
Sensors 22 01274 g003
Figure 4. For the images in Figure 3, the fitted quadratic surface exhibits a saddle point. The vertical red line segments represent the entries of the normalized cross-correlation matrix Γ .
Figure 4. For the images in Figure 3, the fitted quadratic surface exhibits a saddle point. The vertical red line segments represent the entries of the normalized cross-correlation matrix Γ .
Sensors 22 01274 g004
Figure 5. Two images of the moon of 537 × 358 pixels. The template is chosen as the red windows.
Figure 5. Two images of the moon of 537 × 358 pixels. The template is chosen as the red windows.
Sensors 22 01274 g005
Figure 6. For the images and template in Figure 5, the fitted quadratic surface exhibits a saddle point.
Figure 6. For the images and template in Figure 5, the fitted quadratic surface exhibits a saddle point.
Sensors 22 01274 g006
Figure 7. Two images of the moon, the same as in Figure 5, but with a different template choice shown by the red windows.
Figure 7. Two images of the moon, the same as in Figure 5, but with a different template choice shown by the red windows.
Sensors 22 01274 g007
Figure 8. For the images and template in Figure 7, the fitted quadratic surface has a maximum located at ( x * , y * ) = ( 13.76 , 4.28 ) , as shown by the cyan dot on the surface. The red dotted lines on the bottom plane delimit the square area of the one-pixel vicinity around the pixel-level cross-correlation peak. As a subpixel refinement, the maximum of the fitted surface should satisfy | x * | < 1 and | y * | < 1 , which is not the case in this example. See [16] for the details of this example.
Figure 8. For the images and template in Figure 7, the fitted quadratic surface has a maximum located at ( x * , y * ) = ( 13.76 , 4.28 ) , as shown by the cyan dot on the surface. The red dotted lines on the bottom plane delimit the square area of the one-pixel vicinity around the pixel-level cross-correlation peak. As a subpixel refinement, the maximum of the fitted surface should satisfy | x * | < 1 and | y * | < 1 , which is not the case in this example. See [16] for the details of this example.
Sensors 22 01274 g008
Figure 9. Two images of the DIC Challenge database [19], each with resolution 512 × 512 pixels. The the red windows correspond to an example of template for the QSF method.
Figure 9. Two images of the DIC Challenge database [19], each with resolution 512 × 512 pixels. The the red windows correspond to an example of template for the QSF method.
Sensors 22 01274 g009
Table 1. Original QSF method failure occurrences in the Moon and DIC Challenge examples. Total trials: number of total trials of the QSF method. Absence of maximum: number of trials yielding a saddle point (and in percentage of total trials). Maximum outside the one-pixel vicinity: number of trials yielding a maximum of the fitted surface located at ( x * , y * ) with | x * | > 1 or | y * | > 1 (and ppm, part per million). max | x * | : the maximum value of | x * | among all the trials. max | y * | : the maximum value of | y * | among all the trials.
Table 1. Original QSF method failure occurrences in the Moon and DIC Challenge examples. Total trials: number of total trials of the QSF method. Absence of maximum: number of trials yielding a saddle point (and in percentage of total trials). Maximum outside the one-pixel vicinity: number of trials yielding a maximum of the fitted surface located at ( x * , y * ) with | x * | > 1 or | y * | > 1 (and ppm, part per million). max | x * | : the maximum value of | x * | among all the trials. max | y * | : the maximum value of | y * | among all the trials.
Total TrialsAbsence of MaximumMaximum Outside One-Pixel Vicinity max | x * | max | y * |
Moon10,938 23 (0.21%)  524 (4.79%)35.947452.0165
DIC Challenge114,4441 (8.74 ppm)6 (52.4 ppm)4.73014.7301
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Xiong, B.; Zhang, Q.; Baltazart, V. On Quadratic Interpolation of Image Cross-Correlation for Subpixel Motion Extraction. Sensors 2022, 22, 1274. https://doi.org/10.3390/s22031274

AMA Style

Xiong B, Zhang Q, Baltazart V. On Quadratic Interpolation of Image Cross-Correlation for Subpixel Motion Extraction. Sensors. 2022; 22(3):1274. https://doi.org/10.3390/s22031274

Chicago/Turabian Style

Xiong, Bian, Qinghua Zhang, and Vincent Baltazart. 2022. "On Quadratic Interpolation of Image Cross-Correlation for Subpixel Motion Extraction" Sensors 22, no. 3: 1274. https://doi.org/10.3390/s22031274

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop