Polynomial Decomposition and Its Applications

1 downloads 0 Views 585KB Size Report
Key Words: Polynomials; composition; decomposition; non-linear equations; exact solution; watermarking .... This section presents recurrence formulas that can be used in computing the coefficients ck−i and bj ..... Schaum's Outline Series.
Polynomial Decomposition and Its Applications Joon-Kyung Seong School of Computer Science and Engineering Seoul National University, Seoul 151-742, South Korea E-mail: [email protected] and Gershon Elber Department of Computer Science Technion – Israel Institute of Technology, Haifa 32000, Israel E-mail: [email protected] and Myung-Soo Kim1 School of Computer Science and Engineering Seoul National University, Seoul 151-742, South Korea E-mail: [email protected] Version: March 6, 2003 We present a simple algorithm for decomposing a polynomial H(x) into two constituent polynomials H(x) = f (g(x)), if such exist. Reversing a composition of two polynomials is shown to be reducible to a set of non-linear equations with a simple structure. While, in general, the solution of non-linear equations is quite complicated, we show that in this system the solution can be computed exactly using symbolic recurrence relations. We demonstrate the effectiveness of this result using some illustrative examples and also discuss interesting applications in geometric modeling: Reparameterization as an insecure watermarking tool and verifying the identity of a curve in two different representations.

Key Words: Polynomials; composition; decomposition; non-linear equations; exact solution; watermarking; curve matching. 1. INTRODUCTION The composition of two polynomials is a simple and common operation in geometric modeling and in general. Symbolic processing software packages, such as Maple [2] or Mathematica [8], do support this functionality as a built-in procedure. However, consider the reverse operation. Given a composed function H(x), we seek to find a decomposition, if any, to H(x) as H(x) = f (g(x)). In other words, we seek f (x) and g(x), if exist. Neither Maple nor Mathematica offers this reverse functionality. The fact that the symbolic manipulation programs provide no such capability is more surprising as function decomposition has great importance in general and in geometric modeling specifically. In fact, the composition operation has been considered to be a highly robust way to watermark spline models [5]. Hence, a clear implication of this paper is the denouncing of composition as a water-marking option. 1 Corresponding

author

Another important need for reversing the composition operation can be found in the need to identify identical curves that are represented differently. Using NURBS curves, this difference in two curves can be the result of degree raising [1] or refinements [1], operations that are easily reversed, and composition, for which a reverse operation is presented herein. Consider a common boundary curve between two surfaces. This same boundary could be represented differently in the two surfaces, making it difficult to match the curves, for example, for tessellation purposes, preventing from “black-holes” along the seams. Having a way to derive a non-reducible, canonical, form for a curve would greatly ease this matching process. As already stated, two identical curves could be represented differently if they were refined (via knot insertion), degree raised, or composed. The composition, and unlike refinement and degree raising, can also affect the parameterization of the curve. The composition f (c(t)), where c(t) is a higher degree (non-linear) representation of t, (e.g., c(t) = t[(1 − t) + t]n ), would result in a degree-raised f that preserves the speed of the curve. Any other function c(t) would result in a speed change as well, making the regular degree raising a special case. A curve that is artificially degree raised or refined could be degree reduced [6] and its redundant knots removed [4]. This work seeks a method for completely reducing the curve into a canonical form by reversing the composition process. Consider two non-linear polynomials f (x) and g(x). The resulting composition of (f ◦ g)(x) = f (g(x)) is a higher degree polynomial with many non-linear terms. In general, finding a solution to a set of non-linear equations is difficult. In our case, these equations are yet well structured, and we will employ this simple structure to achieve the goal of this paper. Moreover, its unique structure is exactly the same in projective space when f (x) is rational. The key observation of this work can be summarized as follows: In the composition of two polynomials f (x) and g(x), the lowest degree terms reveal the structure of f (x) and the highest degree terms expose the structure of g(x). The result of the composition has many high degree terms. However, and being closely related to convolution, many of these terms assume a simple form at the two ends of this composition process. In other words, the terms with the highest and lowest degrees are the simplest. In Section 2, we further justify that no generality is lost by employing the following canonical forms of f (x) and g(x), for a general composition H(x) = f (g(x)), f (x) = g(x) =

xm + bm−1 xm−1 + · · · + b1 x + b0 , xk + ck−1 xk−1 + · · · + c1 x.

(1)

By exploiting this canonical form, we could greatly simplify the composition formulation and its structure analysis. When the two functions in Equation (1) are composed, we end up with a polynomial of degree km: H(x)

= xkm + akm−1 xkm−1 + · · · a1 x + a0 = f (g(x)) = (xk + ck−1 xk−1 + · · · + c1 x)m +bm−1 (xk + ck−1 xk−1 + · · · + c1 x)m−1 ··· +b1 (xk + ck−1 xk−1 + · · · + c1 x) +b0 .

Examine the coefficients of the k terms of H(x) with the highest degrees. Each coefficient ck−i is expressible as a function of akm−i and ck , · · · , ck−i+1 , for i = 1, · · · , k − 1, where ck = 1. Once the coefficients of g(x) are computed this way, the relationship between

ai ’s and bj ’s is linear. Each coefficient bj is again computed as an explicit function of aj , c1 , · · · , ck−1 , and b0 , · · · , bj−1 , for j = 0, · · · , m − 1. The rest of this paper is organized as follows. In Section 2, we justify the simplification assumption on the canonical structure of f (x) and g(x) as presented in Equation (1). Based on this structure, we present a symbolic algorithm to decompose a curve in Section 3. In Section 4, some examples are shown and two applications are discussed: Reparameterization as an insecure watermarking tool and checking the identity of a curve in two different representations. Finally, in Section 5, we conclude this paper. 2.

A TEMPLATE SOLUTION

In this section, we present an affine transformation that simplifies the procedure of decomposing a polynomial H(x) = f (g(x)) into two polynomials f (x) and g(x) if such exist. This is to justify the simplified structure of f (x) and g(x) that was mentioned in the introduction. Consider the affine transformation which is also a linear polynomial: l(x) = αx + β, for some constants α 6= 0 and β. Then, its inverse transformation is another linear polynomial: l−1 (x) = α−1 (x − β). Given a composite polynomial H(x) = f (g(x)), there are infinitely many different ways that H(x) may be decomposed into f and g using the above linear polynomials: H(x) = f (g(x)) = fˆ(ˆ g (x)), where fˆ(x) gˆ(x)

= =

(f ◦ l−1 )(x), (l ◦ g)(x).

If f (x) and g(x) are polynomials, then fˆ(x) = (f ◦ l−1 )(x) and gˆ(x) = (l ◦ g)(x) are also polynomials of the same degrees, respectively. Assume that g(x) is a polynomial of degree k: g(x) = ck xk + ck−1 xk−1 + · · · + c1 x + c0 , where ck 6= 0. Using the linear polynomial, l(x) = c−1 k (x − c0 ), we get l(g(x)):

k−1 gˆ(x) = xk + (c−1 + · · · + (c−1 k ck−1 )x k c1 )x.

Thus, without loss of generality, we may assume that ck = 1 and c0 = 0. We will now assume that f (x) is a polynomial of degree m and that g(x) is given in the special form, with ck = 1 and c0 = 0: f (x) =

bm xm + bm−1 xm−1 + · · · + b1 x + b0 ,

g(x) =

xk + ck−1 xk−1 + · · · + c1 x,

for some bm 6= 0. Their composition H(x) = f (g(x)) is a polynomial of degree km and it can be represented as follows: H(x)

= akm xkm + akm−1 xkm−1 + · · · a1 x + a0 = f (g(x)) = bm (xk + ck−1 xk−1 + · · · + c1 x)m +bm−1 (xk + ck−1 xk−1 + · · · + c1 x)m−1 ··· +b1 (xk + ck−1 xk−1 + · · · + c1 x) +b0 .

Comparing the terms of degree km, we notice that akm = bm . Subdividing the above equation by setting akm = bm , we may assume that both H(x) and f (x) have 1 as the coefficients of their leading terms. In the following discussions of this paper, we assume that H(x) = xkm + akm−1 xkm−1 + · · · a1 x + a0 , f (x) = xm + bm−1 xm−1 + · · · + b1 x + b0 , g(x) = xk + ck−1 xk−1 + · · · + c1 x and also that f (g(x)) =

(xk + ck−1 xk−1 + · · · + c1 x)m +bm−1 (xk + ck−1 xk−1 + · · · + c1 x)m−1 ··· +b1 (xk + ck−1 xk−1 + · · · + c1 x) +b0 .

