B-spline Curve Smoothing for Isobathymetric Line

0 downloads 0 Views 312KB Size Report
done by viewing the polygonal line or control polygon as a cable network ..... Représentations de la géométrie et des contraintes cartographiques pour la.
B-spline Curve Smoothing for Isobathymetric Line Generalization Eric Guilbert, Hui Lin Joint Laboratory for GeoInformation Science The Chinese University of Hong Kong, Shatin, NT, Hong Kong [email protected], [email protected]

Abstract This paper introduces a new method for curve smoothing which is specific for isobathymetric line generalization. Isobaths are modeled with B-spline curves that can maintain the smooth feature of the curves. Smoothing is performed by keeping the curve points always on the deepest side of the original curve so that the result is consistent with the safety constraint. It is done by using a snake model in which the constraints and the smoothness are expressed via external and internal energies defined from the curve derivatives. The advantage of the model is that the deformation is done by minimizing the system energy and, by tuning the parameters during the process, convergence towards a valid solution is ensured. Results from real case studies are presented. Keywords: cartographic generalization, B-spline curve, snake, curve smoothing.

Introduction With the emergence of more and more powerful sounding techniques and computer systems, the volume of data to be processed is becoming increasingly important (several millions of soundings). In view of this, new processing methods must be developed that can deal with such quantities of data for automatic chart construction. Indeed most of the generalization operations are still performed manually and the cartographer is no more able to deal with such huge amount of data. A maritime chart is mainly composed of soundings (depth points) and isobaths (lines joining points at the same depth). Raw data used for chart construction are issued from different sounding campaigns and all gathered in a bathymetric database from which redundant and erroneous data are swept. Nowadays, sounding is mostly performed by multi-beam echo-sounders on board of a boat. The position of each sounding is deduced from the position of the boat, given by a GPS and different motion sensors located on the boat which correct the measurement errors due to the roll, pitch or heave of the boat. When building a chart, the data corresponding to the area of interest are extracted from the database. From this data sample, the isobathymetric lines are defined as polygonal lines by interpolating and connecting all the points at a given depth [7]. In order to reduce the amount of data, the polygonal lines are compressed with B-spline curves [19].

In this paper, we focus on isobathymetric line processing. Other objects such as soundings or coastlines are not taken into account. The isobathymetric lines obtained from the database are too numerous (for example, more than two thousand curves for an A0 size chart at 1:50000 scale) and all the information can not be reported on the map. Depending on the scale of the chart, some data must be suppressed or modified in order to obtain a simplified and schematic representation as close as possible to reality while being legible and usable for navigation. This important stage in cartography is called cartographic generalization (Figure 1). The line generalization process is performed by applying operators. The different operators [18] are defined in Table 1 below. The type indicates if the operator only modifies the geometry of the object or if it modifies both the geometry and conceptual information. Operator

Action

Type

Compression

reduction of the number of points used to represent an object

Geometry

Selection/suppression

suppression of non relevant object

Object

Aggregation

merging several objects into one

Object

Classification/Typification

changing a symbol or a category to which an object belongs

Object

Smoothing

removing details such as angularities or oscillations

Geometry

Caricaturing

exaggerating some features of an object

Object

Enlargement

enlarging the size of an object

Geometry

Displacement

moving an object

Geometry

Table 1: List of different generalization operators.

Figure 1: Isobathymetric lines before (left) and after manual generalization (data issued from the chart 7413 are provided by the SHOM, the Hydrographic and Oceanographic Service of the French Navy).

During this stage, several constraints must be applied to ensure the legibility and the reliability of the final map. According to [2], three types of constraints are expressed. They are the graphical, application and structural constraints. Based on this classification, we identify: •

graphical constraint of legibility: the final chart should not include either real line intersections (i.e. transversal intersections, overlaps, tangencies) or visual line intersections (when curve segments are too close with respect to an accuracy criterion related to the working scale);



application constraint of safety: the displacement of an isobathymetric line should be made towards deeper areas to preserve the safety of navigation;



geomorphologic structural constraint: the relief must be preserved and the more characteristic elements must be emphasized.

