MEASUREMENT PRECISION AND ACCURACY OF THE CENTRE LOCATION OF AN ELLIPSE BY WEIGHTED CENTROID METHOD

Circular targets are often utilized in photogrammetry, and a circle on a plane is projected as an ellipse onto an oblique image. This paper reports an analysis conducted in order to investigate the measurement precision and accuracy of the centre location of an ellipse on a digital image by an intensity-weighted centroid method. An ellipse with a semi-major axis a, a semi-minor axis b, and a rotation angle  of the major axis is investigated. In the study an equivalent radius r = (acos+ bsin) is adopted as a measure of the dimension of an ellipse. First an analytical expression representing a measurement error (x, y) is obtained. Then variances Vx of x are obtained at 1/256 pixel intervals from 0.5 to 100 pixels in r by numerical integration, because a formula representing Vx is unable to be obtained analytically when r > 0.5. The results of the numerical integration indicate that Vx would oscillate in a 0.5 pixel cycle in r and Vx excluding the oscillation component would be inversely proportional to the cube of r. Finally an effective approximate formula of Vx from 0.5 to 100 pixels in r is obtained by least squares adjustment. The obtained formula is a fractional expression of which numerator is a fifth-degree polynomial of {r−0.5×int(2r)} expressing the oscillation component and denominator is the cube of r. Here int(x) is the function to return the integer part of the value x. Coefficients of the fifth-degree polynomial of the numerator can be expressed by a quadratic polynomial of {0.5×int(2r)+0.25}.


INTRODUCTION
Circular targets on a plane are often utilized in photogrammetry, particularly in close range photogrammetry.A circle on a plane is projected as an ellipse onto an oblique image.The centre location of an ellipse on a digital image can be estimated by centroid methods, by structural measuring methods, or by image matching methods (Luhmann et al., 2006).This paper reports an analysis conducted in order to investigate the measurement accuracy and precision of the centre location of an ellipse on a digital image by an intensity-weighted centroid method.In the paper, an intensity-weighted centroid method is called WCM for short, an unweighted centroid method using a binary image created by thresholding is called BCM, non-iterative ellipse fitting is called NEF, iterative ellipse fitting with the star operator is called EFS, and least-squares matching is called LSM.A measurement error of the centre location of a circle or an ellipse is denoted by , and a variance of  is denoted by V() in the paper.
Besides measurement errors of the centre location of an ellipse on a digital image, there is a disparity on an oblique image between the centre of the projected ellipse and the projected location of the centre of a circle.The disparity is often called an eccentricity of projection (Luhmann et al., 2006).The eccentricity exists not only in a digital image but also in an analogue image.The author showed a general formula calculating the eccentricity using the size and the location of a circle, the focal length, the position and the attitude of a camera (Matsuoka et al., 2009).The formula indicates that the eccentricity becomes larger as the circle becomes larger.

Measurement of the Centre Location of a Circle
As for a circle, the author reported an experiment in order to evaluate three measurement methods WCM, BCM, and LSM by using synthesized images of various sizes of circles (Matsuoka et al., 2009).The experiment was made by Monte Carlo simulation using 1024 synthesized images of which the centres were randomly distributed in one pixel for each circle.The radius of a circle was examined at 0.1 pixel intervals from 2 to 40 pixels.V() by WCM and BCM appeared to oscillate in an approximately 0.5 pixel cycle in radius, even though the formula to estimate the centre location of a circle by each centroid method does not seem to produce such cyclic measurement errors.
In photogrammetry some papers on the precision and/or accuracy of measurement methods of the centre location of a circle have been presented (Trinder, 1989, Trinder et al., 1995, Shortis et al., 1995).However, these papers reported experiments using limited sizes of a circle and did not indicate that the measurement precision by centroid methods may oscillate in an approximately 0.5 pixel cycle in radius.
On the other hand, in computer vision an investigation of the effect of the size of a circle on the measurement errors of its centre location by BCM was reported (Bose and Amir, 1990).A simulation on the measurement errors was executed in the study.In the simulation, 400 binarized circles were placed at 0.05 pixel intervals covering a range of one pixel in x and y direction, and the radius of a circle was examined at merely 0.25 pixel intervals.Consequently, there was no mention of finding cyclic measurement errors in the paper.
The author reported an analysis of the effect of sampling in creating a digital image on V() by WCM and BCM (Matsuoka et al., 2010).The study was conducted on the assumption that images were sampled but not quantized in digitization.Although general expressions representing V() by both methods are unable to be obtained analytically, V() were obtained by numerical integration.The results of the analysis indicated that sampling in creating a digital image would cause V() by both methods to oscillate in an approximate 0.5 pixel cycle in radius.