(2)

3. RECURRENCE FORMULAS This section presents recurrence formulas that can be used in computing the coefficients ck−i and bj recursively. We first define the coefficients A[l, i], (l = 1, · · · , m; i = 0, · · · , kl − l), as follows (ck xk + ck−1 xk−1 + · · · + c1 x)l =

kl−l X

A[l, i]xkl−i ,

i=0

where ck = 1. Note that A[1, i] = A[l, 0] = A[m, i] =

ck−i , for i = 0, · · · , k − 1; clk = 1, for l = 1, · · · , m; and akm−i , for i = 1, · · · , k − 1.

Moreover, for each l = 2, · · · , m, using the relation (xk + ck−1 xk−1 + · · · + c1 x)l = (xk + ck−1 xk−1 + · · · + c1 x) · (xk + ck−1 xk−1 + · · · + c1 x)(l−1)   k(l−1)−(l−1) X = (xk + ck−1 xk−1 + · · · + c1 x) ·  A[l − 1, i]xk(l−1)−i  , i=0

we can derive the following recurrence formula: A[l, i] =

i X

ck−i+j A[l − 1, j],

j=0

for i = 0, · · · , k − 1. By induction, we can easily show that A[l, i] is determined by the coefficients ck , · · · , ck−i . Using this recurrence formula, we can derive the following equation akm−i

= A[m, i] =

i X

ck−i+j A[m − 1, j]

j=0

= ck−i A[m − 1, 0] + A[m − 1, i] +

i−1 X

ck−i+j A[m − 1, j]

j=1

= ck−i + ck−i A[m − 2, 0] + A[m − 2, i] +

i−1 X

ck−i+j A[m − 2, j] +

j=1

i−1 X

ck−i+j A[m − 1, j]

j=1 m−1 i−1 X X

= 2ck−i + A[m − 2, i] +

ck−i+j A[l, j]

l=m−2 j=1

= (m − 1)ck−i + A[1, i] +

m−1 i−1 XX

ck−i+j A[l, j]

l=1 j=1

= mck−i +

m−1 i−1 XX

ck−i+j A[l, j]

l=1 j=1

Consequently, we have ck−i =

akm−i −

Pm−1 Pi−1 l=1

j=1 ck−i+j

A[l, j]

m

,

(3)

for i = 1, 2, · · · , k − 1. Note that each term A[l, j] was determined by ck , · · · , ck−j . Thus, ck−i is completely determined by akm−i and ck , · · · , ck−i+1 . Once the values of ck−1 , · · · , c1 are determined using the above recurrence relation, each coefficient bi can be represented as a rational expression of ck−1 , · · · , c1 and b0 , · · ·, bi−1 . For this purpose, we define the coefficients B[l, i], (l = 1, · · · , m; i = l, · · · , kl), as follows kl X k k−1 l B[l, i]xi . (x + ck−1 x + · · · + c1 x) = i=l

Note that B[1, i]

=

ci , for i = 1, · · · , k − 1; and

B[l, l]

=

cl1 , for l = 1, · · · , m.

Each coefficient B[l, i] can be computed using the following equation: kl X i=l

B[l, i]xi

= (xk + ck−1 xk−1 + · · · + c1 x)l

= (xk + ck−1 xk−1 + · · · + c1 x) · (xk + ck−1 xk−1 + · · · + c1 x)(l−1)   k(l−1) X = (xk + ck−1 xk−1 + · · · + c1 x) ·  B[l − 1, i]xi  . i=l−1

A recurrence relation for B[l, i] can be formulated as follows B[l, i] =

k X

cj B[l − 1, i − j].

j=1

Since B[l − 1, i − j] = 0 for i − j < l − 1 and i − j > k(l − 1), we have min(k,i−l+1)

X

B[l, i] =

cj B[l − 1, i − j].

j=max(1,i−k(l−1))

Once all the coefficients B[l, i] are computed, we can represent the value of bl , (l = 1, · · · , m−1), as a rational expression of al , b0 , · · · , bl−1 , and B[1, l], · · · , B[l−1, l], where we assume B[p, l] = 0 if l < p or pk < l. From Equation (2), we have al = bl cl1 +

l−1 X

bp B[p, l].

p=1

Thus, in case c1 6= 0, bl has the following rational representation: bl =

al −

Pl−1

