2D vector fields 3 Scientific Visualization (Part 8) PD Dr.-Ing. Peter Hastreiter Contents Line Integral Convolution (LIC) Fast LIC Oriented LIC Image based flow visualization Vector field topology 2 Applied Visualization, SS0
Line integral convolution 3 Applied Visualization, SS0 Line integral convolution LIC Main idea Traditional methods inappropriate for dense vector fields Visualize dense flow fields by imaging its integral curves Cover domain with random texture So called input texture (usually stationary white noise) Blur (convolve) the input texture along the path lines of underlying vector field using a specified filter kernel 4 Applied Visualization, SS0
Line integral convolution Appearance of 2D LIC images Intensity distribution along path lines shows high correlation No correlation between neighboring path lines 5 Applied Visualization, SS0 Line integral convolution Literature B. Cabral, L. Leedom: Imaging vector fields using Line Integral Convolution, SIGGRAPH 993 D. Stalling, H.-C. Hege: Fast and resolution independent Line Integral Convolution, SIGGRAPH 995 6 Applied Visualization, SS0
Line integral convolution Algorithm for 2D LIC t Ф 0 (t) : path line containing the point (x 0,y 0 ) T(x,y) : randomly generated input texture k : filter kernel Compute pixel intensity as: (convolution with kernel) Kernel: Finite support [-L,L] Normalized Often simple box filter Often symmetric (isotropic) I( x 0 -L, y 0 kernel k(t) + L ) = k( t) T ( φ0( t)) dt L = k ( T oφ ) L -L k 0 () t dt = L 7 Applied Visualization, SS0 Line integral convolution Algorithm for 2D LIC Convolve a random texture along the streamlines flow data streamline integration convolution white noise result LIC texel 8 Applied Visualization, SS0
Line integral convolution Input noise Vector field Convolution kernel k(t) L -L k () t dt = -L L Final image 9 Applied Visualization, SS0 Line integral convolution quite laminar flow quite turbulent flow 0 Applied Visualization, SS0
Line integral convolution Air-bag Applied Visualization, SS0 Line integral convolution Air-bag Temperature during opening high low 2 Applied Visualization, SS0
Line integral convolution 3 Applied Visualization, SS0 Line integral convolution 4 Applied Visualization, SS0
Fast Line integral convolution 5 Applied Visualization, SS0 Fast LIC Problems with LIC New streamline is computed at each pixel Convolution (integral) is computed at each pixel Slow Idea Compute very long streamlines Reuse these streamlines for many different pixels Incremental computation of the convolution integral 6 Applied Visualization, SS0
Fast LIC Incremental integration Discretization of convolution integral Summation T L x L T n x n Assumption: box filter k () t = 2 L+ T 0 x 0 L I0 = 2L+ T i i= -L x -m T -m T -L x -L 7 Applied Visualization, SS0 Fast LIC Incremental integration Next position I T L T n x L x n Assumption: box filter k () t = 2 L+ T 0 x 0 L I0 = 2L+ T i i= -L x -m T -m T -L I I + ( ) x -L = 0 + 2L + T L T -L 8 Applied Visualization, SS0
Fast LIC Incremental integration for constant kernel Given Streamline x -m,..., x 0,..., x n with m,n L Given texture values T -m,...,t 0,...,T n What are the convolution results: I -m+l,..., I 0,..., I n-l? j + L I j = 2L+ i= j-l T Incremental integration: i (j+ ) + L j+ L = = 2L+ Ti 2L+ Ti + TL+ j+ T L+ i= (j+ )-L i= j-l I j+ ( T T ) = ( T T ) L I j+ I j = 2L+ i+ j+ i+ j 2L+ L+ j+ -L+ j i= -L 9 Applied Visualization, SS0 j For box filter (constant kernel): Fast LIC Incremental integration for polynomial kernels Assumption: polynomial kernel (monom representation) d () i = k p= 0 α p i p Value I j = d p= 0 α p I p j with I p j = L i = -L T j+ i i p 20 Applied Visualization, SS0
Fast LIC Incremental integration for polynomial kernels Incremental update for p I j ( T T ) p p L I j+ I j = = + + + i -L j i j i i p + 64444 74444 8 p p p p Tj i ( i ) i ) + Tj+ L+ L Tj L ( -L ) p Λ j L = i = -L + = p- q= 0 p p-q p ( )( ) + Λ q I q j j+ 2 Applied Visualization, SS0 Fast LIC Algorithm Data structure for output: luminance/alpha image numhits(p) = number of streamline hits at pixel p for each pixel p if (numhits(p) < minhits) then initialize streamline computation with x0 = center of p compute convolution I(x 0 ) add result to intensity of pixel p set m = while m < some limit M incremental convolution to obtain I(x m ) and I(x -m ) add results to intensity(p(x m )) and intensity(p(x -m )) set m = m + for each pixel p normalize all pixels according to numhits(p) 22 Applied Visualization, SS0
Oriented Line integral convolution 23 Applied Visualization, SS0 Oriented LIC (OLIC) Visualization of orientation (in addition to direction) Sparse texture Anisotropic convolution kernel Acceleration Integrate individual drops and compose them to final image anisotropic convolution kernel -l l 24 Applied Visualization, SS0
Oriented LIC (OLIC) 25 Applied Visualization, SS0 Image based flow visualization 26 Applied Visualization, SS0
Image based flow visualization (IBFV) van Wijk [SIGGRAPH, 2002] Can simulate LIC, pathlines, but also much more Animated flow visualization Exploits graphics hardware Demo and paper http://www.win.tue.nl/~vanwijk/ibfv 27 Applied Visualization, SS0 Image based flow visualization (IBFV) Image k image k+: Image k: I k Distort image k according to vector field D k Blend distorted image with background image B: I k+ = (-α)d k + αb Image distortion and blending can be done efficiently by graphics hardware 28 Applied Visualization, SS0
Image based flow visualization (IBFV) IBFV path lines Starting points of path lines set in background image Example Background image is a grid of dots 29 Applied Visualization, SS0 Image based flow visualization (IBFV) IBFV-LIC Background image is random noise texture IBFV-animated LIC Background image is animated noise texture 30 Applied Visualization, SS0
Image based flow visualization (IBFV) Many other possibilities 3 Applied Visualization, SS0 LIC summary 32 Applied Visualization, SS0
LIC Summary Dense representation of flow fields Convolution along streamlines correlation along streamlines For 2D and 3D flows Stationary flows Extensions Unsteady flows Animation Texture advection 33 Applied Visualization, SS0 LIC Summary LIC representation of a 3D vector field 34 Applied Visualization, SS0
Vector field topology 35 Applied Visualization, SS0 Vector field topology Idea Draw not all but just important streamlines Show only topological skeletons Choose start point not interactively but automatically Important points in the vector field: Critical points Algorithms described above have problems handling them 36 Applied Visualization, SS0
Vector field topology Critical points Points where the vector field vanishes: v = 0 Points where the vector magnitude goes to zero and the vector direction is undefined Critical points are connected to divide the flow into regions with similar properties Start at critical point in direction of eigenvector Terminate at the border or in other critical point Question How do integral curves, the flow or particle lines look like in the neighborhood of critical points? 37 Applied Visualization, SS0 Vector field topology Taylor expansion For the velocity field around a critical point p c 2 v( p) = v( p ) + v ( p p ) + O( p p ) c J ( p p c ) c c Note that v(p c ) vanishes because of critical point property! Jacobian of v with respect to p c Note that this is different to the Jacobian between C- and P-space vx x v r = vy y vx y v y y Assume p c = (0,0) very simple DGL v(p) = Jp c 38 Applied Visualization, SS0
Vector field topology Subdivide the Jacobian J = J s + J a = 2 T ( J + J ) + ( J J T ) Symmetric part T J s = J + J 2 Anti-symmetric part J a = 2 ( ) T ( J J ) Compare with complex numbers z = a + jb Re( z) = * z = a jb Im( z) = z + z 2 z z 2 * * 39 Applied Visualization, SS0 Vector field topology Symmetric part Can be solved to give real eigenvalues R and real eigenvectors p s J p = s s Rp s R = R R 2,, R 3 Eigenvectors p s are an orthonormal set of vectors Describes change of size along eigenvectors Describes flow into or out of region around critical point 40 Applied Visualization, SS0
4 Applied Visualization, SS0 Vector field topology Anti-symmetric part Describes rotation of difference vector d = (p - p c ) Can be solved to give imaginary eigenvalues I ( ) ( ) d v d d J J d J = = = r 2 y z x z z y x y z x y x 2 T 2 0 0 0 z y z x y z y x x z x y v v v v v v v v v v v v a 3 2,, I I I I = a a a Ip p J = 42 Applied Visualization, SS0 Vector field topology Integral curves If λ,2 are eigenvalues and ξ,2 eigenvectors of the Jacobian, then a solution is Where β,2 are arbitrary constants Note that a variation of β,2 results in all particle lines Two relevant general cases can appear: 2 real eigenvalues 2 complex eigenvalues λ,2 = R ± ii 2 2 2 ) exp( ) exp( ) ( ξ λ β ξ λ β t t t r + =
Vector field topology Case : two real eigenvalues Three cases, depending on sign of eigenvalues Attracting node: R, R 2 < 0 and I, I 2 = 0 Repelling node: R, R 2 > 0 and I, I 2 = 0 Saddle point: R < 0 < R 2 and I, I 2 = 0 43 Applied Visualization, SS0 Vector field topology Case 2: two complex eigenvalues R ± ii Attracting / repelling force: R Rotating force: I Attracting focus: R, R 2 < 0 and I, I 2 0 Repelling focus: R, R 2 > 0 and I, I 2 0 Center: R, R 2 = 0 and I, I 2 0 44 Applied Visualization, SS0
Vector field topology Examples 2 real eigenvalues λ < 0 < λ 2 2 complex eigenvalues Re λ < 0 45 Applied Visualization, SS0 Vector field topology How to find critical points Cell search (for cells which contain critical points) a) Mark vertices by (+,+), (, ), (+, ) or (,+) depending on signs of v x and v y b) Determine cells with sign changes of vertices in both components these are the cells that contain critical points c) Find the critical points by interpolation How to find critical points within a (quad) cell? Determine intersection of isolines (c=0) of two components Two bilinear equations to be solved (or one quadratic equation) Critical points are the solutions within the cell boundaries (yes, yes) (no, yes) (+,+) (+,+) (+,+) (, ) (+, ) (+, ) 46 Applied Visualization, SS0 v y =0 vx =0
Vector field topology How to find critical points (cont.) How to find critical points within a simplex? Based on barycentric interpolation Solve analytically Alternative method: Iterative approach based on 2D / 3D nested intervals Recursive subdivision into 4 / 8 sub-regions if critical point is contained in cell 47 Applied Visualization, SS0 Vector field topology Example: topological graph of 2D flow field 48 Applied Visualization, SS0
Vector field topology Example: depiction of integral curves Image: A Combinatorial Introduction to Topology, Michael Henle 49 Applied Visualization, SS0 Vector field topology Sectors and Separatrices In the vicinity of a critical point, there are various sectors or regions of different flow type Hyperbolic: paths do not ever reach the critical point Parabolic: one end of all paths is at the critical point Elliptic: all paths begin & end at the critical point A separatrix is the bounding curve (or surface) which separates these regions 50 Applied Visualization, SS0
Vector field topology Sectors and Separatrices (cont.) Images: A topology simplification method for 2D vector fields. Xavier Tricoche, Gerik Scheuermann, Hans Hagen, IEEE Visualization 2000 5 Applied Visualization, SS0 Vector field topology Sectors and Separatrices (cont.) Planar topology of a vector field is a graph with the critical points as nodes and the separatrices as edges 52 Applied Visualization, SS0
Vector field topology Further examples Topology-guided streamline positioning 53 Applied Visualization, SS0 Vector field topology Summary Draw only relevant streamlines (topological skeleton) Partition domain in regions with similar flow features Based on critical points Good for 2D stationary flows Unsteady flows? 3D? 54 Applied Visualization, SS0