Sunteți pe pagina 1din 4

2010 International Symposium on Intelligence Information Processing and Trusted Computing

Tension Spline Fitting with Bezier Curve

Xincheng Guo1, Chen Huang1, Peng Wang 1


1
College of Geology Engineering and Geomatics,
Chang’an University,
Xi’an, China;

Abstract— In geographical information system, geographical redundancy. When geographical curves show large
curves expressed by curve will become a trend. In this paper, deflection, higher Bezier cubic accepted by graphic system
based on the study of features of the tension spline and Bezier could not adjust the shape of curves and meet the need of
curve, it is proposed for geographical curve a new method and geographical curves, especially in complex statistical
corresponding computing formula. In the method, we first fit evaluation (e.g. area, length), it is lead to be trouble in
the geographical curve by the tension spline, and the tension calculation and cannot be adapted to spatial analysis of
spline is divided by characteristic points, which finally is fitted geodatas.
by cubic Bezier curve piece by piece to a complete Bezier With the extensive application of geographic information
curve. Experiments show the different between fitted cubic
data and standardization development of graphic system, it is
Bezier curve and tension spline is small. The geographical
an inevitable trend that geographic curves express by curves.
curves expressed by the method express effectively the
geographical features, especially large deflection geographical It increasingly becomes the issues of concern that how to
curves, and are convenient for editing and meet the needs of express geographical curves better and can meet the
standardized metafile.
requirements of graphics system. In this paper, aimed at the
problem that geographic curves can be expressed by curves
Keywords: Geographical curves,Tension Spline,Bezier curves, better, combined the features of tension spline and Bezier
fitting curves, it is put forward that firstly tension spline fit
geographic curves, and then Cubic Bezier curves fit the
tension spline. We try to make the final fitted curves express
I. INTRODUCTION
the features of geographic curves and meet the requirements
In map and spatial data, there are various types of of graphics system.
geographical curves, such as boundaries, roads, contours,
hydrographic nets and so on, most of which show the II. TENSION SPLINE AND CUBIC BEZIER CURVE
features of graph in large deflection and continuous turns.
From the development initial period to the computer of A. Tension Spline
today, in geographical information system, geographical
curves has not been expressed by a standardized curves, Tension spline function is one of the functions used to
most of the expression is in the way of lines. The concrete describe the spline curve(shown in fig.1).The main feature of
measures of which fist make theoretical curve (e.g., the which is that bringing the tension coefficient σ into the
tension spline, parabola) fit geographical curves, and then common triple-tense spline function. When σ→0, the tension
linearize the fitting curves to express geographical curves. In spline function is equal to triple-tense spline functions; When
this category there are many approaches in first fitting σ→ ∞,the tense spline function retrograde to subsection
geographical curves: The spline under tension was linear functions, that is to say ,the adjacent nodes is linked
introduced in an attempt to imitate cubic splines but avoid using straight lines. We can choose appropriate tension
the spurious critical points they induce [1]. Based On the coefficient σ to change the degree of tightness of the curves,
absorption of the advantages of virtue oblique parabola and so that the trend of the curves is more rational and artistic.
the tension spline, the Tangent Erased Cape Method was
proposed [2]. A method of curve fitting with Bezier cubics Pn
has been applied to many digital images with good results
P1 Pn-1
[3]. The optimization of five spot smoothing and cubic spline
Hermite could meet the different demand in comprehensive P2
P3
mapping [5].
In general, the above approaches meet the need of
geographical curves, but these fitting curves do not meet the
demand of standardized graphic system, and are not accepted Figure 1. Tense spline curve
by standardized graphic system. With the development of the
computer technology, the graphic data in GIS will tend to be As shown in fig.1, Tension spline is made up of a series
standard increasingly.Fitting curves with lines have of feature points P1 ( x1 , y1 ), P1 ( x2 , y2 )," Pn( xn , yn ) , its parameter
shortcomings in concerning scales, editing, and heavy function is [10] :

978-0-7695-4196-9/10 $26.00 © 2010 IEEE 21


DOI 10.1109/IPTC.2010.117
⎧ 1 There are several properties of that are important for
⎪x(t) = σ 2 sh(σ h ) [ x ''(ti )sh(σ (ti−1 − t)) + x ''(ti+1 )sh(σ (t − ti ))]
⎪ i fitting geographical curves; these are [12]:
⎪ ⎡ x ''(ti ) ⎤ ti+1 − t ⎡ x ''(ti+1 ) ⎤ t − ti
⎪+ ⎢ xi − 2 ⎥ + ⎢xi+1 − 1) Endpoint interpolation
⎪ ⎣ σ ⎦ hi ⎣ σ 2 ⎥⎦ hi
⎨ When t=0,
⎪ y(t ) = 1