The first two constraints are prevailing. They are strong constraints that must be absolutely satisfied in order to validate a chart. The safety constraint implies that the depth given by an isobathymetric line on a chart must never be deeper than the real depth (Figure 2). More precisely, shifting a line towards shallower depth means that the water depth indicated by the line is deeper than it actually is. This operation is not allowed as the sailor would evaluate the danger at a deeper depth than the real danger. On the opposite, shifting a line towards greater depth is allowed as it makes deep water shallower.

the isobath must be maintained sea level 3 m peak

seafloor 5 m isobath 10 m isobath

12 m pit the isobath can be removed

Figure 2: Illustration of the safety constraint. On the left: vertical cross section of the sea with a 3 m peak and a 12 m pit. The pit can be suppressed meaning that the 10 m isobath can be removed. The peak and the 5 m isobath must be maintained. On the right: the corresponding chart with the isobathymetric lines and sounds. The aim of the legibility constraint is to guarantee a legibility distance between isobathymetric lines. When this constraint is not respected, a generalization operation must be performed in order to suppress or modify curves to achieve a required distance, εvis related to the scale of the final chart.

The last cartographic constraint is that the chart should render a good representation of the relief. For that purpose, the location and the shape of the initial curves have to be maintained. This constraint is a weaker constraint than the two previous ones. Line generalization operators have already been developed for the generalization of objects like roads or rivers. In literature, line smoothing is often treated by applying both smoothing and compression operators. Smoothing consists of removing sharp angularity or attenuating curve oscillations and is employed to improve the aesthetic characteristics of a line while compression consists of reducing the number of points used to represent the curves. Here, we focus only on smoothing methods as compression methods are not always suitable for generalization [14], especially when there are large map scale changes or strong application constraints such as the safety constraint. Different techniques based on two different approaches have been used for line generalization. The first approach used was local, that is smoothing done by considering a few local points at a time, in opposition to global methods which process the whole curve at once. [16] and [15] introduce and review several local geometrical methods where smoothing is done by considering several neighboring points and computing an average position. In [14], smoothing is done by selecting a set of points of the curve according to a legibility distance. [12] presents a global geometrical method where the curvature is reduced by using optimization techniques. [6] considers the curve as a snake and smoothes it by reducing its energy defined from its derivatives. In [10] and [19], curve smoothing is done by viewing the polygonal line or control polygon as a cable network undergoing mechanical forces. The different kinds of smoothing operators can be classified as in the following table. Method

Approach

Technique

Applied to isobath smoothing

Nickerson [16]

Local

Geometry

No

McMaster [15]

Local

Geometry

No

Li [14]

Local

Geometry

No

Harrie [12]

Global

Geometry

No

Fritsch [10]

Global

Cable network

No

Saux [19]

Global

Cable network

Yes

Burghardt [6]

Global

Snake

No

Table 2: List of different techniques for line smoothing in cartographic generalization. Compared to line generalization for terrestrial or urban maps, the main issue in maritime charts is the consideration of the safety constraint. Other techniques such as filtering techniques [9, 20] have been developed mostly for compression. They are not suitable for isobath generalization as they cannot take into account the safety constraint. A main advantage of global approach over local approach is that the entire curve is taken into account and the main characteristics are better preserved. Furthermore, as it is based on the solution of a system of equations, it can be used to combine several operators or several curves. Therefore the global approach takes the environment into account and solves more complex problems such as the correction of spatial conflicts involving several curves. Among the global approaches, only cable

networks have been used for isobath smoothing in [19]. Smoothing is done there by considering the control polygon of the B-spline curve as a cable network with an internal tension applied on the legs of the control polygon and external forces applied on the control points according to the displacements to be done. A limitation of the cable network is that some control points are fixed in order to satisfy the safety constraint and that the direction and intensity of the forces on other control points are fixed, thus restricting the possible displacements. For these reasons, a snake model may be of interest as it allows a better control of the deformation: control point can be moved in any direction yielding a better control of the curve shape. The workflow of both methods is resumed as follow: Cable network

Snake

Computation of the forces balancing the system Determination of the fixed control points Determination of new forces on free control points Deformation of the control polygon: resolution of a linear system Displacement of the free control points Resulting in a new balanced network

Do Computation of the energy along the curve Computation of a deformation reducing the energy Until energy is minimal

In this paper, a method for B-spline curve smoothing based on a snake model is discussed. This method includes two steps: (i) ironing out the curve oscillations and, (ii) displacing the points in order to keep them all on the right side and satisfy the safety constraint. In the next section, the B-spline and snake models used for isobath representation are presented. Furthermore the smoothing method with constraint expression is detailed and results are given. Finally, conclusion and directions for future research work are given.