Measurement of the Centre Location of an Ellipse
As for an ellipse, the author conducted an experiment in order to investigate whether V() by WCM, NEF, EFS and LSM oscillates as its dimension increases (Matsuoka, 2014).The experiment was executed by Monte Carlo simulation using 1024 synthesized images of which the centres were randomly distributed in one pixel for each ellipse.Three flattenings 0.00, 0.25, 0.50, and three rotation angles 0.0°, 22.5°, 45.0° were investigated.The results clearly showed that V() by all the methods would oscillate as the dimension of an ellipse increases.Moreover the results indicated that the flattening and the rotation angle of an ellipse would affect the cycle of the oscillation of V().
Therefore the author intended to conduct an analysis in order to investigate the influence of the flatting and the rotation angle of an ellipse on the cycle of the oscillation of V() by WCM.Since the aim of the study is to investigate the basic characteristics of the oscillation of V(), the analysis was conducted on the assumption that an image is free from noise and sampled but not quantized in digitization.
In practical measurements, V() are affected by some other factors.One of the most influential factors would be quantization in creating a digital image.As for a circle, the author reported an investigation on the effect of quantization on V() by WCM (Matsuoka et al., 2011).The results of the investigation showed that V() would oscillate in an approximate 0.5 pixel cycle in radius for any quantization level and decrease as a quantization level increases.Another most influential factor would be image noises.As for a circle, the author reported an experiment on the influence of image noises on V() by using synthesized images (Matsuoka et al., 2009).The results of the experiment indicated that V() by WCM would be highly correlated to the variance of random Gaussian image noises.

Investigate Ellipse
An ellipse with a semi-major axis a and a semi-minor axis b may be represented in the uv coordinate system by the following equation: Consider that the rotation angle of the major axis is  and the centre of the ellipse is located at (x C , y C ) in the xy coordinate system as Figure 1 shows.The transformation from the uv system to the xy system can be written in the following equation: x Then the investigated ellipse can be represented in the xy system by the following equation: Rearranging Equation (3) gives the following equation: where Since P > 0 and R > 0, let p and r be as follows: If a point (x, y) is on the circumference of the ellipse, x and y can be written in the following equation: From Equation ( 7) the following condition can be derived:

Investigated Measurement Method
The measurement method investigated in the study is an intensity-weighted centroid method which estimates the centre location (x C , y C ) of a figure by using the following equation: where w(i, j) is the weight of the pixel (i, j).In the study I assumed that an image is free from noise and sampled but not quantized in digitization and a figure in the image has uniform intensity.Therefore w(i, j) is the area of part of the figure inside the region {(x, y)

Formula of Measurement Error
Consider that the investigated ellipse is located so that the most left and the bottom of the ellipse are x = s (0  s < 1) and y = t (0  t < 1) respectively as Figure 2 shows. where int(x) is the function to return the integer part of the value x.
Because the area of the ellipse is ab, the following equation can be obtained: Here let w(i, ) and w(, j) be as follows: w(i, ) and w(, j) are the areas of part of the ellipse inside the regions {(x, y) Substituting Equations ( 12) and ( 13) for Equation (10) gives the following equation: Since (x C , y C ) = (r+s, p+t), a measurement error ( x ,  y ) can be represented by the following equation: Here the area S x (x R ) of part of the ellipse inside the region {(x, y) | s  x  x R , t  y  (2p+t)} and the area S y (y T ) of part of the ellipse inside the region {(x, y) | s  x  (2r+s), t  y  y T } are as follows: Then the following equations can be derived: Substituting Equations ( 17) and ( 18) for Equation (15) gives the following equation: Finally the following formula expressing ( x ,  y ) can be obtained by substituting Equation ( 16) for Equation ( 19): Equation ( 20) clearly indicates that  x and  y depend on (s, r) and (t, p) respectively.

Formula of Variance of Measurement Errors
Measurement precision is usually evaluated by the variance of measurement errors.Since Equation (20) indicates that  x is independent of t and  y is independent of s, the variance (V x , V y ) of ( x ,  y ) can be obtained by the following equation: Substituting (r, s, N) for (p, t, M) in Equation ( 20) makes  y the same as  x .Therefore only V x will be examined from now on.
Moreover when a is equal to b, that is, the ellipse is a circle with a radius a, both p and r become equal to a. Accordingly, I decided to adopt r expressed by Equation ( 6) as a measure of the dimension of an ellipse and call it an equivalent radius.
I have been trying to obtain an analytical expression representing V x .At the moment V x is unable to be obtained analytically if r > 1/2, while if 0 < r  1/2 the following formula was derived after many tiresome manipulations of analytical integration:

Calculation of Variance of Measurement Errors
Values of V x were calculated by Romberg integration using Equations ( 20) and ( 21) when r > 1/2.r was examined at 1/256 (=0.00390625) pixel intervals from 0 to 100 pixels.
Figure 3 shows the calculated V x against r.The vertical axis of Figure 3 is expressed on a logarithmic scale.Figure 3 indicates that V x shows a tendency to decrease gradually as r increases.
Figure 3 demonstrates that V x would oscillate in a 0.5 pixel cycle in r as well.

Variance excluding Oscillation Component
Here let  be as follows: where int(x) and fra(x) are the functions to return the integer and fractional parts of the value x respectively.Considering the oscillation of V x I assumed that V x would be expressed by the following equation: where A() and () are functions of .
The vertical axis of Figure 4 is expressed on a logarithmic scale.

Approximate Function for Oscillation
In order to investigate the oscillation of V x I calculated values and divided differences of the function f(r) represented by the following equation: r was examined at 1/256 pixel intervals from 0.5 to 100 pixels.The divided differences were calculated in each 0.5 pixel interval in r.
Figure 5 shows the function values f(r), the first divided differences f (1) (r), the second ones f (2) (r), the third ones f (3) (r), and the fourth ones f (4) (r) against r.Red and yellow lines in f (4) (r) of Figure 5 show approximate linear functions of f (4) (r).
Figure 5 indicates that f (4) (r) would be approximated by a linear function with sufficient accuracy when r ≥ 4.5.Although f (4) (r) seems unable to be approximated by a linear function with sufficient accuracy when 0.5 < r < 1.5, I judged that f(r) in each 0.5 pixel interval from 0.5 to 100 pixels in r would be able to be approximated by a fifth-degree polynomial of .
Here let n be an integer and 0  n  5. k n is assumed to be expressed by the following equation: where r is the equivalent radius of the midpoint in 0.5 pixel interval, which is expressed as follows: The coefficients l 00 , l 01 ,..., l 52 were obtained by least squares adjustment.Table 2 shows the obtained l 00 , l 01 ,..., l 52 .Red lines in Figure 6 show approximate values of k 0m , k 1m ,..., k 5m calculated by using the obtained l 00 , l 01 ,..., l 52 .Figure 6 indicates that all coefficients except k 1 would be approximated with sufficient accuracy by Equation ( 27).As for k 1 , although there is a small discrepancy at 0.75 r  , all except 0.75 r  would be approximated with sufficient accuracy by Equation ( 27).Consequently I judged that k 0 , k 1 , ..., k 5 would be able to be approximated by Equation ( 27).

Approximate Formula of Measurement Precision
Finally an approximate formula of V x when r > 0.5 was obtained.The obtained formula is as follows: where l n0 , l n1 , l n2 (n = 0, 1, ..., 5) are given by Table 2. int(x) is the function to return the integer part of the value x.
By using the obtained formula (29) I calculated V x at 1/256 pixel intervals from 0.5 to 100 pixels in r.Some of the calculated results are shown in Figure 7. Blue dots "Obs." in Figure 7 show V x by the numerical integration, while red lines "Est." in Figure 7 show V x by the approximation.
The maximum absolute approximation error was 4.640×10 -6 (1.732094×10 -3 by the numerical integration, 1.736734×10 -3 by the approximation) at r = 0.5.A root mean squares of errors (RMSE) V x 1/2 by the numerical integration and by the approximation at r = 0.5 is 0.041618 pixels and 0.041674 pixels respectively.The difference between two values is merely 0.000056 pixels.
From the results I concluded that the obtained approximation formula of V x would be effective enough.An equivalent radius r = (a 2 cos 2 + b 2 sin 2 ) 1/2 was adopted as a measure of the dimension of an ellipse in the analysis of the variance V x of  x .Although I succeeded in obtaining the analytical expression representing V x when r  0.5, I failed in obtaining an analytical expression representing V x when r > 0.5.I conducted numerical integration to obtain V x at 1/256 pixel intervals from 0.5 to 100 pixels in r.The results of the numerical integration indicate that V x would oscillate in a 0.5 pixel cycle in r and V x excluding the oscillation component would be inversely proportional to the cube of r.
I succeeded in obtaining an effective approximate formula of V x from 0.5 to 100 pixels in r as well.The obtained formula is a fractional expression of which numerator is a fifth-degree polynomial of {r−0.5×int(2r)}expressing the oscillation component and denominator is the cube of r.Coefficients of the fifth-degree polynomial of the numerator can be expressed by a quadratic polynomial of {0.5×int(2r)+0.25}.
Figure 2. Weighted centroid method The estimated centre   C C , x y of the investigated ellipse by the investigated method can be expressed as follows: