A Cost Function for the Uncertainty of Matching Point Distribution on Image Registration

Computing the homography matrix using the known matching points is a key step in computer vision for image registration. In practice, the number, accuracy, and distribution of the known matching points can affect the uncertainty of the homography matrix. This study mainly focuses on the effect of matching point distribution on image registration. First, horizontal dilution of precision (HDOP) is derived to measure the influence of the distribution of known points on fixed point position accuracy on the image. The quantization function, which is the average of the center points’ HDOP* of the overlapping region, is then constructed to measure the uncertainty of matching distribution. Finally, the experiments in the field of image registration are performed to verify the proposed function. We test the consistency of the relationship between the proposed function and the average of symmetric transfer errors. Consequently, the proposed function is appropriate for measuring the uncertainty of matching point distribution on image registration.


Introduction
Matching points are the direct data sources of the homography matrix, fundamental matrix, camera parameters, and 3D point cloud. Thus, their uncertainty has a direct influence on the quality of image registration, image mosaics, image fusion, and image-based reconstruction. It is an essential research topic in geographic information systems to ensure the uncertainty of matching points.
In early literature, Brand [1] and Sankowski [2] used statistical methods to calculate the error between image points and ground points. Weng [3], Kanazawa [4], and Brooks [5] used a covariance matrix to describe the accuracy of feature points, and Haralick [6], Haralick [7], and Leo [8] used covariance propagation law to calculate the uncertainty of feature points. Matching points can be formed from the feature points with the same scene in two images. Fitzpatrick [9] pointed out that the most important error measure of matching points is target registration error, which is the distance after registration between corresponding points not used to calculate the registration transform. Fathy [10] also studied the accuracy for different error criteria of matching points. From the above literature, we know the criteria of the uncertainty of matching points.
The uncertainty of matching points depends on numerous factors [11], including the number, accuracy, and distribution of matching points. Some scholars have paid close attention to the feature matching algorithm to improve the accuracy of matching points. For example, Gui [12] presented a point-pattern matching method using SURF and shape context, Tong [13] and Zhao [14] improved image feature point detection and matching algorithm in a binocular vision system, and Hu [15] studied a robust image feature point matching algorithm based on structural distance. Moreover, Mai [16] investigated the impact of selection error and distribution of fiducial points on the accuracy of image matching between 3D images. Other scholars focused on the distribution of matching points. Fitzpatrick [9] also studied the distribution of target registration error in rigid-body pointbased registration and found that the method was reliable for image matching to use the triangle constraint [17][18][19][20][21]. Tan [17,18], Guo [19], and Seo [22] indicated that a more precise result can be obtained using the evenly distributed matching points. However, in previous literature, the quantitative method for the distribution of matching points could not get appropriate attention.
The accuracy of image registration depends significantly on the uncertainty of the extracted matching points. The existing work [23] introduced horizontal dilution of precision (HDOP) to measure the location error on the image, and preliminarily described the construction method for the uncertainty of matching point distribution on 3D reconstruction. The present work mainly focuses on the detailed derivation that HDOP can measure the error of image points, describes the design process of the cost function ( * ), and uses the criteria (symmetric transfer errors) of the uncertainty of matching points to test the validity of the proposed function in the field of image registration.
The remainder of this paper is organized as follows. Section 2 mainly introduces derivation of HDOP on the image and the design process of the cost function for the uncertainty of matching point distribution. Section 3 uses experiments to verify the rationality of the proposed function. Section 4 provides conclusions. Finally, Section 5 describes the related patents.

Methods
As is shown in Figure 1, image 1 and image 2 are a pair of stereo images. First, a certain amount of known points (dark spots) in the two images can be extracted and then the homography matrix H can be computed by the above known points. Here, H represents the projective transformation relations of image 1 and image 2. Using H, we can seek all the corresponding fixed points (red spots) in the overlapping region. When the corresponding fixed points are superimposed together, then image registration is realized.
The above process shows that the quality for image registration is mainly caused by the accuracy, number, and distribution of the known matching points. This study mainly measures the uncertainty of the matching point distribution in the overlapping region of two images.

Derivation of HDOP
Suppose that the true coordinate of the fixed point is (X, Y) and the coordinate of the i-th known point is ( , ). Thus, the distance between the i-th known point and the fixed point is However, it is inevitable that a location error will occur between the measured and true coordinates of the fixed point. Suppose the measured coordinate of the fixed point is ( , ). The distance between the i-th known point and the actual measurement point then becomes Relative to the distance between the known point and the fixed point, the location error is relatively small. Therefore, in this study, Formula (1) can be transformed using the Taylor series one-time terms at the measured location of ( , ). We get Suppose that the distance errors between the fixed point and known points are If more than two known points are given, then the set of equations = derived from Formula (4) is over-determined, and the location error can be calculated by the least squares method.
According to the definition of covariance, we know that Assume that the distance error has the same value in the X, Y direction in the same stereo pair, then Moreover, Here, ( ) reflects the relationship between the location error and the distance error. When the distance error is a fixed value, the location error only relates with ( ) . Hence, Tr(( ) ) is used to measure the location error on the image, and Tr() is the sum of the diagonal elements of the matrix, which is the scalar function of the matrix [24].
In the field of satellite navigation and geomatics engineering, dilution of precision (DOP) represents the influence of the relative geometric relationship between the user and the positioning constellation on the location error. HDOP, which is a type of DOP, expresses the precision of the plane position on the basis of satellite latitude and longitude coordinates. HDOP is consistent with the location error on the image. Thus, we can use HDOP to describe the location error on the image.