[ y ''(ti )sh(σ (ti−1 − t)) + y ''(ti+1)sh(σ (t − ti ))]
σ 2 sh(σ hi )
⎪ C (0) = P0
⎪ ⎡ y ''(ti ) ⎤ ti+1 − t ⎡ y ''(ti+1 ) ⎤ t − ti
⎪+ ⎢ yi − σ 2 ⎥ h + ⎢ yi+1 − σ 2 ⎥ h
⎩ ⎣ ⎦ i ⎣ ⎦ i
(1)
When t=1
Where the vector t is cumulative chord length, and
hi=ti+1-ti. C (1) = P1 (4)
According to the smooth and consecutive in sections of
tension spline , we can calculate the second derivative This shows that the start and end points of cubic Bezier
x′′, y′′ of each end point [10]. curves coincide with the start and end points of
We can get the tension spline function though parameter corresponding characteristic polygons.
equation and the curve shape is determined. The curve can When t=0,
satisfy the requirement of drawing the large deflection and
multi-valued function curves. The tense spline has two C '(0) = 3(q0 − P0 ) ; C ''(0) = 6(q1 − 2q0 + P0 ) (5)
characteristics: The one is that the curves can adapt to the
requirement of drawing the large deflection and multi-valued When t=1,
function curves; the other is that it can adjust the curvature of
geographic curve with the tension coefficient [10]. These (6)
C '(1) = 3( P1 − q1 ) ; C ''(1) = 6( P1 − 2q1 + q0 )
features make it can express the geographical curves and
catch our attentions. But the tension spline change with the
coordinates and the large calculation of graphical transform, 2) Linear Precision
which limit the tension spline to be used as a graphic If the characteristic polygons of cubic Bezier curve is
primitive. plane figure, the number of the intersection of the any
straight lines in the plane and C (t ) is less than the points of
B. Cubic Bezier Curves these straight lines with its characteristic polygons. The
It is given that the vector location of four points in space, significance of the linear precision is that it is good to the
as shown in fig.2. Among them, P0 and P1 are the endpoints curve calculation processing.
of the curve. q0 and q1are the control points of the curve. So The properties of cubic Bezier curve also include
the interpolation formula of each point’s coordinates in cubic symmetry, pseudo-local control, and geometric invariance.
Bezier curves is: The properties of cubic Bezier curve determines the
geometric properties of the curve don’t change with a certain
c (t ) = (1 − t ) 3 P0 + 3t (1 − t ) 2 q0 + 3t 2 (1 − t ) q1 + t 3 P1 , 0 ≤ t ≤ 1 (2) coordinate. The shape and position of the Bezier curve are
related to the characteristic polygonal vertices, which is not
relay on the selection of the coordinate system. These
q0 advantages make it as a standard meta-description of curves
q1 for a variety of graphics systems, and are easier to spatial
analysis, and processing. However, when the deflection of
the generated curves is too large, cubic Bezier curve cannot
adjust the shape of the curve by its parameter function.
III. BEZIER CURVE FIT TENSION SPLINE
P1 Considering the features of Bezier curves and tension
P0
spline curve, firstly, tension spline curve fit with a set feature
points of geographic curve, we can get an ideal curve despite
Figure 2. Cubic Bezier curves the size of deflection. Secondly, Tension spline segments
between every feature points need to be divided into
Expressed in matrix is: segments again. These segments are fitted by Bezier curves.
At last, they are connected into a whole Bezier curve.
⎡ −1 3 −3 1 ⎤ ⎡ P0 ⎤ A. Tension spline curve segment is divided.
⎢ 3 −6 3 0 ⎥⎥ ⎢⎢ q0 ⎥⎥ Firstly, the tension spline is divided into some segments
C (t ) = ⎡⎣t 3 t 2 t 1⎤⎦ ⎢ = TM z P (3)
⎢ −3 3 0 0 ⎥ ⎢ q1 ⎥ and the intervals are the feature points in curves. The
⎢ ⎥⎢ ⎥ simplest method which is used to find out feature points is to
⎣1 0 0 0 ⎦ ⎣ P1 ⎦
obtain stagnation points and the inflection points.

