Shape Approximation Based on Higher-Degree Polynomials

The planar shape (contour) of an object is a fundamental source of information in a pattern recognition problem. Obtaining the relevant information set rests on difficult procedures and is a key problem in pattern recognition. A method is proposed for the segmentation of contours with a complex geometrical form. It is based on a parametric piecewise approximation of 12th order spanned by a polynomial model defined by basic elements. Higher-order polynomial approximation allows to optimize the number of segments on the contour and to obtain analytically the dependence of the curvature for more exact calculation of informative signs that are invariant to geometrical transformations. The algorithm based on this method as well as specific examples are described in detail.


Introduction
Not the goal is the subject of decision, but the means to the goal . . .Aristoteles The planar shape (contour) of the object is a fundamental source of information not only in pattern recognition but also in the information technologies as well.For example, to recognize objects at complex image in real time, the processor's performance should be approximately 10 8 -10 14 elementary operations per second.Therefore, instead of processing each point of the object, only its contour is processed.
Analytical curves such as pieces of straight lines, circles and spirals arches, cubic splines, etc. are used more often in the approximation of contour lines (CL).In this case the efficiency of the CL approximation is decreased because a big number of short segments [1][2][3].
The goal of this work is to increase the efficiency of the pattern recognition and image processing algorithms using high-degree polynomials for the approximation and smoothing of planar shapes.
An approximation by a higher-degree polynomial has several advantages over the approximation by a low-degree polynomial.For example, if the length of intervals increases, the errors of the approximation are decreased.The number of segments on the contour is decreased, informative signs are calculate more precisely.
The higher degree of the polynomial, the smaller the number of the grid nodes, and the accuracy and quality of the approximation is better.Increasing the degree of the polynomial reduces the number of the nodes and improves the smoothness and quality of the solution inside of the interval of approximation.
e-mail: dnd@jinr.ruAt the same time, an increase in the degree of the polynomial usually leads to: loss of stability, considerable error increase of the predicted value at extrapolation, increase of the order of the derivatives used, increase of the computational complexity.Therefore formulas of smoothing by higher-degree polynomials are avoided almost altogether.
To reduce these difficulties, a new proposal for the choice of the polynomial spanning basis, called the Basic Element Method (BEM) has been developed recently in our Laboratory [4][5][6][7].
A higher-order polynomial approximation allows to optimize the number of segments on the contour line and to obtain analytically the dependence of the curvature for it more precise calculation of informative signs that are invariant with respect to geometrical transformations.
The efficiency of the polynomial approximation and smoothing depends of many factors including the form of the polynomial.
The new polynomial form has been constructed in the frame of BEM (BEM-polynomial).Higherdegree BEM-polynomials simplify the function approximation and data smoothing.
The following conception underlies the construction of the BEM-polynomial: "analytical connection between nodes of a three-point grid and corresponding triplets of pivot points of the BEMpolynomial and of its derivatives".

What is a BEM-polynomial?
But very often it is important for an error to be reduced to zero within the limits of the interval [8] P. L. Chebyshev The BEM-polynomial construction is based on Chebyshev's idea about the approximation of a smooth function by a polynomial on an interval of limited length (1853) [8].
The nth degree BEM-polynomial is expressed via four basic elements (BE): one cubic parabola (Q) and three quadratic parabolas (w 1 , w 2 , w 3 ).
The four functions Q, w 1 , w 2 , w 3 are defined by three nodes of a three-point grid ∆ αβ 3 : x α < x 0 < x β and depend on τ, α, β, where τ The basic elements w 1 , w 2 , w 3 and Q depend continuously on the parameters x 0 , α and β.These parameters are related to the independent variable τ by the special cross-ratio rule where the first point is fixed, this rule generates three fractional rational functions w 1 , w 2 , w 3 with respect to the parameters α, β and τ (quadratic functions relative to τ) [4]: The fourth element Q is a zeroing cubic parabola [4] The polynomial P n (x) = n i=1 a i x i can be written in the BEM basis form as follows: where the quadratic parabolas Π j in Eq. ( 1) are convolutions of the vector w = [w 1 , w 2 , w 3 ] T with the vectors of the coefficients r j = [r j1 , r j2 , r j3 ] T , i.e.Π j = w T r j , j = 0, m.The basis functions (BF) in Eq. (1) b j (τ, α, β) = Q j w j are polynomials of the degree 3 j + 2 having zeros at the nodes of the three-point grid ∆ αβ 3 .Graphs of the BF are shown in Fig. 1, left.The basic elements define a structure and fulfill properties such as • partial symmetry with respect to the permutation of the parameters α ↔ β: • scale invariance of w j : w j (µτ, µα, µβ) = w j (τ, α, β) and These properties allow to optimize the parameters of a piecewise polynomial approximation (PPA) [7].In terms of the BF the BEM-polynomial (1) can be written as The geometrical sense of Eq. ( 1) is shown in Fig. 1, right.The construction of the BEM-polynomial presents a synthesis of the properties of the Taylor polynomial and of the second degree Lagrange polynomial defined over the same three-point grid.