Design Process
Formulas (4)- (10) illustrate that the HDOP is related to the number and position of known points. This study mainly investigates the effect of the distribution of known points on the location error of fixed points, and so the effect of the number of matching points needs to be eliminated.
With Formulas (3) and (5) Here, tr( ) = . Suppose that λ and λ are the eigenvalues of , then λ + λ = . Gerschgorin's disk theorem [25] in matrix theory shows that the range of the first and second eigenvalues of are the same. Therefore, = tr(( ) ) = tr dig 1 λ , Then, the purpose of HDOP divided by √ is to remove the effect of the number of known points. Meanwhile, the normalization function is utilized to transform × √ into the range of 0-1. Specifically, × √ − 1 can make its range from (1, +∞) to (0, +∞). Next, the anti-tangent function is selected for transformation, with a range between 0 and π/2. Thereafter, the transformation result is multiplied by 2 and then divided by π. Finally, × √ can be converted to between 0 and 1. We also use * to describe the converted function.
In previous literature, feature matching in stereo images encouraged uniform distribution [17][18][19]22], and matching points with even distribution in the overlapping region are better to estimate a more precise homography matrix. Therefore, uniformity is an important parameter to measure the distribution of matching points.
In the field of satellite navigation and geomatics engineering, when the user is at the center of a uniform polyhedron formed by multiple visible satellites, the DOP is the smallest and the positioning accuracy is the highest [26,27]. Similarly, when the fixed points on the images are at the center of evenly distributed known points, the HDOP is the smallest and their location error is the smallest. In this study, the center points of the overlapping region are considered as the fixed points, their * values are chosen to measure the uniformity of matching point distribution.
In addition, the known matching points are comprised of corresponding feature points on the left and right images, but their pixel coordinates on the respective image are different. Hence, the * calculated by using Formulas (1)-(13) on the left and right images are different. This study selected * , the average * on all images, as the final result. Figure 2 is the flow chart of the proposed method.
Here, * has a range of [0, 1]. When * , calculated by the known matching points of a certain distribution, is close to 0, the distribution based on these matching points may be more even in the overlapping region of stereo images, and it is better for them to perform image registration.

Experiment
This work chose to verify the rationality of the proposed method in the field of image registration. Stereo pairs, which include the left and right images, were selected on the basis of simulated and real scenes. Here, the average of symmetric transfer errors of matching points in the images was considered as a parameter to evaluate the quality of the image registration.

Simulation Scene
The experiment in this work was a simulation scenario of a plane calibration board. Photos were taken with a Huawei Honor 30S mobile phone, and the photo sizes were 3456 pixels × 4608 pixels with a focal length of 6 mm. The stereo pair was comprised of both photos in Figure 3a,b and had an overlap of about 50%. A total of 112 pairs of matching points were extracted by hand, and their coordinates are shown in Figure 3a,b. Then, the overlapping region and its corresponding center points can be calculated by the above matching points. Figure 3c

Data Source
There were two experiments designed in the simulation scenario. Experiment I included two tests. Test1-1 concerned the different number of matching points in the same distributed region. Test1-2 involved the matching points with the same distribution uniformity and different distribution locations. Experiment II included three tests with the same number and the different distribution of matching points, which could be studied to gain the relationship between the quality of image registration and * . Test2-1 involved the matching points in the central area spread to the entire overlapping region, test2-2 concerned the matching points of the image corners spread to the entire overlapping region, and Test2-3 concerned the linear matching points spread to the entire overlapping region. These matching points were also extracted by uniform sampling and by controlling pixel coordinates on the images. Their distributions are shown in Figure 4.

