3. Interpolation and Filtering Data is often discretized in space - - PDF document

3 interpolation and filtering
SMART_READER_LITE
LIVE PREVIEW

3. Interpolation and Filtering Data is often discretized in space - - PDF document

3. Interpolation and Filtering Data is often discretized in space and / or time Finite number of samples The continuous signal is usually known only at a few points (data points) In general, data is needed in between these points


slide-1
SLIDE 1

Visualization, Summer Term 03 VIS, University of Stuttgart

1

  • 3. Interpolation and Filtering
  • Data is often discretized in space and / or time
  • Finite number of samples
  • The continuous signal is usually known only at a few points (data points)
  • In general, data is needed in between these points
  • By interpolation we obtain a representation that matches the function

at the data points

  • Evaluation at any other point possible
  • Reconstruction of signal at points that are not sampled
  • Assumptions needed for reconstruction
  • Often smooth functions

Visualization, Summer Term 03 VIS, University of Stuttgart

2

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Given irregularly distributed positions without connectivity information
  • Problem: obtain connectivity to find a “good” triangulation
  • For a set of points there are many possible triangulations
  • A measure for the quality of a triangulation is the aspect ratio of the so-

defined triangles

  • Avoid long, thin ones

vertex face

slide-2
SLIDE 2

Visualization, Summer Term 03 VIS, University of Stuttgart

3

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Scattered data triangulation
  • A triangulation of data points S = s0, s1, ..., sm ∈ R2 consists of
  • Vertices (0D) = S
  • Edges (1D) connecting two vertices
  • Faces (2D) connecting three vertices
  • A triangulation must satisfy the following criteria
  • ∪ faces = conv(S), i.e. the union of all faces including the boundary is the

convex hull of all vertices

  • The intersection of two triangles is either empty, or a common vertex, or a

common edge, or a common face (tetrahedra)

Visualization, Summer Term 03 VIS, University of Stuttgart

4

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Triangulation with

holes, faces overlap, T-vertices are not valid

slide-3
SLIDE 3

Visualization, Summer Term 03 VIS, University of Stuttgart

5

3.1. Voronoi Diagrams and Delaunay Triangulation

  • How to get connectivity/triangulation from scattered data ?
  • Voronoi diagram
  • Delaunay triangulation

Visualization, Summer Term 03 VIS, University of Stuttgart

6

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Voronoi diagram
  • For each sample every point within a Voronoi region is closer to it than to

every other sample

  • Given: a set of points X={x1,...,xn } from Rd and a distance function

dist(x,y)

  • The Voronoi diagram Vor(X) contains for each point xi a cell V(xi ) with

V(xi )={x | dist(x, xi ) < dist(x, xj ) ∀j≠ i }

slide-4
SLIDE 4

Visualization, Summer Term 03 VIS, University of Stuttgart

7

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Voronoi cells
  • The half space h(xi,xj ) is separated by the

perpendicular bisector between xi and xj

  • h(xi,xj ) contains xi
  • Voronoi cell:

V(xi ) = ∩j≠i h(xi,xj )

  • Voronoi cells are convex

xi xj h(xi,xj )

Visualization, Summer Term 03 VIS, University of Stuttgart

8

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Delaunay graph Del(X)
  • The geometric dual (topologically equal) of

the Voronoi diagram Vor(X)

  • Points in X are nodes
  • Two nodes xi and xj are connected iff

the Voronoi cells V(xi) and V(xj) share a same edge

  • Delaunay cells are convex
  • Delaunay triangulation = triangulation of

the Delaunay graph

slide-5
SLIDE 5

Visualization, Summer Term 03 VIS, University of Stuttgart

9

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Delaunay triangulation in 2D
  • Three points xi, xj, xk in X belong to a face from Del(X)

iff no further point lies inside the circle around xi, xj, xk

  • Two points xi, xj form an edge

iff there is a circle around xi, xj that does not contain a third point from X

  • For each triangle the circumcircle does not contain any other sample
  • Maximizes the smallest angle
  • Maximizes the ratio of (radius of

incircle)/(radius of circumcircle)

  • It is unique (independent of the
  • rder of samples) for all but

some very specific cases

Visualization, Summer Term 03 VIS, University of Stuttgart

10

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Local Delaunay property

E F

E

Local Delaunay Local Delaunay Local Delaunay violated

slide-6
SLIDE 6

Visualization, Summer Term 03 VIS, University of Stuttgart

11

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Algorithms for Delaunay triangulations
  • Edge flip algorithm

