curve and surface interpolation and approximation

36
Introduction B-Spline basis functions B-Spline curves and surfaces Global interpolation Local interpolation Global approximation of curves and surfaces Approximation to within a specified accuracy Curve and surface interpolation and approximation by piecewise polynomial functions Alejandro Cosin Ayerbe June 2012 Curve and surface interpolation and approximation by piecewise polynomial

Upload: alejandrocosinayerbe

Post on 05-Dec-2014

1.346 views

Category:

Documents


0 download

DESCRIPTION

An abstract of my final project in bachelor\'s degree in Mathematics: interpolation and approximation of curves and surfaces with B-Spline basis functions

TRANSCRIPT

Page 1: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewisepolynomial functions

Alejandro Cosin Ayerbe

June 2012

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 2: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Introduction

This presentation is an abstract of my final project in bachelor’s degree in Mathematics,the goals of the project were the following:

Study and develop powerful methods of curve and surface interpolation andapproximation.

Cover the two main current approaches: global and local.

Matlab is used as the programming tool, developing methods so that the translationto C++ is straightforward.

Automate the approximation process for surfaces and curves in order to generate asolution that meets a preset maximum error.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 3: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Introduction

This presentation is an abstract of my final project in bachelor’s degree in Mathematics,the goals of the project were the following:

Study and develop powerful methods of curve and surface interpolation andapproximation.

Cover the two main current approaches: global and local.

Matlab is used as the programming tool, developing methods so that the translationto C++ is straightforward.

Automate the approximation process for surfaces and curves in order to generate asolution that meets a preset maximum error.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 4: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Introduction

This presentation is an abstract of my final project in bachelor’s degree in Mathematics,the goals of the project were the following:

Study and develop powerful methods of curve and surface interpolation andapproximation.

Cover the two main current approaches: global and local.

Matlab is used as the programming tool, developing methods so that the translationto C++ is straightforward.

Automate the approximation process for surfaces and curves in order to generate asolution that meets a preset maximum error.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 5: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Introduction

This presentation is an abstract of my final project in bachelor’s degree in Mathematics,the goals of the project were the following:

Study and develop powerful methods of curve and surface interpolation andapproximation.

Cover the two main current approaches: global and local.

Matlab is used as the programming tool, developing methods so that the translationto C++ is straightforward.

Automate the approximation process for surfaces and curves in order to generate asolution that meets a preset maximum error.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 6: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

B-Spline basis functions

B-Spline basis functions can be used to build curves and surfaces, they are highlyversatile and have important mathematical properties.

Given the knot vector U = {0, 0, 0, 1, 2, 3, 3, 4, 4, 5, 5, 5}, the B-Spline functions of degree0, 1 and 2 are as follows:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 7: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 8: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

B-Spline curves and surfaces

B-Spline curves and surfaces they are linear combination of B-Spline basis functions, sothey have also good properties:

Strong convex hull:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 9: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Local modification scheme:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 10: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Coincident control points:

A well known example of such curves and surfaces are the NURBS (Non-UniformRational B-Splines). In this case, the curves and surfaces generated will be Non-UniformNon-Rational B-Splines, very similar.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 11: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Global interpolation

Once functions to obtain the values of the B-Spline basis functions have beenprogrammed, interpolation conditions can be imposed to obtain the control points thatdefine a curve or surface.

If the degree is given and the knot and parameter vectors are estimated, a globalapproach to the problem results in a linear system, easy to solve: given the set of pointsQ=[[1,1]’,[3,3]’, [6,0]’,[8,2]’,[11,5]’], a second degree B-Spline curveinterpolating these points is shown below:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 12: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

It is possible to add derivative constraints to the interpolation problem, and interpolatethe derivative vector at the beginning and the end of the curve: given a degree, 2, the setof points Q=[[1,1]’,[3,3]’,[6,0]’,[8,2]’,[11,5]’], and the vectorsD=[[-3,-1]’,[0,3]’] and D=[[6,-4]’,[-3,4]’], the B-Spline curves interpolatingthis data are shown below:

Derivative constraints can be added to all the points of the curve.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 13: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

The process of interpolating a set of points arranged in grid using global techniques ismuch easier than it looks. If the degree (p, q) of the surface is given, and knot vectors Uand V and parameter vectors are estimated, the interpolating surface can be obtainedthrough a small number of curve interpolations, because B-Spline sufaces are tensorproduct surfaces. This avoids to solve large linear systems.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 14: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 15: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Example: given the set of points