p=1 bp B[p, l] . cl1

Now, we consider the general case where g(x) = xk + ck−1 xk−1 + · · · + cs xs ; that is cs−1 = · · · = c1 = 0. Then we have asl = bl cls +

l−1 X

bp B[p, sl],

p=1

and bl =

asl −

Pl−1

p=1 bp B[p, sl] . cls

(4)

The following two algorithms summarize the procedure for computing the coefficients of f (x) and g(x). For each divisor k of n, (1 < k < n), we set m = n/k and call Algorithms 1 and 2 to construct two component polynomials g(x) and f (x), and test if H(x) = f (g(x)) holds. From the nested loops in their pseudo-codes, we can notice that Algorithm 1 is always computed in O(kn) time, whereas Algorithm 2 is computed in O(n2 ) time. This time complexity may look relatively high. However, consider that n is the degree of the polynomial H(x), which is usually smaller than 30 for all practical purposes. For a given n < 30, Algorithms 1 and 2 are called at most 5 times. Thus the whole computation can be done in real-time. Because of numerical errors involved, the coefficients of H(x) and f (g(x)) may not be exactly the same. In our implementation, we consider two coefficients the same if their

difference is less than 10−9 . The arithmetic operations are implemented in a special way so that the same coefficients are always guaranteed to fall into this small gap. Algorithm 1 Input: The composite function H(x) of degree n; Output: The function g(x) of degree k which satisfies that f (g(x)) = H(x); DecompositionG( H(x) ) begin for i := 1 to k − 1 do A[m, i] ⇐ akm−i ; end for l := 1 to m do A[l, 0] ⇐ 1; end for i := 1 to k −³1 do ´ Pm−1 Pi−1 1 ck−i ⇐ m akm−i − l=1 j=1 ck−i+j A[l, j] ; /% Equation (3) %/ for l := m − 1 downto 1 do P i−1 A[l, i] ⇐ A[l + 1, i] − j=0 ck−i+j A[l, j]; end end c0 = 0; Construct a polynomial function g(x) using ci , i = 0, 1, · · · , k; return g(x);

Algorithm 2 Input: The composite function H(x) of degree n; The function g(x) of degree k; Output: The function f (x) of degree m which satisfies that f (g(x)) = H(x); DecompositionH( H(x), g(x) ) begin /% Assume g(x) = xk + ck−1 xk−1 + · · · + cs xs %/ for i := 1 to k − 1 do B[1, i] ⇐ ci ; end for l := 2 to m do for i := 1 to klP do min(k,i−l+1) B[l, i] ⇐ j=max(1,i−k(l−1)) cj B[l − 1, i − j]; end end for l := 1 to m ³ − 1 doP ´ l−1 bl ⇐ c1l asl − b B[p, sl] ; /% Equation (4) %/ p p=1 s end b0 ⇐ a0 ; Construct a polynomial function f (x) using bl , l = 0, 1, · · · , m − 1; return f (x);

4. APPLICATIONS 4.1. Reparameterization as an Insecure Watermarking Digital watermarking is a relatively new subject of research in computer graphics. In particular, watermarking three-dimensional data has been mainly focused on polygonal meshes. Watermarking freeform spline geometry also raised much research interest; however, there has been little success so far. The same freeform geometry can be represented in different forms when we deal with B´ezier and B-spline curves and surfaces. For example, given a B-spline curve C(t), one can: • Degree raise the curve [1]; or • Refine the curve via knot insertion [1]; or • Reparametrize the curve via composition, while preserving the geometric shape of the curve. Not surprisingly, all these three techniques were once proposed as possible ways of watermarking freeform geometry represented in B-spline [5]. Unfortunately, the first two of these techniques are easy to break. A degree raised curves could easily be degree reduced [6]. A refined curve could be restored via a knot removal procedure [4]. Furthermore, in both degree raising and knot insertion, one may raise the degree of the freeform shape even further and/or apply additional knot insertions, thus attacking the watermark of the original model. Ohbuchi et al. [5] mentioned these deficiencies in the watermarking methods based on knot insertion and degree raising; and they proposed Reparameterization via composition as a possible solution to more robust watermarking alternative. In this paper, we have shown that a polynomial curve can easily be decomposed into its two composing components if such exist. Hence, a clear and immediate implication of our result is the denouncing of composition as a watermarking option. 4.2. Curve Matching via a Reduction The modern geometric CAD systems are capable of modeling highly complex scenes, with hundreds if not thousands of surfaces. Different surfaces are frequently stitched together along shared seams. In many cases, the curves along stitched surfaces share neither the same degree nor the same knot sequence. This incompatibility could produce some black holes while the two adjacent surfaces are approximated into polygons (see Figure 1(c) and 2(c)). More seriously, there could be mismatches in textures that stretch across the shared boundary curve (see Figure 1(a) and 2(a)). Given two curves C1 (r) and C2 (t) from two surfaces along a shared boundary, we consider the problem of checking whether these two curves are identical and if so find a canonical representation for the two curves. Such a canonical representation is very useful in matching the tessellation on both sides of the shared seam (see Figure 1(d) and 2(d)). Moreover, it may provide a solution to reparametrizing one of the surfaces so that the two surface faces can be texture-mapped seamlessly across their common edge (see Figure 1(b) and 2(b)). We may apply knot removal and degree reduction to both C1 (r) and C2 (t) so that one can ensure that both curves were not artificially degree raised and that every knot indeed is a source for a finite discontinuity. Then, we apply a decomposition test on both curves as proposed in this paper. The combination of degree reduction, knot removal, and decomposition provides a complete set of tests that is capable of reducing curves to their canonical form and open the way for a simple and efficient comparison between differently represented curves.