find an initial (valid) triangulation find all edges where local Delaunay property is violated mark these edges and push them onto the stack while (stack not empty) pop edge from stack if (edge does not satisfy Delaunay property) flip this edge flip all adjacent edges for which the Delaunay property is violated due to the flip

Visualization, Summer Term 03 VIS, University of Stuttgart

12

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Edge flip algorithm
slide-7
SLIDE 7

Visualization, Summer Term 03 VIS, University of Stuttgart

13

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Plane-sweep algorithm for finding an initial triangulation
  • Imaginary vertical sweepline passes from left to right
  • As the sweepline moves:
  • Problem has been solved for the data to the left of the sweepline
  • Is currently being solved for the data at or near the sweepline and
  • Is going to be solved sometime later for the data to right of the sweep-line
  • Reduces a problem in 2D space to a series of problems in 1D space

Visualization, Summer Term 03 VIS, University of Stuttgart

14

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Plane-sweep algorithm for finding an initial triangulation

sort points from left to right construct initial triangle using first three vertices for i=4 to n do use last inserted pi-1 as starting point walk counterclockwise along convex polygon (hull) of triangulation until the tangent points, inserting edges between pi and polygon points walk clockwise along convex polygon of triangulation until the tangent points, inserting edges between pi and polygon points update convex hull endfor

slide-8
SLIDE 8

Visualization, Summer Term 03 VIS, University of Stuttgart

15

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Plane Sweep algorithm
  • Also for triangulating polygons

Visualization, Summer Term 03 VIS, University of Stuttgart

16

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Bowyer-Watson algorithm

[D.F. Watson. Computing the -Dimensional Delaunay Tessellation with Application to

Voronoi Polytopes. The Computer Journal, 24(2):167-172, 1981] [A. Bowyer.Computing Dirichlet Tessellations. The Computer Journal, 24(2):162-166, 1981]

  • Incremental insertion of points into the triangulation

point to be added enclosing polygon new point

slide-9
SLIDE 9

Visualization, Summer Term 03 VIS, University of Stuttgart

17

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Bowyer-Watson algorithm
  • Start with initial triangulation which covers the domain (e.g. two triangles
  • f bounding box)
  • Incremental insertion of points into the triangulation
  • All triangles whose circumcircles contain the inserted point are removed
  • … cont.

point to be added enclosing polygon

Visualization, Summer Term 03 VIS, University of Stuttgart

18

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Bowyer-Watson algorithm cont.
  • The resulting cavity is triangulated by linking the inserted point to all

vertices of the cavity boundary

  • The cavity is star-shaped: Edges from the location of the newly inserted

point point to be added enclosing polygon new point

slide-10
SLIDE 10

Visualization, Summer Term 03 VIS, University of Stuttgart

19

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Bowyer-Watson algorithm

determine the super triangle that encompasses all vertices add super triangle vertices to the end of the vertex list add the super triangle to the triangle list for (each point in the vertex list) calculate the triangle circumcircle center and radius insert new point if (new point lies in a circumcircle) add the three triangle edges to the edge buffer remove the triangle from the triangle list delete multiple specified edges from the edge buffer, which leaves the edges of the enclosing polygon add all triangles formed of the point and the enclosing polygon remove all triangles from the triangulation that use the super triangle vertices and remove their vertices from the vertex list

Visualization, Summer Term 03 VIS, University of Stuttgart

20

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Demo
slide-11
SLIDE 11

Visualization, Summer Term 03 VIS, University of Stuttgart

21

3.1. Voronoi Diagrams and Delaunay Triangulation

  • Other techniques exist
  • Radial sweep
  • Intersecting halfspaces
  • Divide and conquer (merge-based or split-based)
  • Running times (worst-case)

Flipping Plane-sweep (as above) Randomized incremental (BW) Improved plane-sweep Divide and conquer Randomized incremental (BW) Dim. 2 2 2 2 2 ≥ 3 O(n2) O(n2) O(n log n) O(n log n) O(n log n) O(n[d/2])

Visualization, Summer Term 03 VIS, University of Stuttgart

22

3.2. Univariate Interpolation

  • Univariate interpolation: interpolation for one variable
  • Nearest neighbor (0 order)
  • Linear (first order)
  • Smooth (higher order)

x1 x2 x3 x4 f1 f2 x0 f0

slide-12
SLIDE 12

Visualization, Summer Term 03 VIS, University of Stuttgart

23

3.2. Univariate Interpolation

  • Taylor interpolation
  • Basis functions: monom basis (polynomials)