Result Evaluation
In the image registration where errors occur in both images, it is suitable that errors be estimated in both images. Therefore, the symmetric transfer error in two images is chosen to measure the deviation of matching points, which is the sum of the transfer errors in the first and the second images.
The transfer error is the Euclidean image distance in the second image between the measured point x' and the point Hx at which the corresponding point x is mapped from the first image [11]. Therefore, the symmetric transfer error can be described as Here, xi and xi′ are a pair of matching points in two images, where i is the number of known matching points. H and H −1 are the matrices of the forward and backward transformation, respectively. In addition, we use the average of symmetric transfer errors of all control points in the overlapping region as the quality of image registration. In Figure 3, 112 pairs of matching points are considered as the above control points. We can use matching points in Figure 4 to gain the matrix H and then use Formula (14) to gain the average of symmetric transfer errors of the above control points.
The proposed method in this study can be used to calculate the * value of matching points with different numbers and different distributed regions. Specifically, the overlapping region (red rectangles in Figure 4) needs to be estimated, its their center points can then be computed. The * values on both images were calculated using Formulas (1)-(13) and then * was determined. The specific calculated results are shown in Tables 1 and 2. (1) Correctness of the proposed method The purpose of Table 1 is to illustrate the correctness of the proposed method in this study. The proposed method used * to describe the relationship between point error and point distribution, eliminated the influence of the number of matching points, and chose the center points' * of the overlapping region to measure the distribution of matching points. Therefore, there were two purposes for Experiment I in Table 1: one is to illustrate that the number of matching points has little effect on * , and the other is to illustrate that the center point's * of the overlapping region can reflect the influence of same distribution uniformity and different distribution location on image registration.  In Test1-1 of Table 1, as the number of matching points decreases, the error increases. We can say that the number of matching points influences the average of symmetric transfer errors, but the effect is little. Similarly, the change trend of * is consistent with the average of symmetric transfer errors and has little effect overall. Therefore, the proposed method in this study eliminated the influence of the number of matching points.
In Test1-2, deviation degree is a ratio of the distance between the center of the region where matching points are located and the center of the overlapping region to the half diagonal of the overlapping region [28]. As the deviation degree increases, both the average of symmetric transfer errors and * increase. * and the deviation degree are consistent with the average of symmetric transfer errors. Hence, we can say that * can reflect the effect of the deviation degree on matching point distribution. It is more appropriate to use the center points' * of the overlapping region to measure the impact of matching point distribution on the image registration.
(2) Rationality of the proposed method On the basis of Experiment I, we know that the number of matching points, taken by itself, has little effect. Thus, this experiment randomly selected about 15 points and designed three tests to verify the rationality of the proposed method.
Distribution uniformity (DU) [28] is the ratio of the total length of the minimum spanning tree of all points to the one-half power of the number of points, and it can be used to measure the uniformity of points on the image plane. As DU increases, the distribution of points becomes more uniform, and the average of symmetric transfer errors should be smaller, but there is an exception in Test2-1 of Table 2.  However, the changing laws of * proposed in this paper, the uniform distribution of matching points, and the average of symmetric transfer error are consistent in Table 2. When * values in Figure 4(a4,a5) are close to 1, the average of symmetric transfer errors is relatively large. In addition, when * values is close to 0, the average of symmetric transfer errors is small.
Compared with DU, * has a range [0, 1] to measure the uniformity of matching points distribution, and it is more suitable to measure the influence of matching points distribution on the average of symmetric transfer errors.

Real Scene
In this experiment, the stereo pair (Tsinghua School) published by the Institute of Automation of the Chinese Academy of Sciences was selected for testing. Matching points were extracted by using the SURF and the nearest neighbor search algorithms. A total of 642 pairs of matching points are shown in Figure 5a,b with '+' symbols. In addition, 30 pairs of control points were extracted by hand, and their coordinates are shown in Figure  5a,b with 'o' symbols. Figure 5c is the registered image obtained by overlapping the above matching points.

Data Source
On the basis of the simulation scene experiment, we know that the number of matching points only has a little effect. Thus, this experiment randomly selected about 150 points and designed the following experimental data to verify the rationality of the proposed method.

Result Evaluation
In this experiment, we chose the average of symmetric transfer errors of control points in Figure 5 to measure the quality of image registration. We used matching points in Figure 6 and the flow chart in Figure 2 to calculate the * value, and then used Formula (14) to compute the average of symmetric transfer errors. The specific calculated results are shown in Table 3. Table 3. Results calculated by the matching points in Figure 6.  Table 3 presents perfect conditions for matching points in Figure 6(a1,b2,c2) to perform image registration. We can then say that the matching points are distributed around the center of the overlapping region, and evenly distributed matching points can perform image registration better.
From Tables 2 and 3, we found that the average of symmetric transfer errors is not the smallest for evenly distributed matching points throughout the overlapping region. The matching points distributed on the edge of the overlapping region may affect the accuracy of image registration. Therefore, it is recommended that the matching points should be uniformly distributed inside the overlapping region that does not contain its marginal region.

Conclusions
This study mainly accomplished two things: one was to construct the cost function to measure the uncertainty of matching point distribution, and the other was to test the validity of the proposed method in the field of image registration. Specifically, the proposed method was designed as follows: (1) The study derived the influence value of the known points on the position error of the fixed point, which is represented by HDOP. We used two groups of experiment data to test the validity of the proposed function in the field of image registration. The proposed function is consistent with the average of symmetric transfer errors in the image registration and can be used to measure the uncertainty of matching point distribution. When * is close to 0, it is better for these distributed matching points to perform image registration. Additionally, when it is close to 1, the average of symmetric transfer errors may be larger, and we may need to re-extract matching points for image registration.

Patents
There is a Chinese patent resulting from the work reported in this manuscript. The patent title is "A quantitative method for calculating the reliability of the distribution of matching points", and its number is ZL201910311174.2.  Data Availability Statement: In this study, experiment scene was the plane calibration board, and its photos were taken with a mobile phone. It is relatively easy to obtain experiment data. Therefore, no data were created in this study.