Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Leif Kobbelt
Types of Data
dimension of nD
data type
3D
2D
1D
0D
1D
2
2D
3D
nD
dimension of
domain
1D scalar field:
IR IR
2D scalar field:
IR 2 IR
1D manifold: line
{( s, t , f ( s, t ) | ( s, t ) IR 2 }
2D manifold: surface
Surface representations
Wireframe
Hidden lines
Shaded surface
Isolines
Visualization of 2D scalar fields
Given a scalar function f : IR
and a scalar value
Isoline consists of points
{( x, y ) | f ( x, y ) c}
Isolines
10
10
Isolines
11
11
Isolines
pixel by pixel contouring
straightforward approach: scanning all pixels for isovalue
input
f : (1,...,xmax) x (1,...,ymax) R
Isovalues I1,..., In and isocolors c1,...,cn
algorithm
for all (x,y) (1,...,xmax) x (1,...,ymax) do
for all k { 1,...,n } do
if |f(x,y)-Ik| < then
draw(x,y,ck)
problem: isolinie can be missed if the gradient of f() is too large
(despite range )
12
12
Isolines
Marching squares
13
13
Isolines
Which cells will be intersected ?
14
14
Isolines
Only 4 different cases (classes) of combinations of signs
Symmetries: rotation, reflection, change + Compute intersections between isoline and cell edge,
based on linear interpolation along the cell edges
+
?
-
15
15
Isolines
We can distinguish the cases by a decider
Mid point decider
f center
1
( f i , j f i 1, j f i , j 1 f i 1, j 1 )
4
If fcenter < c we chose the right case, otherwise we chose the left case
+
-
16
16
Isolines
Asymptotic decider
Cell boundaries
Asymptote
Asymptote
17
17
Isolines
Interpolate the function bilinearly
f ( x, y ) f i , j (1 x)(1 y ) f i 1, j x(1 y ) f i , j 1 (1 x) y f i 1 j 1 xy
Transform f() to
f ( x, y ) ( x x0 )( y y0 )
18
18
(x0, y0)
Isolines
+
-
19
19
Isolines
Explicit transformation f() to
f ( x, y ) ( x x0 )( y y0 )
can be avoided
Idea: investigate the order of intersection points either
along x or y axis
Build pairs of first two and last two intersections
not possible
valid
20
20
21
21
Volumetric Representations
22
22
Volumetric Representations
F011
F001
F111
F101
F110
F000
23
23
F100
F(i+u,j+v,k+w) =
F000 (1-u)(1-v)(1-w) +
F100 u (1-v)(1-w) +
F010 (1-u) v (1-w) +
...
F111
u v w
Volumetric Representations
Indirect Rendering:
Isosurface extraction: Marching Cubes
Direct Rendering:
Ray Casting
24
24
Volume Data
discrete representation:
Fijk = F(i x, j y, k z)
25
25
Surface Extraction
26
26
Surface Sampling
in which voxel ?
27
27
Surface Sampling
in which voxel ?
F((i+u) x, (j+v) y, (k+w) z) =
28
28
Surface Sampling
in which voxel ?
Sc[F] passes through all (and only) voxels
with min Fijk c max Fijk
29
29
Surface Sampling
in which voxel ?
Sc[F] passes through all (and only) voxels
with min Fijk c max Fijk
how to find these voxels efficiently ?
30
30
Surface Sampling
in which voxel ?
Sc[F] passes through all (and only) voxels
with min Fijk c max Fijk
how to find these voxels efficiently ?
- store min/max {Fijk,Fijk+1,Fij+1k,Fij+1k+1,
Fi+1jk,Fi+1jk+1,Fi+1j+1k,Fi+1j+1k+1}
- build octree
31
31
Min/Max Tree
32
Surface Sampling
33
33
Surface Sampling
34
34
35
35
Surface Sampling
36
36
Error Quadrics
squared distance to plane:
T
T
v x, y, z ,1 ,
p a , b, c , d
2
2
T
dist p, v p , v vT pp T v : vT QP v
a 2 ab ac ad
2
ab b bc bd
QP
ac bc c 2 cd
2
ad bd cd d
dist p, v
2
planes p
37
37
planes p
vT Q p v vT
T
Q
v
:
v
Qv v
p
planes p
Error Quadrics
optimal point that minimizes the error:
T
n p n p v d p n p
p a p , bp , c p , d p
:
n
with
n
1
p
p
38
Surface Data
39
39
approximate samples
linear interpolation of scalar distance values
along cell edges
look-up table with pre-computed triangulations
28 entries, many symmetries
40
40
41
41
d i , j ,k
i
, j, k
d
i
,
j
,
k
i
1
,
j
,
k
42
42
d i , j ,k
i, j
,k
d
i
,
j
,
k
i
,
j
1
,
k
43
43
d i , j ,k
i, j , k
d i , j ,k d i , j ,k 1
44
44
...
45
45
46
46
47
47
Feature Classification
Normal cone
for a smooth (flat)
non-feature region
48
48
Feature Classification
Normal cone
for a smooth (flat)
non-feature region
49
49
Feature Classification
Normal cone
for an edge feature
(one large angle)
50
50
Feature Classification
51
51
Feature Classification
Normal cone
for a corner feature
(two large angles)
52
52
Feature Detection
53
53
Feature Sampling
54
54
...
55
55
...
56
56
Feature Reconstruction
feature
detection
57
57
feature
sampling
edge-flipping
Results
Mesh complexity
Two additional triangles per feature sample
Typically 10% overhead
Computation time
20% to 40% overhead
Improved approximation
Parameters 0 and 0
False positive feature detection !?
Applications ...
58
58
65 x 65 x 65
59
59
60
60
65 x 65 x 65
Iso-Surface Extraction
61
61
Iso-Surface Extraction
62
62
Volumetric Representations
Indirect Rendering:
Isosurface extraction: Marching Cubes
Direct Rendering:
Ray Casting
63
63
Volume Rendering
64
64
Volume Rendering
65
65
Volume Rendering
66
66
Volume Rendering
67
67
Ray Casting
Maximum Intensity Projection
Maximum Smax
Scalar value S
68
68
ray
69
69
Absorption
Ray
I(s0)
s0
70
70
Absorption
Ray
I(s0)
s
s0
I(s0)
s0
71
71
Ray
q(s)
Ray Casting
c(r ) c( s ) e
0
72
72
( t ) dt
0
ds
Volumetric Representations
73
73
Opacity
base color c, opacity
damping factor 1- = e-
emitted color c
resulting (effective) color
c + (1-) cbackground
74
74
Ray Casting
75
75
Opacity Accumulation
Continous compositing
L
c(ui ) c(E D) e
( E tD ) dt
0
Discrete compositing
c(ui ) c( x j ) ( x j ) (1 ( xm ))
j 0
m 0
with c( xk ) cbkg , ( xk ) 1
K
76
76
j 1
Opacity Accumulation
cK
K
77
77
ci
i
c0
0
Opacity Accumulation
C[0..K]
cK
K
78
78
ci
i
c0
0
Opacity Accumulation
C[1..K]
cK
K
79
79
ci
i
back-to-front
c0
0
Opacity Accumulation
C[0..K-1]
cK
K
80
80
ci
i
front-to-back
c0
0
Back-to-Front Compositing
j 1
c( x j ) ( x j ) (1 ( xm ))
j 0
m 0
c( x0 ) ( x0 )
j 1
c( x j ) ( x j ) (1 ( xm )) (1 ( x0 ))
j 1
m 1
81
81
Front-to-Back Compositing
Iterative accumulation j = 0 .. K
C C c j j (1 )
j (1 )
with
j 1
(1 ) (1 m )
m 0
82
82
Transfer Functions
83
83
Transfer Functions
scalar value s
T(s)
emission RGB
absorption A
84
84
Transfer Functions
85
85
Transfer Functions
86
86
Transfer Functions
87
87
Transfer Functions
+ Shading
88
88
Transfer Functions
+ Shading
+ Color coding
89
89
90
90
Intensity
Compositing Schemes
Max
Accumulate
Average
First
Depth
91
91
Compositing Schemes
Intensity
Compositing: First
Extracts isosurfaces
First
Depth
92
92
Compositing Schemes
Intensity
Compositing: Average
Produces basically an X-ray picture
Average
Depth
93
93
Compositing Schemes
Intensity
Depth
94
94
Compositing Schemes
Intensity
Compositing: Accumulate
Emission-absorption model
Make transparent layers visible (- classification)
Accumulate
Depth
95
95
Volume Shading
Lighting / Shading
Phong model, Gouraud shading
F ( x , y , z )
Estimate normal by N ( x, y, z )
F ( x , y , z )
Approximate F(x,y,z) by central difference
F ( xi 1 , yi , zi ) F ( xi 1 , yi , zi )
1
F ( x, y, z ) F ( xi , yi 1 , zi ) F ( xi , yi 1 , zi )
2
F
(
x
,
y
,
z
)
F
(
x
,
y
,
z
)
i 1
i
i
i
i
i 1
96
96
Classification
assign spatial opacity values (xi, yi, zi)
assign for isovalues F(x,y,z) = (transfer
function)
isosurface ... = (=0) ... blur with radius r
1
,
F ( xi ) 0 F ( xi ) v
1 F ( xi ) v
( xi ) v 1
, F ( xi ) 0 F ( xi ) v F ( xi )
r F ( xi ) ,
otherwise
0
97
97
98
98
rF
99
99
rF
100
100
Ray Casting
Acceleration techniques
Spatial data structures (octree)
Find and skip empty regions
Find homogenous regions, use lower sample
rate
Early ray termination
Opacity threshold terminates ray traversal
Requires front-to-back traversal
Fast cell traversal (Bresenham-like)
101
101