mi = xi with i∈N0

  • Pm={1,x,x2,...,xm} is m+1-dimensional vector space of all polynomials

with maximum degree m

  • Coefficients ci with f = Σi ci· xi
  • Representation of samples:

f(xj )=fj ∀ j=1..n

  • Interpolation problem

V·c = f with the Vandermond matrix Vij = xi

j-1

samples coefficients (to be solved)

Visualization, Summer Term 03 VIS, University of Stuttgart

24

3.2. Univariate Interpolation

  • Properties of Taylor interpolation
  • Unique solution
  • Numerical problems / inaccuracies
  • Complete system has to be solved again if a single value is changed
  • Not intuitive
slide-13
SLIDE 13

Visualization, Summer Term 03 VIS, University of Stuttgart

25

3.2. Univariate Interpolation

  • Generic interpolation problem:
  • Given are n sampled points X = {xi }⊆Ω⊆ Rd

with function values fi

  • n-dimensional function space Φn

d(Ω) with basis {φi =1..n }

  • Coefficients ci with f = Σi ci·φi
  • Representation of samples:

f(xj )=fj ∀ j=1..n

  • Solving the linear system of equations

M·c = f with Mji = φi(xj ), ci = ci , and fj = fj

  • Note: number of points n determines dimension of vector space

(= degree of polynomials)

Visualization, Summer Term 03 VIS, University of Stuttgart

26

3.2. Univariate Interpolation

  • Other basis functions result in other interpolations schemes:
  • Lagrange interpolation
  • Newton interpolation
  • Bernstein basis: Bezier curves (approximation)
  • Hermite basis
slide-14
SLIDE 14

Visualization, Summer Term 03 VIS, University of Stuttgart

27

3.2. Univariate Interpolation

  • Cubic Hermite polynomials H
  • Coefficients describe:
  • End points
  • Tangent vectors at end points

