Fig. 5.11. Corner-lopping when angles of the input PSLG are less than 60◦. Illus-
tration from Shewchuk [2].
6
Least Squares Approximation of Scattered
Data
S10(∆) = f ∈ C0(Ω) : f |ti ∈ Π1, i = 1, . . . , |T | , (6.1)
(N1(x, y), N2(x, y), . . . , Nn(x, y)) , (6.2)
Ni(vj) = δij , j = 1, . . . , n,
Ni (x, y)
Ωi
vi
Fig. 6.1. A basis function Ni(x, y) for the function space S10(∆) and its (compact)
support Ωi.
n (6.3)
(6.4)
f (x, y) = ciNi(x, y),
i=1
∇g = ∂g , ∂g .
∂x ∂y
n= − ∂g , − ∂g , 1 .
∂x ∂y
48 6 Least Squares Approximation of Scattered Data
n' b
g
c
v1
v2
a
Fig. 6.2. Triangle patch and normal vector.
n = v1 × v2 = (−ηaca − ηbcb − ηccc, −µaca − µbcb − µccc, 2A) (6.5)
ηa = (yb − yc) , ηb = (yc − ya) , ηc = (ya − yb) ,
µa = (xc − xb) , µb = (xa − xc) , µc = (xb − xa) ,
A = 1 ((xb − xa) (yc − ya) − (yb − ya) (xc − xa)) . (6.6)
2 (6.7)
(6.8)
∇g = (ηaca + ηbcb + ηccc, µaca + µbcb + µccc)/2A.
∇g = 1 nn .
2A
ηici, µici
i=1 i=1
6.1 Approximation over Triangulations of Subsets of Data 49
6.1 Approximation over Triangulations of Subsets of
Data
Fig. 6.3. Triangulation generated from a subset of a given data set.
V = {vk = (xk, yk)}nk=1 . (6.9)
f (xk, yk) ≈ zk, k = 1, . . . , m. (6.10)
(6.11)
m (6.12)
I(c) = (f (xk, yk) − zk)2 .
k=1
2
mn
I(c) = cj Nj (xk, yk) − zk = Bc − z 2 .
2
k=1 j=1
N1(x1, y1) N2(x1, y1) · · · Nn(x1, y1)
N2(x2, y2) · · ·
B = N1(x2, y2) Nn(x2, y2) ,
... ... . . . ...
N1(xm, ym) N2(xm, ym) · · · Nn(xm, ym)
||u||2 = u21 + · · · + um2 1/2 .
50 6 Least Squares Approximation of Scattered Data
mn
∂I = = 0, i = 1, . . . , n
∂ci 2 cjNj(xk, yk) − zk Ni(xk, yk)
k=1 j=1
nm m
Ni(xk, yk)Nj (xk, yk)cj = Ni(xk, yk)zk, i = 1, . . . , n.
j=1 k=1 k=1
BT B c = BT z, (6.13)
m
BT B ij = Ni(xk, yk)Nj (xk, yk)
k=1
m
BT z i = Ni(xk, yk)zk.
k=1
Fig. 6.4. Least squares approximation to 4500 scattered data points sampled from
Franke’s test function. The triangulation has approximately 500 nodes. Triangles
are Gouraud-shaded.
f (x, y) = 34 e + 34 e +−
(9x−2)2 +(9y−2)2 − (9x+1)2 − 9y+1
4 49 10
21 e− (9x−7)2 +(9y−3)2 − 1 e−(9x−4)2−(9y−7)2 . (6.14)
4 5
6.2 Existence and Uniqueness 51
6.2 Existence and Uniqueness
1 0 ··· 0
B= B1 = N1 0 yn+1) 1 ··· Nn 0 ) .
B2 N1 ... yn+2) ... ... Nn ... )
0 0 ··· 1
···
(xn+1, N2 (xn+1, yn+1 ) ··· (xn+1,yn+1
(xn+2, N2 (xn+2, yn+2 ) ... (xn+2,yn+2
... ... ...
N1(xm,ym) N2(xm,ym) · · · Nn(xm,ym)
(6.15)
52 6 Least Squares Approximation of Scattered Data (6.16)
6.3 Sparsity and Symmetry
m
BT B ij = Ni(xk, yk)Nj (xk, yk),
k=1
vj
vi
Ωi Ωi I Ω j Ωj
Fig. 6.5. A possible non-zero off-diagonal element in the system matrix (BT B)ij
corresponds to an edge between the vertices vi and vj in the triangulation. It is
non-zero if one or more data points fall strictly inside Ωi ∩ Ωj .
Fig. 6.6. Sparsity pattern of a 500 × 500 system matrix BT B for the least squares
problem.
6.4 Penalized Least Squares 53
6.4 Penalized Least Squares
Fig. 6.7. Least squares approximation to 4500 scattered data points sampled from
Franke’s test function. Random noise was added to the z-values of the data points
when generating the surface on the right.
J (c) = cT Ec, (6.17)
mm
I(c) = (f (xk, yk) − zk)2 + λJ (c) = (f (xk, yk) − zk)2 + λcT Ec
k=1 k=1
= Bc − z 2 + λcT Ec
2
BT B + λE c = BT z, (6.18)
λd = BT B F / E F . (6.19)
54 6 Least Squares Approximation of Scattered Data
6.5 Smoothing Terms for Penalized Least Squares
|∇g|2 = ∂g 2 ∂g 2
∂x ∂y
+ (6.20)
(6.21)
and the thin-plate energy
∂2g 2 ∂2g 2 ∂2g 2
∂x2 ∂x∂y ∂y2
+2 +
Membrane energy functional.
∇gk = ∂gk , ∂gk = 1 nn .
∂x ∂y 2Ak
ηikci, µikci
i=1 i=1
|T | |T | ∂gk 2 ∂gk 2
∂x ∂y
J1(c) = Ak |∇gk|2 = Ak +
k=1 k=1
= |T | 1 n 2 n 2
k=1 4Ak
ηik ci + µik ci
i=1 i=1
|T | n n n n
k=1 1
= 4Ak ηik ci ηjkcj + µik ci µjkcj
i=1 j=1 i=1 j=1
n n |T |
= ηikηjk + µikµkj /4Ak cicj = cT Ec,
i=1 i=j k=1
where |T |
Eij = (ηikηjk + µki µkj )/4Ak.
k=1
The Umbrella-operator.
Mkf = 1 cl − ck.
nk
l∈∂Ωk
−1, l = k
n ρlk 1
= nk , if (vk, vl) is an edge in ∆ (6.22)
Mkf = ρlkcl, otherwise.
0
l=1
6.5 Smoothing Terms for Penalized Least Squares 55
L L
L L
ck
L
cl
Fig. 6.8. The umbrella-operator.
323
11
22
vi
31 1
332 3
Fig. 6.9. Illustration of which triangle vertices that generate non-zero off-diagonal
elements in the system matrix together with the vertex vi. The ’1’-vertices generate
non-zeros with vi by the membrane energy and in the basic least squares problem
(matrix BT B); the ’1’ and ’2’-vertices generate non-zeros by the thin-plate energy
term; and ’1’, ’2’ and ’3’-vertices generate non-zeros by the umbrella-operator.
nn n2
J2(c) = (Mkf )2 = ρik ci
k=1 k=1 i=1
nn n
= ρikci ρjkcj
k=1 i=1 j=1
nn n nn
= ρikρjk cicj = Eij cicj = cT Ec, (6.23)
i=1 j=1 k=1 i=1 j=1
where n
Eij = ρki ρkj .
k=1
56 6 Least Squares Approximation of Scattered Data
Mk = 1 ωkl cl − ck,
Wk
l∈∂Ωk
−1, l = k
ρlk ,ωkl
= if (vk, vl) is an edge in ∆
Wk otherwise.
0
t r
t2
nek g2
l t1
g1 ek
s
Fig. 6.10. Stencil for the second order divided difference Dk2f used to make the
discrete thin-plate energy measure.
Discrete thin-plate energy functional.
∂gi = ( ∂gi , ∂gi ) · nek = ∇gi · nek , i = 1, 2.
∂ nek ∂x ∂y
Tk f = ∂g2 − ∂g1
∂ nek ∂ nek
= ∂g2 − ∂g1 , ∂g2 − ∂g1 · nek
∂x ∂x ∂y ∂y
= (∇g2 − ∇g1) · nek (6.24)
∇g1 = ηlcl + ηs1cs + ηt1ct, µlcl + µs1cs + µt1ct /2Alst, (6.25)
∇g2 = ηrcr + ηt2ct + ηs2cs, µrcr + µt2ct + µs2cs /2Arts. (6.26)
nek = (yt − ys, xs − xt)/Lek ,
6.5 Smoothing Terms for Penalized Least Squares 57
Tkf = βik ci , (6.27)
i∈ω(ek )
where Lek Lek
2Alst 2Arts
βlk = − βrk = −
βsk = Lek Atlr βtk = Lek Asrl .
2Alst Arts 2Alst Arts
|EI | |EI | n2
J3(c) = Lek (Tkf )2 = Lek βik ci
k=1 k=1 i=1
|EI |
nn
= Lek βikci βjkcj
k=1 i=1 j=1
n n |EI |
nn
= Lek βikβjk cicj = Eij cicj = cT Ec,
i=1 j=1 k=1 i=1 j=1
where |EI |
Eij = Lek βikβjk .
k=1
1 m
m
Tz(λ) = (fλ(xk, yk) − zk)2 (6.28)
k=1
58 6 Least Squares Approximation of Scattered Data
Fig. 6.11. Penalized least squares aproximation of a noisy point set.
6.6 Approximation over General Triangulations
Ωl
Fig. 6.12. Point set for penalized least squares. The shaded region is a domain of
a basis function Ωj that do not cover any data points.
xT BT B x = (Bx)T (Bx) = Bx 2 ≥ 0.
2
6.6 Approximation over General Triangulations 59
cT BT B + λE c = cT BT B c + λcT Ec = 0, (6.29)
Uniqueness with the membrane energy functional.
|T | ∂gk 2 ∂gk 2
∂x ∂y
J1(c) = Ak + = cT Ec.
k=1
cT (BT B)c = (Bc)T (Bc) = Bc 2 = 0, (6.30)
2 (6.31)
Uniqueness with the umbrella-operator.
nn 1 2
nk
J2(c) = (Mkf )2 = cl − ck .
k=1 k=1 l∈∂Ωk
1
ck = nk l∈∂Ωk cl, k = 1, . . . n.
ck = 1 ωkl cl , k = 1, . . . n
Wk
l∈∂Ωk
Uniqueness with the thin-plate energy functional.
|EI | |EI |
J3(c) = (Tkf )2 = [(∇g2 − ∇g1) · nek ]2 = cT Ec.
k=1 k=1
60 6 Least Squares Approximation of Scattered Data
6.7 Weighted Least Squares
2
m mn
I(c) = wk [f (xk, yk) − zk]2 = wk cjNj(xk, yk) − zk .
k=1 k=1 j=1
m n
∂I = zk Ni(xk, yk) = 0, i = 1, . . . , n,
∂ci 2 wk cjNj(xk, yk) −
k=1 j=1
nm m
wkNi(xk, yk)Nj (xk, yk)cj = wkNi(xk, yk)zk, i = 1, . . . , n.
j=1 k=1 k=1
BT B c = BT z,
m (6.32a)
(6.32b)
BT B ij = wkNi(xk, yk)Nj(xk, yk), i, j = 1, . . . , n,
k=1
m
BT z i = wkNi(xk, yk)zk, i = 1, . . . , n.
k=1
6.8 Constrained Least Squares 61
6.8 Constrained Least Squares
Γ = {(xr, yr, zr)}nr=+nγ+1.
n+γ
f (x, y) = cjNj(x, y).
j=1
n n+γ
f (x, y) = cjNj(x, y) + zrNr(x, y).
j=1 r=n+1
n+γ 2
mn
I(c) = cjNj(xk, yk) + zrNr(xk, yk) − zk .
k=1 j=1 r=n+1
mn n+γ
∂I
∂ci = 2 cjNj(xk, yk) + zrNr(xk, yk) − zk Ni(xk, yk) = 0,
k=1 j=1 r=n+1
nm m n+γ
Ni(xk, yk)Nj (xk, yk)cj = Ni(xk, yk) zk − zrNr(xk, yk) ,
j=1 k=1 k=1 r=n+1
BT B c = BT z,
where
m
BT B ij = Ni(xk, yk)Nj(xk, yk), i, j = 1, . . . , n, and
i = 1, . . . , n.
k=1
m n+γ
BT z i = Ni(xk, yk) zk − zrNr(xk, yk) ,
k=1 r=n+1
62 6 Least Squares Approximation of Scattered Data
6.9 Approximation over Binary Triangulations
The general multilevel scheme.
Algorithm 6.1 General multilevel scheme
1. for k = 1, 2, 3, . . .
2. Find a surface approximation f∆k .
3. if |f∆k (xi, yi) − zi| < , i = 1, . . . , m,
stop.
4. else
5. Refine ∆k locally where is exceeded to produce ∆k+1,
and use f∆k to make an initial guess for f∆k+1 .
Approximation Scheme for Binary Triangulations.
v1 v3
2,1 5,3
v2
3,1
v1
1, 0
Fig. 6.13. Starting with the triangulation ∆1 and the regular grid Ψ1 on the left,
vertex v32,1 in Ψ2 is first activated together with its two parents v11,0 and v21,1 in Ψ1.
The resulting triangulation is ∆2 in the middle. Next, v53,3 in Ψ3 is activated together
with ancestors belonging to both Ψ1 and Ψ2 to obtain ∆3 on the right.
Ψk = vik,j 2k ,2k .
i,j=0,0
cikj+1 = fk(xi, yj ).
S10(∆1) ⊂ S10(∆2) ⊂ · · · ⊂ S10(∆h),
6.10 Numerical Examples for Binary Triangulations 63
6.10 Numerical Examples for Binary Triangulations
Approximation of data sampled from Franke’s function
Approximation of noisy data from Franke’s function
Approximation of parametrized 3D scattered data.
Terrain modeling of mountain area.
Fig. 6.14. Approximation to Franke’s test function; the resulting binary triangula-
tion imposed on the surface.
Fig. 6.15. The same binary triangulation as in Figure 6.14, and input data for
numerical examples. The lower left corner corresponds to the nearest corner in Fig-
ure 6.14.
Fig. 6.16. Approximation with huge smoothing parameter.
Fig. 6.17. Approximation to Franke’s function from a data set with noise.
Fig. 6.18. Approximation of terrain data and the given hypsographic data.
Fig. 6.19. Approximation of terrain data, and triangulation imposed on the surface.
Fig. 6.20. Terrain modeling of an area in Jotunheimen, Norway.
Fig. 6.21. Approximation of parametrized 3D scattered data.
References
1. J. R. Shewchuk. Delaunay Refinement Mesh Generation. PhD thesis, School of
Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania, 1997.
Available as Technical Report CMU-CS-97-137.
2. J. R. Shewchuk. Delaunay refinement algorithms for triangular mesh generation.
Computational Geometry, 22:21–74, 2002.