22
Stagnation points and inflection points are obtained by According to the endpoint interpolation of Bezier curve,
equation according to the formula 1as follows: we can get the following equation:

⎧ x' (t ) = 0 ⎧ x' ' (t ) = 0 ⎧ P 'n −1 (1) = P 'n (0)


⎨ ⎨ ⎨
⎩ P ''n −1 (1) = P ''n (0)
⎩ y ' (t ) = 0 ⎩ y ' ' (t ) = 0 (7)
(8)

We solve the equation and represent in coordinate form


x (t),y(t) obtained by equation are stagnation points and
(because the x and y are same, we represent the equation in
the inflection points.
the form of x), and the matrix is shown in following:
B. Cubic Bezier curve fit tension spline segment
According to the intervals x(t),y(t) , we can divide a
tension spline segment into several short sections and fit one ⎡1 ⎤ ⎡ a ⎤
of sections PP ⎢ ⎥ ⎡ x01 ⎤ ⎢ 2 x ⎥
i i +1 by cubic Bezier curve, as shown in fig.3. 1 1
⎢ ⎥⎢ x ⎥ ⎢ 1 ⎥
In order to coincide with the requirements of parameter ⎢ 1 −2 2 −1 ⎥ ⎢ 02 ⎥ ⎢ 0 ⎥
functions of Bezier Curves, the four points Pij,Q1,Q2,Pij+1are ⎢ ⎥ ⎢ x11 ⎥ ⎢ ⎥
⎢ 1 1 ⎥ ⎢ x ⎥ ⎢ 2 x2 ⎥
represented by P0,P1,P2,P3 Among them , P0,P3 are the ⎢ 1 −2 2 −1 ⎥ ⎢ 12 ⎥ ⎢ 0 ⎥
intervals of tension spline, P1,P2 are control points. ⎢ ⎥ ⎢ x21 ⎥ ⎢ ⎥
⎢ 1 1 ⎥⎢ ⎥ = ⎢ 2 x3 ⎥ (9)
P0′, P0′′, P3′, P3′′ are known values. According to endpoint ⎢ 1 −2 2 −1 ⎥ ⎢ x22 ⎥ ⎢ 0 ⎥
⎢ ⎥⎢ x ⎥ ⎢ ⎥
interpolation of Bezier curves, we can get the coordinates of ⎢" " " " " " " " " " " ⎥ ⎢ 31 ⎥ ⎢ # ⎥
the control points P1, P2. ⎢ ⎢
⎥ # ⎥ ⎢ ⎥
⎢ 1 1 ⎥ ⎢ x ⎥ ⎢ 2 xn−1 ⎥
⎢ ⎥
1 −2 2 −1 ⎢ ⎢ n −1、1 ⎥ ⎢ 0 ⎥
Pij+1 ⎢ ⎥ ⎣ xn−1、2 ⎥⎦ ⎢ ⎥
⎣⎢ 1 ⎦⎥ ⎣⎢ b ⎥⎦
Pij
The matrix (9) can be expressed as:

Q2 Mq = L
Q1
About x to be listed:
Figure 3. Bezier curve fitting
Mx = Lx ;
When P1 ( x1 , y1 ) and P2 ( x2 , y2 ) are got. We can fit the Pij Pij +1
using cubic Bezier curve. Similarly,we can obtain the two About y to be listed:
control points on every segment of tension spline, and then
fit every segment using Bezier curve. Because the second My = Ly .
derivatives of the curve on the connection points are equal,
the Bezier curve that be connected is smooth. Analysis to the a,b are the first derivatives of start and end points, and
curve, we can get the conclusion : The curve has the they are the known values, the coordinates of the control
continuity of C2. points can be gotten by cashed method. We can fit the cubic
Supposed there are n section points on tension spline Bezier curve by all the coordinates of the control points
segment Pij Pij+1 , and it is divided into n-1 segments. As shown solved.
in fig.4: We can connect the cubic Bezier curve segments to form
a whole cubic Bezier curve, the shape of which is controlled
P0 ( x 0,y 0) by tense spline, so that it can satisfy the requirements of the
(P i ) Pn ( x n,y n) large interference curves, and not relay on the selection of
( P i+1) the coordinate system, it is good for the curve editor.
IV. COMPUTATION AND ANALYSIS FOR AN EXAMPLE
With n points of a contour line, we can generate a tension
q1
spline, and divide it into (n-1) parts. Taking a random part li
q2 qn for example, first we divide it into three parts averagely, as
q3 q n-1 shown in Fig 4.Next we can get the responding first and
Figure 4. Fitting the tense spline segments second derivative from formula (1). Putting points Pi,Pi+1
and points Ki+2,Ki+3 into formula (9) can get the control
points corresponding to line li1,and then the fitting cubic