2 3 3 2 3 2 2 3 1 2 3

) 2 3 ( ) ( H ) 1 ( ) ( H ) 1 ( ) ( H ) 2 1 ( ) 1 ( ) ( H t t t t t t t t t t t t − = − − = − = + − =

3

H

3 3

H

3 1

H

3 2

H

Visualization, Summer Term 03 VIS, University of Stuttgart

28

3.2. Univariate Interpolation

  • Problem: coupling of number of samples n and degree of polynomials
  • Solution: Spline interpolation
  • Smooth piecewise polynomial function
  • Continuity / smoothness at segment boundaries!

fi x xi x 1 N1

2

N2

2

N3

2

N4

2

t1 = t2 =t3 t4 t5 t6 t7= t8= t9 N5

2

N6

2

B-Spline

slide-15
SLIDE 15

Visualization, Summer Term 03 VIS, University of Stuttgart

29

3.2. Univariate Interpolation

  • Piecewise linear interpolation
  • Simplest approach (except for nearest-neighbor sampling)
  • Fast to compute
  • Often used in visualization applications
  • C0 continuity at segment

boundaries

  • Data points: (x0,f0),...,(xn,fn)
  • For any point x with

xi ≤ x ≤ xi+1 described by local coordinate u=(x-xi)/(xi+1-xi) ∈ [0,1] that is x= xi +u(xi+1-xi) =(1-u)xi +uxi+1 ; evaluate f(x)=(1-u)fi + ufi+1

fi+1 f fi x xi xi+1 xi+2 fi+2 xi xi+1 x x

1-u u

fi fi+1 f f

1-u u

Visualization, Summer Term 03 VIS, University of Stuttgart

30

3.3. Differentiation on Grids

  • First approach
  • Replace differential by „finite differences“
  • Note that approximating the derivative by

causes subtractive cancellation and large rounding errors for small h

  • Second approach
  • Approximate/interpolate (locally) by differentiable function and differentiate

this function

h x f h x f x f ) ( ) ( ) ( ' − + ≈ x f dx df x f ∆ ∆ → = ) ( '

slide-16
SLIDE 16

Visualization, Summer Term 03 VIS, University of Stuttgart

31

3.3. Differentiation on Grids

  • Finite differences on uniform grids with grid size h (1D case)

f(x) xi h x

Visualization, Summer Term 03 VIS, University of Stuttgart

32

3.3. Differentiation on Grids

  • Finite differences on uniform grids with grid size h (1D case)
  • Forward differences
  • Backward differences
  • Central differences
  • Error estimation:
  • Forward/backward differences are first order
  • Central differences are second order

) ( ) ( ) ( '

1

h x f x f x f

i i i +

  • =

) ( ) ( ) ( '

1

h x f x f x f

i i i

  • =

2 ) ( ) ( ) ( '

1 1

h x f x f x f

i i i

  • +
  • =
slide-17
SLIDE 17

Visualization, Summer Term 03 VIS, University of Stuttgart

33

3.3. Differentiation on Grids

  • Finite differences on non-uniform grids
  • Forward and backward differences as for

uniform grids with xi+1 – xi = αh xi – xi-1 = βh

βh αh

xi xi-1 xi+1 x f(x)

Visualization, Summer Term 03 VIS, University of Stuttgart

34

3.3. Differentiation on Grids

  • Finite differences on non-uniform grids
  • Central differences by Taylor expansion around the point xi

... ) ( ' ' 2 ) ( ) ( ' ) ( ) (

2 1

+ + + =

+ i i i i

x f h x hf x f x f α α ... ) ( ' ' 2 ) ( ) ( ' ) ( ) (

2 1

+ + − =

− i i i i

x f h x hf x f x f β β

        − + − + =

− +

) ( ) ( ) ( ) ( 1 ) ( '

2 2 1 1 i i i i

x f x f x f h x f αβ β α β α α β β α

  • The final approximation of the derivative:

) ( ) ( ' ) ( ' )) ( ) ( ( 1 )) ( ) ( ( 1

3 1 2 1 2

h O x f h x f h x f x f x f x f

i i i i i i

+ + = − − −

− +

β α β α

slide-18
SLIDE 18

Visualization, Summer Term 03 VIS, University of Stuttgart

35

3.3. Differentiation on Grids

  • 2D or 3D uniform or rectangular grids
  • Partial derivatives
  • Same as in univariate case along

each coordinate axis

  • Example: gradient in a 3D uniform grid

z f y f x f ∂ ∂ ∂ ∂ ∂ ∂ , ,

h h i j                   − − − =                 ∂ ∂ ∂ ∂ ∂ ∂ =

− + − + − +

h f f h f f h f f z f y f x f f

k j i k j i k j i k j i k j i k j i

2 2 2 grad

1 , , 1 , , , 1 , , 1 , , , 1 , , 1

Visualization, Summer Term 03 VIS, University of Stuttgart

36

3.4. Interpolation on Grids

  • Manifolds with more than 1D
  • Tensor product
  • Combination of several univariate

interpolations

  • Example for 2D surface:
  • n·m values fjl with j=1..n and l=1..m

given at points X×Y=(x1,...,xn)× (y1,...,ym)

  • n univariate basis functions ξj (x) on X
  • m univariate basis functions ψl (y) on Y
  • n·m basis functions on X×Y:

φij (x,y) = ξi(x)·ψj(y)

  • Tensor product:

ij m n j i ij

c y x y x f ) , ( ) , (

, 1 , 1

= =

= φ

slide-19
SLIDE 19

Visualization, Summer Term 03 VIS, University of Stuttgart

37

3.4. Interpolation on Grids

  • Tensor product
  • Solve a linear system of equations for the unknown coefficients cij
  • Extension to k dimensions in the same way

ij m n j i ij

c y x y x f ) , ( ) , (

, 1 , 1

= =

= φ

Visualization, Summer Term 03 VIS, University of Stuttgart

38

3.4. Interpolation on Grids

  • Bilinear interpolation on a rectangle
  • Tensor product for two linear interpolations
  • 2D local interpolation in a cell
  • Known solution of the linear system of equations for the coefficients cij
  • Four data points (xi,yj),...,(xi+1,yj+1) with scalar values fi,j=f(xi,yj), …
  • Bilinear interpolation of points (x,y) with xi≤x<xi+1 and yj≤y<yj+1

f(xi+1,yj+1)

(xi+1,yj+1) (xi+1,yj) (x,y)

f(xi,yj) f(x,y)

(xi,yj)

f(xi,yj+1) f(xi+1,yj)

(xi,yj+1)

slide-20
SLIDE 20

Visualization, Summer Term 03 VIS, University of Stuttgart

39

3.4. Interpolation on Grids

  • Bilinear interpolation on a rectangle

with and local coordinates

1 1 , 1 1 , , 1 ,

) 1 ( ] ) 1 [( ] ) 1 )[( 1 ( ) , (

+ + + + +

+ − = + − + + − − =

j j j i j i j i j i

f f f f f f y x f β β α α β α α β ] 1 , [ , , ,

1 1

∈ − − = − − =

+ +

β α β α

i i i i i i

y y y y x x x x

1 , 1 1 , 1 , 1 ,

) 1 ( ) 1 (

+ + + + +

+ − = + − =

j i j i j j i j i j

f f f f f f α α α α

fi+1,j+1 fi,j fi+1,j fi,j+1 f=? α β fj fj+1

Visualization, Summer Term 03 VIS, University of Stuttgart

40

3.4. Interpolation on Grids

  • Bilinear interpolation on a rectangle
  • Weighted by local

areas of the opposite point

  • Bilinear interpolation is not

linear (but quadratic)!

  • Cannot be inverted easily!

1 , 1 1 , , 1 ,

) 1 ( ) 1 ( ) 1 )( 1 ( ) , (

+ + + +

+ − + − + − − =

j i j i j i j i

f f f f y x f αβ β α β α β α

fi,j fi+1,j fi,j+1 f=? α β fi+1,j+1 1-α 1-β

slide-21
SLIDE 21

Visualization, Summer Term 03 VIS, University of Stuttgart

41

3.4. Interpolation on Grids

  • Trilinear interpolation on a 3D uniform grid
  • Straightforward extension of bilinear interpolation
  • Three local coordinates α,β,γ
  • Known solution of the linear system of equations for the

coefficients cij

  • Trilinear interpolation is not linear!
  • Efficient evaluation:

f(α,β,γ)= a+α(b+ β(e+hγ))+ β(c+f γ)+ γ(d+gα) with coefficients a, b, c, d, e, f, g from data at the corner vertices

  • Extension to higher order of continuity
  • Piecewise cubic interpolation in 1D
  • Piecewise bicubic interpolation in 2D
  • Piecewise tricubic interpolation in 3D
  • Based on Hermite polynomials

Visualization, Summer Term 03 VIS, University of Stuttgart

42

3.4. Interpolation on Grids

  • Interpolation on un/structured grids (triangle meshes etc.) ?
  • Affine combination of points x (in Euclidean space):
  • Linear combination Σi αi ·xi
  • 0 ≤ αi ≤ 1,∀ i
  • Σi αi = 1
  • αi are barycentric coordinates
  • Affinely independent set of points:
  • No point can be expressed as affine combination of the other points
  • Maximum number of points is d+1 in Rd
slide-22
SLIDE 22

Visualization, Summer Term 03 VIS, University of Stuttgart

43

3.4. Interpolation on Grids

  • Simplex in Rd
  • d+1 affinely independent points
  • Span of these points
  • 0D: point
  • 1D: line
  • 2D: triangle
  • 3D: tetrahedron

Visualization, Summer Term 03 VIS, University of Stuttgart

44

3.4. Interpolation on Grids

  • Barycentric interpolation on a simplex
  • d+1 points xi with function values fi
  • Point x within the simplex described as affine combination of xi
  • Possible approach:

solve for coefficients αi based on x = Σi αi ·xi and Σi αi = 1

  • Function value at x: f = Σi αi ·fi is affine combination of fi
  • Barycentric coordinates from area/volume considerations:

( ) ( )

1 d 1 1 d 1 i 1 i 1 i

, , , , , , , , α

+ + + −

= x x Vol x x x x x Vol K K K

( )

        =

+ +

1 1 L L K

1 d 1 1 d 1

, , x x det x x Vol

generalized measure for area/volume

slide-23
SLIDE 23

Visualization, Summer Term 03 VIS, University of Stuttgart

45

3.4. Interpolation on Grids

  • Barycentric coordinates from area/volume considerations

x1 x3 x2 A A1 α1=A1/A V V1 α1=V1/V x2 x1 x3 x4 x x x d = 2 d = 3 Opposite local area Opposite local volume d = 1 Opposite local length x1 x2 x α1=L1/L L1

2 2 1 1

x α x α x + = 1 = +

2 1

α α

2 1

ux x u x + − = ) 1 (

2

α u =

Visualization, Summer Term 03 VIS, University of Stuttgart

46

3.4. Interpolation on Grids

  • Barycentric interpolation in a triangle
  • Geometrically, barycentric coordinates are given by the ratios of the

area of the whole triangle and the subtriangles defined by x and any two points of x1, x2, x3.

( )

)) , ( Area( 2 1 1 1 ,

3 2 1 3 2 1 3 2 1 3 2 1

, y y y x x x , x x x x x x ∆ ± = =           = det Vol

( ) ( )

3 2 1 3 2 1

, , x x x x x x , , Vol Vol = α

x2 f2

3 3 2 2 1 1

x x x x α α α + + = 1 = + +

3 2 1

α α α

3 3 2 2 1 1

f α f α f α f + + = ) (x

x1 x3 x x f1 f3 f f

x1 =(1,0,0) x2 =(0,1,0) X3=(0,0,1) (1/3,1/3, 1/3)

α2=0

2 1 3 2 1

α α α α α d c b a y x − − =                 =         1 ;

slide-24
SLIDE 24

Visualization, Summer Term 03 VIS, University of Stuttgart

47

3.4. Interpolation on Grids

  • Interpolation in a generic quadrilateral
  • Main application: curvilinear grids
  • Problem: find a parameterization for arbitrary quadrilaterals

x1 x3 x2 x4 x f2 f1 f3 f4 f=? α1 α2 Φ Φ-1

local coordinates

Visualization, Summer Term 03 VIS, University of Stuttgart

48

3.4. Interpolation on Grids

  • Mapping φ from rectangular domain to quadratic domains is known:

Bilinear interpolation on a rectangle x12 = α1·x1 + (1- α1)·x2 α1∈[0,1] x34 = α1·x4 + (1- α1)·x3 x = α2·x12 + (1- α2)·x34 α2∈[0,1]

  • Computing the inverse of φ is more complicated:
  • Analytically solve quadratic system for α1, α2
  • Or: numerical solution by Newton iteration
  • Final value: f = α2·(α1·f1 + (1- α1)·f2 ) + (1- α2)·(α1·f4 + (1- α1)·f3 )

x2 x1 x3 x4 x f2 f1 f3 f4 f=? x12 x34

slide-25
SLIDE 25

Visualization, Summer Term 03 VIS, University of Stuttgart

49

3.4. Interpolation on Grids

  • Jacobi matrix J(Φ)
  • J(Φ)ij = ∂Φi/∂αj
  • J(Φ).j describes direction and speed of position changes of Φ

when αj are varied

  • Newton iteration

start with seed points as start configuration, e.g., αi =1/2 while ( ||x - Φ(α1,α2,α3)|| > ε ) compute J(Φ(α1,α2,α3)) transform x in coordinate system J(Φ): xα= J(Φ(α1,α2,α3))-1·( x - Φ(α1,α2,α3) ) update αi = αi + xα,i

maximum error ε

Visualization, Summer Term 03 VIS, University of Stuttgart

50

3.4. Interpolation on Grids

  • Other primitive cell types possible

x1 x3 x2 x4 f2 f1 f3 f4 x5 f5 x1 x3 x2 x4 f1 f3 f4 x5 x6 f5 f6 Prism:

  • twice barycentric
  • once linear

Pyramid:

  • bilinear on base face
  • then linear
slide-26
SLIDE 26

Visualization, Summer Term 03 VIS, University of Stuttgart

51

3.4. Interpolation on Grids

  • Inverse distance weighting
  • Shepard interpolation [D. Shepard, A two-dimensional interpolating function for irregularly

spaced data. Proc. ACM. nat. Conf., 517--524, 1968]

  • Originally developed for scattered data
  • Interpolated values: f(x)= Σi φi(x) fi
  • Sample points are vertices of the cell
  • Basis functions
  • Define values at sample points f(xi ) := fi = limxxif(x)

− −

− − =

j p j p i i

) ( x x x x x φ

Visualization, Summer Term 03 VIS, University of Stuttgart

52

3.5. Interpolation without Grids

  • Shepard interpolation
  • Different exponents for inner and outer neighborhood

(default: 2 in the inner neighborhood and 4 in the outer neighborhood)

  • Neighborhood sizes determine how many points are included in inverse

distance weighting

  • The neighborhood size can be specified in terms of
  • Radius or
  • Number of points or
  • Combination of the two
  • Neighborhood is not given explicitly (as opposed to inverse distance

weighting on grids)

slide-27
SLIDE 27

Visualization, Summer Term 03 VIS, University of Stuttgart

53

3.5. Interpolation without Grids

  • Radial basis functions (RBF)
  • n function values fi given at n points xi
  • Interpolant
  • Univariate radial basis φ(r)
  • Examples:
  • Polynomials

rv

  • Gaussians

exp(r -2)

  • Polynomial basis {pm } for (k + 1)-dimensional vector space

( )

( )

x x x x

m k m m i n i i

p c ) ( f

∑ ∑

= =

+ − =

1

φ λ

Visualization, Summer Term 03 VIS, University of Stuttgart

54

3.5. Interpolation without Grids

  • Radial basis functions (RBF)
  • Under-determined system:

n equations for n + (k+1) unknowns

  • Additional constraints (orthogonality / side conditions):
  • Well-defined system of linear equations (vector / matrix notation):

( )

k m p

i m n i i

...

1

= ∀ =

=

x λ         =                 f c λ P P A

T

Function values at sample points Coefficients for polynomials Polynomial basis

( )

j i j i

x x A − = φ

,

Coefficients for radial function

slide-28
SLIDE 28

Visualization, Summer Term 03 VIS, University of Stuttgart

55

3.6. Filtering by Projection or Selection

  • Very often: too much information to be visualized at once
  • Strategy is to reduce the displayed information by filtering
  • Popular approach:

Reduce from ndmv to n’dm’v , with n’ < n and / or m’ < m [Wong]

  • Techniques:
  • Projection
  • Selection
  • Slicing
  • User input needed

Visualization, Summer Term 03 VIS, University of Stuttgart

56

3.6. Filtering by Projection or Selection

  • Projection π
  • Functional description for both the
  • Domain and
  • Data values
  • Projection into subspaces
  • Often a mapping to a subset of the
  • riginal values is chosen
slide-29
SLIDE 29

Visualization, Summer Term 03 VIS, University of Stuttgart

57

3.6. Filtering by Projection or Selection

  • Selection σ
  • Selection of data according to logical conditions (predicates)
  • Example:
  • Height field 2d1v with data (x,y,h)
  • Dσ = { (x,y,h) | (x2+y2 < 5km) ∧ (h > 1km) }

Visualization, Summer Term 03 VIS, University of Stuttgart

58

3.6. Filtering by Projection or Selection

  • Slicing
  • Example: 2D cutting surface

(slice) through a 3D volume

slide-30
SLIDE 30

Visualization, Summer Term 03 VIS, University of Stuttgart

59

3.7. Fourier Transform

  • Fourier analysis
  • Function h(t) in coordinate representation (time domain)
  • Analogous representation H(ν) with frequencies ν (frequency domain)
  • Fourier transform:
  • Convolution
  • Convolution theorem: (g∗ h)(t) ⇔ G(ν)·H(ν)

∞ ∞ −

= ν ν

ν π d

)e H( h(t)

t i 2

∞ ∞ −

= dt h(t)e ) H(

t i 2

  • ν

π

ν

∞ ∞ −

τ τ ⋅ τ = ∗ )d

  • h(t

) g( h)(t) (g

forward transform inverse transform

Visualization, Summer Term 03 VIS, University of Stuttgart

60

3.7. Fourier Transform

  • Examples

t h(t)=k ν H(f)=k·δ(ν) ⇔

t

h(t)=k ·δ(t) ν H(ν)=k ⇔

slide-31
SLIDE 31

Visualization, Summer Term 03 VIS, University of Stuttgart

61

3.7. Fourier Transform

  • Examples

t H(ν) ν ⇔ sinc

1/∆ν

∆ν k

( )

t ∆ ∆ k h(t) ν π ν sinc ⋅ = t h(t) ν ⇔ Box

1/∆t

∆t k

( )

ν π ν t ∆ t ∆ k ) H( sinc =

( )

x x x ) sin( sinc =

Visualization, Summer Term 03 VIS, University of Stuttgart

62

3.7. Fourier Transform

  • Examples

t h(t) ν H(ν) ⇔ ∆t

1/∆t

Comb t h(t) ν ⇔ Triangle function

1/∆t

2∆t k

( )

2

t ∆ t ∆ k ) H( ν π ν sinc ⋅ =

slide-32
SLIDE 32

Visualization, Summer Term 03 VIS, University of Stuttgart

63

3.7. Fourier Transform

  • In applications: mostly discrete Fourier transforms
  • Based on a discrete signal
  • Implementation in the form of the Fast Fourier Transform (FFT)

Visualization, Summer Term 03 VIS, University of Stuttgart

64

3.8. Sampled Signals

  • h(t) is assumed to be band limited with frequencies smaller than B
  • Nyquist frequency

νNyq = 2B

  • Discretization with constant step size ∆t = 1/νNyq = 1/(2B)
  • Sampled signal:

hj =h(j·∆t)

  • Periodicity is assumed if only a finite interval j = 0..n-1 is considered
  • Sampling theorem (Shannon 1949):

If H(f) = 0 for all |ν |> B = νNyq / 2, then h(t) is uniquely given by the samples hi: h(t) = Σj=0..n-1 hj ·sinc(π νNyq(t-j·∆t))

slide-33
SLIDE 33

Visualization, Summer Term 03 VIS, University of Stuttgart

65

3.8. Sampled Signals

  • Issue 1: Undersampling
  • If h(t) has frequencies larger than B = νNyq / 2
  • h(t) cannot be reconstructed from sampled values
  • Aliasing

B

  • B

|H(f)|2 ν

Original signal Mirror image FT with Aliasing

Visualization, Summer Term 03 VIS, University of Stuttgart

66

3.8. Sampled Signals

  • Issue 2: Finite window size
  • Fourier transform is theoretically defined for signals of infinite duration or

for periodic signal

  • Often h(t) is measured on a finite interval [-T/2,T/2] (without periodicity)
  • Yielding a multiplication with a window function: h(t)·1[-T/2,T/2](t)
  • Convolution with sinc() function in frequency space

t w(t) ν ⇔ Window

1/T

T 1 W(ν)

slide-34
SLIDE 34

Visualization, Summer Term 03 VIS, University of Stuttgart

67

3.8. Sampled Signals

  • Issue 2: Finite window size
  • Problem: Differences between the starting and ending values of the

segment produces a discontinuity which generates high-frequency spurious components

  • Solution: Data windowing
  • Bartlett window is often used
  • Other examples: Hamming, Hann windows

t w(t) ν ⇔ Bartlett

1/T

T 1 W(ν)

Visualization, Summer Term 03 VIS, University of Stuttgart

68

3.9. Reconstruction and Frequency Filtering

  • Filter design based on Fourier analysis
  • Low pass filter with limit frequency ν0:
  • Convolution with sinc() function (in coordinate space) or
  • FFT, then multiplication with box filter Φ(ν), then inverse FFT

t

Φ(ν) ν

sinc

1/2 ν0

2 ν0

( )

t 2 (t) πν ν φ sinc 2 ⋅ =

ν0

slide-35
SLIDE 35

Visualization, Summer Term 03 VIS, University of Stuttgart

69

3.9. Reconstruction and Frequency Filtering

  • High pass filter with limit frequency ν0:
  • Emphasizes features, e.g., edges

t

Φ(ν) ν

sinc

1/2 ν0

2 ν0

( ) ( )

t 2 t (t) πν ν δ φ sinc 2 ⋅ − =

ν0

Visualization, Summer Term 03 VIS, University of Stuttgart

70

3.9. Reconstruction and Frequency Filtering

  • Reconstruction issues
  • Measurements m(t) of the original signal s(t) are based on a point-spread

function p(t-ti), not on the ideal delta function δ(t-ti)

  • Convolution in coordinates space, multiplication in frequency space
  • Additional noise
  • What is the ideal, original signal s(t)?

) )S( P( ) M( )d )s(

  • p(t

m(t) ν ν ν τ τ τ = ⇔ = ∫

∞ ∞ −

slide-36
SLIDE 36

Visualization, Summer Term 03 VIS, University of Stuttgart

71

3.9. Reconstruction and Frequency Filtering

Sampling Sampling in frequency domain Signal in frequency space Sampled signal in frequency domain

Visualization, Summer Term 03 VIS, University of Stuttgart

72

3.9. Reconstruction and Frequency Filtering

Function Function in frequency domain Sampled signal Signal in frequency domain Before re- construction with sinc() Box filter in frequency domain

slide-37
SLIDE 37

Visualization, Summer Term 03 VIS, University of Stuttgart

73

3.9. Reconstruction and Frequency Filtering

Reconstruction Reconstruction in frequency domain Before re- construction with triangle Triangle in frequency domain: sinc()2 Reconstruction with triangle Reconstruction in frequency domain

Visualization, Summer Term 03 VIS, University of Stuttgart

74

3.9. Reconstruction and Frequency Filtering

Function Function in frequency domain Under- sampled signal Signal in frequency domain Before re- construction with sinc() Box filter in frequency domain

slide-38
SLIDE 38

Visualization, Summer Term 03 VIS, University of Stuttgart

75

3.9. Reconstruction and Frequency Filtering

Reconstruction Reconstruction in frequency domain Before re- construction with triangle Triangle in frequency domain: sinc()2 Reconstruction with triangle Reconstruction in frequency domain

Visualization, Summer Term 03 VIS, University of Stuttgart

76

3.9. Reconstruction and Frequency Filtering

  • Demo (Applet)