Modeling isobathymetric lines The B-spline representation Definition of a B-spline curve In this section, the main definitions and properties of B-spline curves are given. For more information, the reader is invited to consult [3]. A B-spline curve f is a parametric function defined on an interval

I = [ a, b] ⊂

in

2

. It is defined by m

f (t ) =

∑Q N i

i =0

k i (t ) .

(1)

The points Qi ∈

2

are the control points of the curve and define the control polygon of f . N ik are the B-

spline basis functions. They are piecewise polynomial functions of degree k-1 defined from I (k is called the order of the curve). To define them, we need a series of real values (t0 = a ≤ t1 ≤ … ≤ ti ≤ … ≤ tm + k = b) called the knot vector. Each function N ik is non zero only on the interval [ti , ti + k ] and its value are always included in [0,1]. As a consequence, the computation of a curve point is local as only k control points are required. Likewise, if a control point is modified, only a part of the curve is modified. Point computation on a B-spline curve is therefore relatively fast as it involves only affine (and even convex as the basis function values are always in [0,1]) combinations of a small number of points. As the coordinates of a point of the curve are given by the convex combination of k control points, another important property is that a curve is always included in the convex hull of its control points (Figure 3). This property allows us to estimate the location of a curve and to approximate the curve from its control polygon. The approximation is done with a tolerance lower than the thickness of the pen ball so that it is still relevant in regards to the computation accuracy and the safety constraint. In the following examples, the tolerance is fixed to 10-3 while the thickness of the pen ball is 0.01 cm.

Figure 3: Control polygon (dashed line) and convex hull (in gray) of a B-spline curve.

Another useful property used in this paper is that an approximation of the curve can be computed by refining the control polygon. New control points can be introduced by inserting new knots in the vector knot. Each time a new knot is inserted, the k-1 corresponding control points are replaced by k control points, giving a new control polygon whose location is closer to the curve. Therefore, by inserting new knots on each segment of the knot vector, one can quickly build up a new control point with twice the number of control points closer to the curve. By repeating this operation, a series of control polygon converging towards the curve is obtained.

Figure 4: Left: Initial curve with the initial control polygon. Right: Subdivision of a control polygon: initial polygon (dotted line) and polygons obtained after one (dashed line) and three subdivision steps (solid line).

Interest for isobath modeling The interest of B-spline curves for cartography has been shown in [19]. In the raw data, the isobaths are modeled by polygonal lines connecting points at the same depth. By this way, compression and generalization operations can be performed quickly. However, this representation has some limits. Isobaths are smooth curves and polygonal representation can not keep this smooth feature, even if the compression rate is low. Another way is to model isobaths by using B-spline curves. In Figure 5, an initial curve has been compressed as a polygonal line and as a B-spline curve. In both case, the compression rate is the same.

Figure 5: Compression of an isobathymetric line (from [19]).

As B-spline curves are parametric curves with a local control, it is possible to zoom in and still have a smooth curve. As it is expressed by a parametrical function, it is always possible to compute some new points on the curve to improve the quality or the accuracy of the curve. This is particularly relevant with the development of electronic charts where the user can perform zoom in or spanning operations on the screen (Figure 6).

Figure 6: Visualization operation on an isobath.

The snake model Snakes were first introduced by [13] in image processing for contour detection. They are smooth lines defined with their own energy from their geometrical features. A snake is at an equilibrium position when its global energy is minimal. In order to minimize its energy and reach this position, the snake can deform itself. Let u(s) be a snake of length l and s the curvilinear abscissa. Its energy is expressed as Esnake (u ) =

l

∫ [E 0

int (u ( s )) +

Eext (u ( s ))]ds

(2)

where Eint is the internal energy and Eext is the external one. The internal energy is used to maintain the shape of the snake and is defined from its derivatives: Eint =

2⎞ 2 ⎛ 1⎜ du d 2u (s) + β ( s) 2 ( s) ⎟ α (s) ⎟ 2⎜ ds ds ⎝ ⎠

(3)