23
Bezier curve Bil can be obtained. By this mean, fit line li2、li3 [4] Zhang Shi-qiang, “An Algorithm for Spline Interpolation Curve with
with cubic Bezier curve, connect each part to form a cubic the Shortest Perpendicular Distance”. Surveying and Mapping
Science, Vol. 3, 1997,pp.33-37.
Bezier curve. In this way we can get a whole Cubic Bezier
[5] Zhao Bo-tan,Jun Zhong, “A Research on Linear Elements Smoothing
curve fitting a tension spline. The other n-2 lines can be in the MapInfo System”. Bulletin of Surveying and Mapping,Vol.3,
fitted by the way. With different tension coefficients σ, we 2005,pp.25-27.
compare tension spline with cubic Bezier curve when length [6] Hu De-peng,Huang Xiao-ping,Ren Nian-hai, “Based on irregular
of li1 is 20cm , following shown in Table 1: triangulation (TIN) of isoline tracking algorithm and smooth contour
of the algorithm”. The Computer Science and Technology, Vol.3,
2006, pp.46-48.
[7] Tang Xi-rong,Wang Jia-ye,Peng Qun-sheng,Wang guo-
zhao,”Computer graphics tutorial”, Science press, Beijing . 2001.
[8] Wang Zhong,Liu Hao-wu,Chai He-jun, “Automatic generation of
contours in raster graphics ” . Journal of Hydraulic Engineering
.Vol.4, 2001, pp.53-56.
Figure 5. The fitting of contours [9] Sun Gui-ru etc, “Investigation on the Algorithm of making and filling
isoclines”. Journal of Tianjin University, Vol.33, 2000, pp. 816-818.
[10] Liu Yue,Liang Qi-zhang, “Special Mapping Automation”. Surveying
TABLE I. THE COMPARISON OF TENSION SPLINE AND CUBIC BEZIER and Mapping press, Beijing. 1981.
CURVE [11] Jame R.Juncaitis and John L.Jumkins: Mathematical Techniques for
Tension Automated Cartography,AD-758300,1973.
htention hBezier Δh (cm) Δh /L
coefficients (cm) (cm) [12] Farin G., “ Curves and Surfaces Computer Aided Geometric
σ =0.1 0.495 0.503 -0.008 -0.0002 Design”. Computer Science and Scientific Computation, Academic
σ =0.2 0.998 1.009 -0.011 -0.0006 Press, Inc., New York, NY.1993.
σ =0.3 1.497 1.512 -0.015 -0.0005
σ =0.4 2.001 2.015 -0.014 -0.0003
σ =0.5 0.097 0.101 -0.004 -0.0004
σ =0.6 0.347 0.351 -0.004 -0.0006

According to the data in Table 1, we can get that the


tension spline and Bezier curve have little difference in
computation results; the relative difference value is smaller
than 1/1000.It is evident that the method has high order
accuracy and is in accordance with all kinds of computation
standards. Two curves overlapped each other basically after
fitting.
V. CONCLUSIONS
The experiment above mentioned has shown that it is an
efficient method to fit geographical curves by combining
tension spline and Bezier curve. It makes advantages of
tension spline and Bezier curve, and solves the problem that
expresses geographical curves by curves in theory and
technology. The deduced formulas are rigorous theoretically.
The experiment results show that the principles of dividing
into tension splines are feasible; the Bezier curves,divided
and fitting ,have little difference with the tension splines, and
two curves have perfect conformity. This method not only
expresses the feature of the geographical curves
aesthetically, but is prone to editable and accepted by
standardized graphic systems.
REFERENCE
[1] A. K. Cline, “Scalar- and planar-valued curve fitting using splines
under tension”, Communications of the ACM, v.17 ,1974, pp.218-
220.
[2] WANG Yan-liang, WANG Ming-shuang, “The Method of the New-
type Line Smoothing——the Tangent Erased Cape Method”. Bulletin of
Surveying and Mapping, Vol.3, 2005,pp.52-54.
[3] Lejun Shao and Hao Zhou, “Curve Fitting with Bezier Cubic”.
Graphical Models and Image Processing. Vol. 58, 1996, pp. 223–232,

24

S-ar putea să vă placă și