(a)

(b)

(c)

(d)

FIG. 1 (a), (c) The same boundary curve has different parameterization; and (b), (d) its canonical form is derived via decomposition.

(a)

(b)

(c)

(d)

FIG. 2 (a), (c) The same boundary curve can be parameterized differently. Two differently parameterized boundary curves are matched into one canonical form.

(a)

(b)

FIG. 3 (a) Differently parameterized boundary curve (around the neck of a duck model) results in a skewed texture map; (b) but the curve matched using a canonical form unifies the two surface patches.

5.

CONCLUSION

In this paper, we have presented an algorithm for decomposing a polynomial H(x) into two component polynomials f (x) and g(x). Using this result, we can easily test if a given polynomial/rational spline curve is a result of polynomial reparameterization. The original spline curve and the reparameterization function itself can also be constructed. We have also shown that the canonical representation of a curve greatly simplifies the procedures of: (i) detecting a watermark embedded in a curve, and (ii) checking the identity of a curve represented in different ways. The simple solution suggested in this paper may find many other interesting applications in freeform curve modeling. An important problem for future work is that of reversing the composition of two polynomials in two variables (i.e. surface reparametrization). ACKNOWLEDGMENTS All the algorithms and figures presented in this paper were implemented and generated using the IRIT solid modeling system [3] developed at the Technion, Israel. This work was supported in part by the Korean Ministry of Information and Communication (MIC) under the Program of IT Research Center on CGVR, in part by the Korean Ministry of Science and Technology (MOST) under the National Research Laboratory Project and in part by the Israeli Ministry of Science Grant No. 01–01–01509. REFERENCES [1] Cohen, E., Riesenfeld, R.F., and Elber, G. Geometric Modeling with Splines: An Introduction. A.K. Peters, Natick Massachusetts, 2001.

[2] Heal, K.M., Hansen, M., and Richard, K. Maple V Learning Guide (for Release 5), Springer-Verlag, 1997. [3] IRIT 8.0 User’s Manual, October 2000, Technion. http://www.cs.technion.ac.il/∼irit. [4] Lyche, T., and Morken, V. Knot removal for parametric B-spline curves and surfaces Computer Aided Geometric Design, Vol. 4, No. 3, pp. 217–230, 1987. [5] Ohbuchi, R., Masuda, H., and Aono, M. A Shape-preserving Data Embedding Algorithm for NURBS Curves and Surfaces. Proc. of Computer Graphics International (CGI 99), Canada, June 1999. [6] Piegl, L., and Tiller, W. Algorithm for degree reduction of B-spline curves. ComputerAided Design, Vol. 27, No. 2, pp. 101–110, 1995. [7] Spiegel, M. Mathematical Handbook of Formulas and Tables. Schaum’s Outline Series in Mathematics, McGraw-Hill, pp 4, 1968. [8] Wolfram, S. The Mathematica Book, 3rd ed. Wolfram Media/Cambridge University Press, 1996.

Suggest Documents