where α and β are shape parameters, usually fixed by the user. α controls the tension given by the first derivative and β controls the curvature which is equal to the second derivative. In line simplification, the internal energy represents the smoothness of the curve. The external energy usually represents application constraints as it is not related to the geometry of the curve. In our case, it will be used to model the safety constraint. Its definition is given in the next section. In most of the cases, snakes are defined by polygonal lines. B-spline snakes have been used for image processing in [4] and for curve and surface approximation in [17]. The interests of B-spline snakes are that: •

less points are needed in comparison with a polygonal snake;



smoothness is an intrinsic characteristic of B-spline curves;



control points allow a better control of the snake.

The unknowns of the problem are the control points of the isobath. In order to compute the different energies, a polygonal approximation of the B-spline curve is needed. This approximation is computed by applying a subdivision scheme at each iteration.

Isobathymetric Line Smoothing The snake model was first introduced in line generalization in [5] to define a displacement operator for the correction of space conflicts. The snake represented the displacement of the curves instead of the curves themselves. The external energy is defined from the distance between the curves and expresses the distance conflicts. The internal energy is used to maintain the shape of the curve by minimizing the deformations. Another snake model for displacement has been presented in [1] where more complex conflicts are taken into account. Snakes have also been used for isobath displacement in [11] where the safety constraint and automatic parameter tuning are considered. The problem of line smoothing with snakes has been addressed in [6] however this method cannot be used for maritime charts as it does not deal with the safety constraint.

Energy Definition Expression of the internal energy B-spline curves are parametric curves. Therefore, an energy expression related to parameter t is chosen instead of the curvilinear abscissa s. This implies that the internal energy is not the same as in equation 3: the first derivatives with respect to s and t are equal but the second derivatives are different. The second derivative with respect to s is equal to the curvature κ where the relation between κ and u''(t) is given by

κ (t ) =

det(u ′(t ), u ′′(t )) u ′(t )

(4)

3

with det the determinant given by u′x (t )u′′y (t ) − u′′x (t )u′y (t ) with the subscripts x and y referring to the coordinates. If the parameterization is an approximation of the curvilinear abscissa, u ′′(t ) can also be considered as an approximation of the curvature. However, the curve parameterization is defined in a previous stage by a compression algorithm and is different from the curvilinear abscissa. Therefore, the internal energy is defined as in equation 5 and is computed by using the first derivative with respect to t and equation 4 for the curvature. Eint =

(

1 2 2 α (t ) u ′(t ) + β (t ) κ (t ) 2

)

(5)

In order to compute the global energy along the entire curve, a polygonal approximation ( P0 ,… , Pn ) is deduced by subdividing the control polygon. The subdivision scheme gives us a set of parameters

ζ j , 0 ≤ j ≤ n and a set of points Pj , 0 ≤ j ≤ n such that each point Pj is an approximation of f (ζ j ) . The first derivative is then estimated at each point by finite differences: f ′(ζ j ) =

f (ζ j +1 ) − f (ζ j −1 )

ζ j +1 − ζ j −1

(6)

The curvature at point Pj is deduced by estimating the radius of the osculating circle from Pj −1 , Pj and

Pj +1 . As the curvature does not depend on the length of the segments Pj −1 Pj and Pj Pj +1 , we introduce two points Pˆj −1 and Pˆ j +1 such that each point belongs respectively to lines Pj −1 Pj and Pj Pj +1 and that

Pˆ j −1 Pj = Pj Pˆ j +1 = l with l > 0 . The curvature radius is then defined by the radius of the circle of center

Ω passing by Pˆj −1 , Pj and Pˆ j +1 (Figure 7) and the curvature is given by equation 7:

κ (ζ j ) =

sin(ϕ j ) 1 2

Pˆ j +1 − Pˆ j −1

(7)

Figure 7: Discrete curvature definition at parameter ζ j .

Definition of the external energy Apart from the smoothness of the curve, another constraint must be taken into account which is the strong constraint of safety. On a maritime chart, the depth can never be bigger than the real one. As a consequence, when deforming a line for smoothing, the displacement must always be done towards greater depths. In the snake model, the safety constraint is expressed through the external energy. At the end of the smoothing process, the safety constraint is fulfilled if all the points are on the same side of the initial curve corresponding to greater depths. In order to prevent wrong displacements and to bring back the curve on the right side, an external energy in proportion with the distance from the curve is brought to the system