Properties of the BEM-Polynomials
The BEM-polynomials have some advantages with respect to other polynomials: they are defined on three-point grids; all their continuous parameters are measurable values; the errors associated to them vanish at the boundaries of the interval; it is possible to change the basis functions and the regression matrices via the parameters α, β [4]; the polynomial approximation of continuous functions asks for the n/3 times smaller order of derivatives, where n is the degree of the polynomial; the coefficients of the BEM-polynomial depend on the parameters α, β by recurrent formulas [6]; the BEM-polynomials decrease the computing complexity and provide stability of calculations with respect to the input errors [4]; the control parameters allow to optimize the solution of local and global piecewise polynomial approximations [7], etc.

Mean-Square Piecewise Polynomial Approximation Algorithm
In this section an algorithm for smoothing planar CL is described using mean-squares piecewise BEM-polynomials of 11th degree (BEM-MSPPA).Data smoothing using the piecewise BEM-polynomial allows to optimize the solution via the control parameters α, β, x 0 .The order of the derivatives is decreased substantially in comparison with the degree of the approximating polynomial in the computation of r jν , ν = α, β, 0, j = 0, m [6], [7].
The algorithm BEM-MSPPA is executed in four stages: 1.An interval [a, b] and input data set Setting parameters x 0 k , α k , β k and γ k = β k − α k and preparation of nodes of the three-point grids: where N s is the number of points of the kth segment on the grid ∆ α k β k 3 .The data of each segment on the grid ∆ α k β k 3 is smoothed by the 11th degree BEM-polynomial P BEM (x) = 3 j=0 b T j r j where the components of r 0 are pivotal points and r j is free, j = 1, 3 on a curve to be approximated [4] (the index k of the segment is dropped here and below for easy reading).
3. Calculation of nine coefficients r j using the Least Squares Method (LSM) criterion 4. Estimates Π j = w T j r j , j = 1, 3 are used for the calculation of f (x), x ∈ [x α , x β ] by the Horner type scheme: û Testings of the BEM-approximation algorithm are presented in [4]- [7].The example in Fig. 2 shows the four stages of the BEM-MSPPA algorithm for data smoothing at the grid ∆ αβ 3 [6].Data S = { fi } 250 i=1 was obtained by scattering points around the curve  The deviation f − f is made smaller than the deviation f − φ at the expense of choosing the parameter x 0 in a zone of peak position (Figs.2a, 2b).

Approximation of Planar Shapes
A planar CL is parametrically definable in the form of two functions x(s) and y(s) depending on a parameter s (length of the arch): In practice, a contour line (CL) of complex topology is measured with errors: x = x+e x , ỹ = y+e y , e ∼ N(0, σ).BEM-MSPPA has been used for smoothing { xi } and {ỹ i }, i = 1, N.
The algorithm BEM-MSPPA has five parameters for the optimization of the solution: the shift parameter (x 0 ), three parameters of local smoothing (α, β, M) and one parameter of global smoothing (K), where 2M+1 is the number of points nearest to the nodes of the three-point grid for the calculation of components r 0 while K stands for the number of segments [7].
There are hot difficulties of PPA: the optimum arrangement of the nodes on the grid and the order of the smoothness at the breakpoints.The curve approximating contour of an object should lie near the measurement points, and its representation will be the most effective if we use the minimum possible number of segments K.The BEM-polynomials fulfill these requirements.The analytical dependence of the borders of complex geometric shapes is obtained through approximation (smoothing) of 2D curves.
Results of BEM-smoothing of a complex topology CL that was made in pencil by hand (Fig. 3).