Q=[[4,0,1]’,[3,0,1]’,[2,0,1]’,[1,0,1]’,[0,0,1]’,[4,1,1]’,[3,1,1]’,...

[2,1,1]’,[1,1,1]’,[0,1,1]’,[4,2,1]’,[3,2,1]’,[2,2,2]’,[1,2,1]’,...

[0,2,1]’,[4,3,1]’,[3,3,1]’,[2,3,1]’,[1,3,1]’,[0,3,1]’,[4,4,1]’,...

[3,4,1]’,[2,4,1]’,[1,4,1]’,[0,4,1]’];

the B-Spline interpolating surface of degree (2, 2) for this set is shown below:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 16: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Local interpolation

A local interpolation scheme consists in generating segments of curve or surface wich joinwith a pre established level of continuity, given by the method of interpolation used.

In the case of curves, each segment is known as Bezier segment, and in the case ofsurfaces, each segment is known as Bezier patch.

There is a local interpolation method, due to Renner, which performs local interpolationof a set of points, generating a cubic B-Spline curve.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 17: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Local interpolation example for curves: given the set of pointsQ=[[1,2]’,[2,4]’,[3,1]’,[5,3]’,[6,1]’,[7,4]’], the cubic interpolating curve isshown below (in blue):

Note that each control point is in the (estimated) tangent of each point to beinterpolated.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 18: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

For the case of surfaces, given a set of points arranged in grid, bicubic (degree (3, 3))Bezier patches are build. The construction of each Bezier patch is the key of thisinterpolation method. The inner control points of each patch are obtained with the helpof estimates of mixed partial derivatives.The next image shows a scheme of the simplest case of local interpolation, when thereare only four points in the grid (in the corners). The outer control points are obtainedwith the local interpolation method for curves seen before, and the inner ones withestimates of mixed partial derivatives (control points are denoted Pi,j ):

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 19: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Once the control points of each Bezier patch are obtained, the control points of theinterpolating surface are obtained by eliminating Bezier points along inner rows andcolumns. An example is shown below (with control points in blue, and interpolatedpoints in red), for the set of points:

Q=[[2,0,2]’,[1,0,2]’,[0,0,3]’,[2,1,2]’,[1,1,2]’,[0,1,3]’,[2,2,1]’,

[1,2,1]’,[0,2,2]’,[2,3,1]’,[1,3,1]’,[0,3,2]’]

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 20: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Global approximation of curves and surfaces

The approximation of a set of points with a curve can be achieved in various ways. Oneof them is the least squares approximation scheme, a global scheme in which theresulting curve minimizes the error in the least squares sense, i.e., the sum of the squareddistances between each point and the resulting curve is minimum with respect to theunknowns (the control points in this case).

For being a global scheme, the degree of the curve must be given, as well as the knot andparameter vectors.

Given a set of m + 1 points, the curve can be build with up to m control points, becausethe case of m + 1 control points is the interpolation case. The endpoints of the curve areinterpolated, while the inner points are approximated in the least squares sense.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 21: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Example: given the set of points:

Q=[[0,0]’,[3,1]’,[2,4]’,[-1,5]’,[-1,6]’,[2,7]’,[5,10]’,...

[-3,12]’,[0,14]’,[3,16]’,[-5,17]’,[2,19]’];

the next figure shows two cubic curves (in blue) approximating these points, with six andnine control points respectively (the more control points, the better the approximation):

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 22: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

For the case of surfaces, the approximation process is analogous to the interpolationprocess: using the preceding method for curves, only a few approximations are requiredto obtain the least squares surface. The next two figures show this process:

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 23: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 24: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

The resulting approximation, and an interpolation of the same set of points are shownbelow (control points in blue color, initial set of point in red):

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 25: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Approximation to within a specified accuracy

The preceding techniques of curve and surface approximation can be used in iterativemethods of approximating data to within some specified error bound.

Iterative methods proceed in two ways: adding control points (starting with only a few ofthem), or removing control points (starting with many or enough control points).

Given a set of points to be approximated, the degree and an error bound E , a techniquebased in adding control points proceeds as follows:

1 Start with the minimum number of control points.

2 Using a global method, approximate a curve (or surface) to the data.

3 Check the deviation of the curve (or surface) from the data.

4 If the deviation is greater than E at any point, return to step 2, else end the process.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 26: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Approximation to within a specified accuracy

The preceding techniques of curve and surface approximation can be used in iterativemethods of approximating data to within some specified error bound.

