______PROCEEDING OF THE 26TH CONFERENCE OF FRUCT ASSOCIATION
Evaluating Distance Approximation for Implicit Curve Fitting
MarinaGoncharova,AlexeiUteshev ArthurLazdin SaintPetersburgStateUniversity ITMOUniversity St.Petersburg,Russia St.Petersburg,Russia m.goncharova,[email protected] [email protected]
Abstract—The curve or surface fitting problem to the given Here ∇G stands for the gradient column vector and · is data set is treated as the one of comparison of the distance the Euclidean norm. function with its suggested approximation. The comparison is performed in terms of statistical characteristics for the two sets A new point-to-algebraic-manifold distance approximation of random variables. The approach is exemplified via the sets can be expressed by the formula generated by single ellipse or a pair of ellipses. d2(pi,G)= (3) T I. INTRODUCTION |G(pi)| ∇G (pi) ·H(G(pi)) ·∇G(pi) · 1+ G(pi) . The curve or surface fitting problem is one of the nonlinear ∇G(pi) 2 ∇G(pi) 4 optimization challenges with multiple applications in cluster- T Here stands for transposition, H(G) is the Hessian of G(X). ization, computer graphics and computer vision, image and video processing [1], [2], [3], [4]. Given data set The validity of this approximation has been verified in n [12] for the case of 2D and 3D quadrics [12] and for some P = {pi},pi ∈ R ,i= 1,N, n∈ {2, 3}, planar algebraic curves in [13]; in the latter paper, this visual the problem is stated as of selection the manifold best fitting comparison of the level curves dj (X, G)=const with the to P in the meaning of minimization of an appropriate metric. offset (equidistant) curves to (1). This manifold is frequently selected in an implicit form In the present paper we deal with the formula (3) validation G(X)=0,X∈ Rn,n∈ {2, 3} (1) for arbitrary algebraic curves via generation of data set with predefined estimations of the distance values. This approach where G stands for a polynomial, whereas metric is taken as should be treated as a generalization of analysis of the point- asum of squares of the (geometric) distances from the points to-ellipse approximations carried out in [5], [6], [7]. from P to (1): N 2 II. PLANAR CURVES AND VISUALISATION d (pi,G) → min . i=1 We start a visual comparison of the formulas (2) and (3) For practical reasons, the solution to this problem is sought in with the verified in [12] case of the quadric the set of polynomials of the lowest possible degree. However, G(X):=XT AX +2BT X − 1=0, even in the case deg G =2, i.e. quadric polynomials, solution is met several obstacles one of which is related to the problem T n×n n where A = A ∈ R ,n∈ {2, 3}, and {X, B}⊂R of distance evaluation from a point to a quadric. For the aimsof are the column vectors. Formula (2) is represented as parametric synthesis, the distance is to be represented explicitly as a function of parameters involved into the problem, i.e. 1 |G(pi)| d = · . the coordinates of a point and coefficients of G(X). Such 1 T (4) 2 (Api + B) (Api + B) a formula is hardly expected for the general case of G(X) and, therefore, in modeling practice, the true distance function and formula (3) is represented as is replaced by its easier evaluated approximations. Dozens of A T A A such approximations have been suggested in current literature 1 ( pi + B) ( pi + B) d2 = d1 1+ T G(pi) . (5) for the case of planar quadrics; for the qualitative comparison 4 [(Api + B) (Api + B)]2 of someofthem we refer to [5], [6], [7]. As an example we take the ellipse Extensions of these formulas to the 3D case or to the higher order planar curves is not always possible. An example of x2 G (x, y):= + y2 − 1=0 such a universal formula is given by the so-called Sampson’s 1 16 distance [8], [9], [10], [11]: with the aspect ratio = 4 to better visualize distortions, which |G(pi)| both formulas (4) and (5) produce. Here on Fig. 1 and Fig. 2 d1(pi,G)= . (2) ∇G(pi) and further in this section we show level curves dj (X, G)=
ISSN 2305-7254 ______PROCEEDING OF THE 26TH CONFERENCE OF FRUCT ASSOCIATION
Despite the fact that the distortions seem huge, the usage of Sampson’s distance in the fitting process on noised random point cloud based on curve G2(x, y)=0shows an appropriate result [3]. For the last example in this section we choose a well-known curve, so-called Folium of Descartes 3 3 G3(x, y):=x + y − 3xy =0. Fig. 1. Level curves d1 = const for ellipse G1(x, y)=0(indicated bold)
Fig. 2. Level curves d2 = const for ellipse G1(x, y)=0(indicated bold) const from 0.25 to 3.00 in increments of 0.25. Analysis of the appearance of distortions in certain areas was in [12]. Fig. 5. Level curves d1 = const for Folium of Descartes G3(x, y)=0 Fig. 3 and Fig. 4 illustrate how formulas (2) and (3) (indicated bold) perform in the case of the complex high-order reference curve [2] 4 x G (x, y):= y5 + x3 − x2 + +1 =0. 2 27 2
Fig. 6. Level curves d2 = const for Folium of Descartes G3(x, y)=0 (indicated bold)
The level curves for both formulas (2) and (3) have neither visible significant distortions nor excessive curvature bias. In the following sections there will be more quantitative Fig. 3. Level curves d1 = const for high-order curve G2(x, y)=0 (indicated bold) analysis.
III. QUANTITATIVE ASSESSMENTS The best ellipse fitting problem has been intensively studied in the literature. Since we are able to treat the general type of algebraic curve, we concern ourselves with the case of a pairs of ellipses which is of importance to the multiple ellipse fitting problem [14], [15], [16]. We consider both cases, namely when the ellipses are separated or, on the contrary, have a nonempty intersection. The test data set is composed in the following way. We utilize the analytical expressions for the offset curves and compose a grid from these curves on varying the distance from 0.1 to 3.0 in increments of 0.1. We then find the intersections Fig. 4. Level curves d2 = const for high-order curve G2(x, y)=0 of these curves with lines passing through the center of one (indicated bold) of the ellipses. In this way, we generate about 3500 of points
------103 ------______PROCEEDING OF THE 26TH CONFERENCE OF FRUCT ASSOCIATION
with nearly equally distributed distance values in the interval IV. RESULTS [0.1, 3.0]. We treated two pairs of random ellipses, one pair is sepa- The quality of distance approximations by the formulas (2) rated, another one has nonempty intersection. The assessment and (3) will be estimated with the aid of characteristics similar measures discussed in the previous section was computed for to those utilized in [6]. every pair. In addition, in each case a level curves dj = const visualization similar to the one discussed above is provided.
A. Linearity A. Ellipses with nonempty intersection To find a linear correlation between the true distance value To produce the quantitative assessments we take the pair and its approximates, we compute the Pearson correlation of ellipses coefficient. The compute it, we first find the mean value μi 2 2 for distance approximation for the points of the set lying at G4(x, y):=(x +9(y − 20) − 3600)× the distance zi from the curve. (x2 + xy + y2 − 20x − 60y − 1000) = 0, scaled in comparison to those who were visualized on Fig. 7 (zi − zi)(μi − μi) L = i . (6) and Fig. 8. 2 2 i(zi − zi) i(μi − μi) Distance approximation (3) takes the form