when points are on the wrong side. If the points are on the side of safety, no external energy is defined. As a result, the external energy is defined such that:

Eext (u (ζ 1j ))

⎧ (ζ 1 ) − u (ζ 1j ) ⎪u = ⎨ initial j ⎪⎩ 0

2

if u (ζ 1j ) is on the wrong side

(8)

otherwise

The energy equation is solved by using an iterative method. In [1], a time component is introduced with a dissipative energy which tends towards zero. At each step, the energy equation is solved using a finite element method where a linear system is solved for each coordinate. In this paper, a gradient method is preferred for several reasons: •

curvature is expressed as a non-quadratic function;



all the point coordinates are gathered in the same equation improving the physical behavior of the model compared to methods where an equation is solved for each coordinate.

The quality of a result after smoothing can be measured according to two criteria. First, the safety constraint simply states that if it is not respected, the solution is rejected. Second, the curve should be as smooth as possible. Two norms are used to quantify the curve smoothness. The L2 norm of κ estimates the average smoothness of the curve (equation 9). The lower the norm, the smoother the curve. A more local criterion is the maximal value of the curvature (equation 10). If the maximal value is high, it means that there are some points where the curve was not smoothed enough due to some singularity like a loop or a cusp. 1

κ

2

⎛ n −1 ⎞2 2 =⎜ κ (ζ j ) (ζ j +1 − ζ j ) ⎟ ⎜ j =0 ⎟ ⎝ ⎠



κ

max

= sup κ (ζ j ) j = 0,…, n

(9)

(10)

Parameter setting In a snake model, the final result depends on the balance of the different energies. The main point in our case is that the external energy is preponderant against the internal energy as it expresses a strong constraint which must be satisfied to validate a solution, that is, the external energy must be zero at the end of the deformation process. However, during the process, this condition can not be maintained as the snake can converge towards a position with a minimal energy which does not respect the safety constraint. In order to smooth the curve and to respect the safety constraint, a parameter γ is introduced in front of the external energy. It represents the balance between both energies. If γ is big, the external energy is preponderant, the curve will not be smoothed but the safety constraint is respected. If γ is small, the curve is smoothed but the safety is not maintained. Therefore, a solution consists of setting γ as a function in time. At the beginning, γ

is small in order to smooth the curve. During the process, if the energy becomes stable but the solution is not satisfactory, γ is increased in order to increase the weight of the external energy and bring back the curve on the right side. Parameters α and β are used to balance the stress and curvature energies. The smoothness of a curve is defined by the curvature and directly related with the value of β. The first derivative is related to the length of the curve. With a high value of α, the first derivative is small and the curve is shorter. By this way, oscillations may be removed but more angularities are created and the curvature is still important. As a consequence, the curvature energy must be preponderant compared to the stress energy. However, α cannot be set to zero as the forces generated by the external and curvature energies can be in opposition. More specifically, an extrusion is more easily smoothen by reducing both stress and curvature energy and shortening the curve than by reducing the curvature energy which may be in opposition with the safety constraint. Furthermore, as the oscillations are removed by reducing the curvature, the curve length must also be reduced so that the curve is not too loose and stays at a short distance from its original location according to the geomorphologic constraint, avoiding degenerating cases with loops or segments that are too remote. As the parameter values depend on the shape of the curves and cannot be the same in all cases, the value of

α against β can vary a lot and is not always of the same order of magnitude. From the previous considerations, a range of values for α can be deduced: the stress energy Estress should be kept lower than the curvature energy Ecurv so α can be chosen as α = β

Ecurv . Estress

Usually, a solution is reached when the global energy is lower than a given threshold. In our case, two criteria are defined to validate a solution: the external energy must be immaterial and the curvature energy must be low enough and stable. The interest is that the first criterion ensures that the safety constraint is fulfilled and the second ensures that the curve has been sufficiently smoothed.

Algorithm In this section, the whole smoothing algorithm is recapitulated. As said earlier, a gradient method is used to compute the new solution at each step. This requires to compute the energy gradients to define a direction for descent and then to compute the descent step by using the golden section method [8]. Input: f an isobathymetric line expressed as a B-spline curve Computation of a polygonal approximation of f

β=1, γ=1 Computation of the stress energy Estress and curvature energy Ecurv Computation of the α parameter

i=0

While (i

Suggest Documents