Iterative methods proceed in two ways: adding control points (starting with only a few ofthem), or removing control points (starting with many or enough control points).

Given a set of points to be approximated, the degree and an error bound E , a techniquebased in adding control points proceeds as follows:

1 Start with the minimum number of control points.

2 Using a global method, approximate a curve (or surface) to the data.

3 Check the deviation of the curve (or surface) from the data.

4 If the deviation is greater than E at any point, return to step 2, else end the process.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 27: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Approximation to within a specified accuracy

The preceding techniques of curve and surface approximation can be used in iterativemethods of approximating data to within some specified error bound.

Iterative methods proceed in two ways: adding control points (starting with only a few ofthem), or removing control points (starting with many or enough control points).

Given a set of points to be approximated, the degree and an error bound E , a techniquebased in adding control points proceeds as follows:

1 Start with the minimum number of control points.

2 Using a global method, approximate a curve (or surface) to the data.

3 Check the deviation of the curve (or surface) from the data.

4 If the deviation is greater than E at any point, return to step 2, else end the process.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 28: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Approximation to within a specified accuracy

The preceding techniques of curve and surface approximation can be used in iterativemethods of approximating data to within some specified error bound.

Iterative methods proceed in two ways: adding control points (starting with only a few ofthem), or removing control points (starting with many or enough control points).

Given a set of points to be approximated, the degree and an error bound E , a techniquebased in adding control points proceeds as follows:

1 Start with the minimum number of control points.

2 Using a global method, approximate a curve (or surface) to the data.

3 Check the deviation of the curve (or surface) from the data.

4 If the deviation is greater than E at any point, return to step 2, else end the process.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 29: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

To check the error after each approximation, is necessary to obtain the closest point of acurve or surface to a given point. This is an inverse function problem, which can besolved through the Newton method or similar. The following image shows examples forcurves and surfaces.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 30: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 31: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

The following is a curve approximation example with an error bound E = 0.45. Initiallythe the number of control points is three (the degree plus two). Each curve generatedpasses closer to the points to be approximated.

E = 0.45;

Q=[[0,0]’,[3,1]’,[2,4]’,[-1,5]’,[-1,6]’,[2,7]’,[5,10]’,...

[-3,12]’,[0,14]’,[3,16]’,[-5,17]’,[2,19]’];

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 32: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

For the case of surfaces, the iterative process benefits from the tensor product surfaceproperties: when checking the error, the isoparametric curves with more error areconsidered and approximated separatedly until an error bound less than E is achieved.This way, new knot vectors (and thus control points) are generated for the next iteration.

An example is shown in the next two slides, where the error bound is E = 0.6.

The first figure in green color is the set of points to be approximated, and aninterpolation of that set is seen in the right. The next figures correspond to the iterativeprocess of approximation on the left, and the error in each point of the grid in the right.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 33: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 34: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 35: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

Bibliography

H. Akima.

A new method of interpolation and smooth curve fitting based on local procedures.

Jour. ACM, 17:589–602, 1970.

W. Boehm, W. Farin, and J. KahMann.

A survey of cuve and surface methods in cagd.

Computer Aided Geometric Design, 1:1–60, 1984.

M. G. Cox.

The numerical evaluation of b-splines.

Journal of the Institute of Mathematics and its Applications, 10:134–149, 1972.

C. de Boor.

On calculating with b-splines.

The Journal of Approximation Theory, 6:50–62, 1972.

Carl de Boor.

A practical Guide to Splines.

Springer-Verlag, first edition, 1978.

Curve and surface interpolation and approximation by piecewise polynomial functions

Page 36: Curve and surface interpolation and approximation

IntroductionB-Spline basis functions

B-Spline curves and surfacesGlobal interpolationLocal interpolation

Global approximation of curves and surfacesApproximation to within a specified accuracy

G. Farin, J. Hoschek, and M. S. Kim.

Handbook of Computer Aided Geometric Design.

Elsevier, first edition, 2002.

H. Prautzsch, W. Boehm, and M. Paluszny.

Bezier and B-Spline Techniques.

Springer, first edition, 2002.

L. Piegl.

Interactive data interpolation by rational bezier curves.

IEEE Computer Graphics and Applications, 7:45–58, 1987.

Les Piegl and Wayne Tiller.

The NURBS Book.

Springer, second edition, 1997.

G. Renner.

A method of shape description for mechanical engineering practice.

Computers in Industry, 3:137–142, 1982.

Curve and surface interpolation and approximation by piecewise polynomial functions