Computation of Phase Portraits and Signatures
Signature curves are very useful for developments in computer vision applications, such as artificial intelligence, medical imaging devices, the study of DNA, etc [9], [10].Informative signs of the shape are the length of the contour line L, the zeros of the curvature κ(s), differential informative signsthe phase curve Φ(κ(s), κ s (s)) = κ(s)/κ s (s), where κ is the curvature κ(s) = ẍ(s) + ÿ(s) and κ s is the first derivative with respect to the arc length s: κ s (s) = κ(s), etc.
Both κ and κ s (as well as all higher order arc length derivatives) are Euclidean differential invariants, meaning that they are unchanged under rigid motion (isometric transformation (TI)) [11], but they change under similarity (TS) and affine (TA) transformations.
It is possible to use various functions depending on the regular points (κ s (s) 0) on the phase curve Φ(κ, κ s ; K).To compute the signature of the shape at the nodes s 0 k we used two values:    The value SGNT is an informative sign.It can be used for objects classification, as shown in Fig. 5, where SGNT cat SGNT dog .

Conclusion
In this paper, we have discussed the problem of higher-degree piecewise polynomial smoothing of digitized 1D and 2D curves and the segmentation of planar curves.A mean-squares approximation algorithm is proposed.It is spanned by a new polynomial basis, called BEM-polynomial, which is defined on a three-point grid.The construction of BEM polynomials comprises the properties of Taylor polynomial expansions around the nodes of a three-point grid and Lagrange polynomials of degree 2.
The segmentation of complex curves by cubic splines or pieces of straight lines, circles and spirals arches, etc. yields a big number of short segments.In comparison with these approaches, the segmentation by high-degree BEM-polynomials gives a much smaller number of segments ensuring a significantly higher order of smoothness at larger length of the interval of the three-point grid.
Examples of the segmentation of the boundary curves of objects and computations of their differential invariant signatures confirm the efficiency of the BEM-polynomials in accuracy and quality of approximations.The algorithm based on BEM-polynomials can be used for the classification of the contours under several geometric transformations, even in the presence of input errors.

Figure 2 .
Figure 2. Four stages of the BEM-smoothing algorithm (a) and results of the BEM-smoothing (b)

Figure 3 .
Figure 3. Parametric smoothing of a curve of complex topology using 11th degree BEM-polynomials: measurement points (a), estimates of xk and ŷk (b) and 10 smoothed segments (c) where s 0 k ∈ [s α k , s β k ].SGNT is average of N T values of sign obtained at TS-or TA-transformations.The length of the interval [s α , s β ] increases with the degree increase of the polynomial.The inner

Figure 4 . 6 EPJ
Figure 4. Graphics pointing to the change of the curvature, phase curves and histograms of SGNT under isometric (TI), similarity (TS) and affine (TA) transformations

Figure 5 .
Figure 5. Measurement points, segments, phase portraits (TI,TS,TA) and SGNT computed for N T = 100.Histograms of sign for TS and TA are shown on the right Curvatures κ(s) and phase portraits Φ(κ, κ s ) and sign are shown in Fig. 6 under similarity and affine transformations.

Figure 6 .
Figure 6.The curvature (first 6 segments), phase curves and histograms of sign are obtained under TS-and TA-transformations (N T = 100)

Figure 7 .
Figure 7. Mirror reflection of a face without and with errors, phase curves and SGNT An example of BEM-segmentation of contours with errors (σ = 0.1) and without (σ ≈ 0) in input data is visualized in Fig. 7.The comparison of the phase portraits and signatures SGNT is shown for mirror reflection transformations.