• 沒有找到結果。

Data Representation

N/A
N/A
Protected

Academic year: 2022

Share "Data Representation"

Copied!
57
0
0

加載中.... (立即查看全文)

全文

(1)

Data Representation

(2)

Continuous Data Sampled Data Discrete Datasets Cell Types

•vertex, line, triangle, quad, tetrahedron, hexahedron

Grid Types

•Uniform, rectlinear, structured, Unstructured Attributes

•Scalar, Vector, Color, Tensor, Non-numerical

outli ne

(3)

Continuous Data versus Discrete Data

•Continuous Data

•Most scientific quantities are continuous in nature

•Scientific Visualization, or scivis

•Discrete Data

•E.g., text, images and others that can not be interpolated or scaled

•Information Visualization, or infovis

•Continuous data, when represented by computers, are always in discrete form

•These are called “sampled data”

•Originated from continuous data

•Intended to approximate the continuous quantity through visualization

(4)

Continuous Data

2 2

( ) )

( '' ) ,

) ( ( ),

( dx

x f

x d dx f

x x df

f x

f   

a: discontinuous function

b: first-order

continuous function:

first-order

derivative is not continuous

c: high-order continuous function

(5)

Continuous Data

f is a d-dimension, c-valued function D: function domain

C: function co-domain

) ....

, (

) ....

, (

C D

C D

:

2 1

2

1 c d

c d

x x

x f

y y

y f

R R

Continuous data can be modeled as:

(6)

Continuous Data

||

f(p ) -

f(x)

||

then

||

p - x

||

if such that

0 0,

Cauchy criterion of continuity

Graphically, a function is continuous if the graph of the function is a connected surface without “holes” or “jumps”

A function is continuous of order k if the function itself and all its derivative up to order k are also continuous

In words, small changes in the input result in small changes in the output

Graphically, a function is continuous if the graph of the function is a connected surface without “holes” or “jumps”

In words, small changes in the input result in small changes in the output

(7)

•Geometric dimension: d

• the space into which the function domain D is embedded

•It is always 3 in the usual Euclidean space: d=3

•Topological dimension: s

•The function domain D itself

•A line or curve: s=1, d=3

•A plane or curved surface: s=2, d=3

•Dataset dimension refers to the topological dimension

•Function values in the co-domain are called dataset attributes

•Attribute dimension: dimension of the function co-domain

f) C,

 (D,

D

c 1. D: Function domain

2. C: Function co-domain 3. f: Function itself

(8)

Sampling and Reconstruction

f f

f i ~

(9)

Sampled data

• Sampling: from continuous dataset to Sampled data

• Reconstruction:

from Sampled data

to recover/approximate

continuous dataset

(10)

Sampled Dataset

Sampled dataset

f) C,

 (D,

D

}) ({ p

i

}, {C

i

}, {f

i

},{Φ

ik

s

 D

Continuous dataset

1. p: sampling points 2. c: cells

3. f: sampled values

4. Φ: basis function or interpolation function

(11)

A signal domain is sampled in a grid that contains a set of cells defined by the sample points

Point, Cell, Grid

Sampling

(12)

Sampling

D 0

} ....

, {

,

2 1

i i

j i

d d

i

c U

j i

, c

c

p p

p ci

p R

Point Cell

Grid

(13)

Reconstruction

function basis

called is

where

~

...}

2 , 1 { },

i 1

 

N

i

i i i

f f

i {f

or interpolation function Piecewise fitting: one cell one time

(14)

Reconstruction

Linear basis function

r f r

f r

f

r r

r r

2 1

1 2 1 1

) 1

( )

(

, )

(

, 1

) (

For 1-D line

P1 P2

0 r 1 reference cell

(15)

Basis Function

Basis function shall be orthonormal

1.Orthogonal: only vertex points within the same cell have contribution to the interpolated value

2.Normal: the sum of the basic functions of the vertices shall be unity.

(16)

Basis Function

Linear basis function For 2-D quad

s r s

r

rs s

r

s r

s r

s r

s r

) 1

( )

, (

) ,

(

) 1

( )

, (

) 1

)(

1 ( )

, (

1 4 1

3 1 2 1 1

(17)

Sampled Dataset

Sampled dataset

f) C,

 (D,

D

}) ({ p

i

}, {C

i

}, {f

i

},{Φ

ik

s

 D

Continuous dataset

p: sampling points c: cells

f: sampled values

Φ: basis function or interpolation function

(18)

cell=(p1,p2,p3,p4) D: (x,y,z)

cell=(v1,v2,v3,v4) D: (r,s,t) and t=0

Basis Function

(19)

Coordinate Transformation

•Basis function is defined in reference cell

•Reference cell: axis-aligned unit cell, e.g., unit square in 2-D, unit line in 1-D

•Data are sampled at actual (world) cells

•Mapping between actual cell and reference cell

N

i

i

i

T x y z

f z

y x

f

z y x

T t

s r z

y x

z y x

T t

s r

t s r T

z y x

1

1 1

1 1

)) ,

, ( (

) ,

,

~ (

)) ,

, ( (

) , , ( )

, ,

(

) ,

, ( )

, , (

) , , ( )

, ,

(

(20)

Discrete Datasets

• A Grid = cells + sample points

• Sample Values at cell centers/vertices

• Basis functions

(21)

Cell types

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

(22)

Vertex

d=0

1 )

, (

} {

0 1

1

s r

v c

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

(23)

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

Line

d=1

2 1

2

1 2

1 1 1

2 1 1

2 1

||

||

) (

) ) (

, ,

( ) (

1 )

(

} ,

{

p p

p p

p z p

y x

T

r r

r r

v v

c

 

(24)

Line (cont.)

Actual line d=1

1 2

1 2

1 2

2 1

1 2

1

2 2

1

1

, ,

x x

x f x

x x

x f x

f

x x

x r x

x p

x p

x p

 

 

 

  

Actual line d=2

2 1 2

2 1 2

1 2

1 1

2 1

2 2

2 1

1 1

) (

) (

) )(

( )

)(

(

) ,

( ),

, (

), ,

(

y y

x x

y y

y y

x x

x r x

y x p

y x

p y

x p

 

  

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

(25)

Triangle

d=2

2 1 3

1 3

1

2 1 2

1 2

1 1

1 3 1 2 1 1

3 2

1

||

||

) (

) (

||

||

) (

) (

) , ( )

, , (

) , (

) , (

1 )

, (

} ,

, {

p p

p p

p s p

p p

p p

p r p

s r z

y x T

s s

r

r s

r

s r

s r

v v

v c

 

 

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

(26)

Quad

d=2

2 1

4

1 4

1

2 1

2

1 2

1 1

4 1

3 1

2 1 1

4 3

2 1

||

||

) (

) (

||

||

) (

) (

) 1

( )

, (

) ,

(

) 1

( )

, (

) 1

)(

1 ( )

, (

} ,

, ,

{

p p

p p

p s p

p p

p p

p r p

s r s

r

rs s

r

s r

s r

s r

s r

v v

v v

c

 

 

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

(27)

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

Tetrahedron

d=3

2 1 4

1 4

1

2 1 3

1 3

1

2 1 2

1 2

1 1

1 4 1

3 1 2 1 1

4 3

2 1

||

||

) (

) (

||

||

) (

) (

||

||

) (

) (

) , , ( )

, , (

) , (

) , (

) , (

1 )

, (

} ,

, ,

{

p p

p p

p t p

p p

p p

p s p

p p

p p

p r p

t s r z

y x T

t s

r

s s

r

r s

r

t s

r s

r

v v

v v c

 

 

 

(28)

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

Hexahedron

d=3

st r

s r

rst s

r

t s r

s r

t s r

s r

t r

s r

t rs

s r

t s

r s

r

t s

r s

r

v v

v v

v v

v v

c

) 1

( )

, (

) , (

) 1

( )

, (

) 1

)(

1 ( )

, (

) 1

)(

1 ( )

, (

) 1

( )

, (

) 1

)(

1 ( )

, (

) 1

)(

1 )(

1 ( )

, (

} ,

, ,

, ,

, ,

{

1 8 1 7 1

6 1

5 1

4 1

3 1

2 1 1

8 7

6 5

4 3

2 1

(29)

• Vertex

• Line

• Triangle

• Quad

• Rectangle

• Tetrahedron

• Hexahedron

• Parallelipiped

• Pyramid

• prism

Hexahedron (cont.)

d=3

2 1

8

1 8

1

2 1

4

1 4

1

2 1

2

1 2

1 1

||

||

) (

) (

||

||

) (

) (

||

||

) (

) (

) , , ( )

, ,

(

p p

p p

p t p

p p

p p

p s p

p p

p p

p r p

t s r

z y

x T

 

 

 

(30)

Effect of Reconstruction

Geometry:

Constant

Geometry:

Linear Lighting:

Constant

Staircase shading

Flat

Shading Lighting:

Linear

--- Smooth

(Gouraud)

shading

(31)

Effect of Reconstruction

Staircase Shading Flat Shading Smooth Shading

(32)

Grid types

• Grid is the pattern of cells in the data domain

• Grid is also called mesh

• Uniform grid

• Rectilinear grid

• Structured grid

• Unstructured grid

(33)

Uniform Grid

2-D 3-D

(34)

Uniform Grid

•The simplest grid type

•Domain D is usually an axis-aligned box

•Line segment for d=1

•Rectangle for d=2

•parallelepiped for d=3

•Sample points are equally distributed on every axis

•Structured coordinates: the position of the sample points in the data domain are simply indicated by d integer coordinates (n1,..nd)

•Simple to implement

•Efficient to run (storage, memory and CPU)

(35)

Uniform Grid

•Data points are simply stored in the increasing order of the indices, e.g, an 1-D array

•Lexicographic order

2 1

3 1

2 1

1 2

1

1 2

1 2

1

2

1

1 1

3, d

If

mod 2, d

If

) (

N N n

N n

n i

) N (n

i n

i/N n

, or N

n n

i

N n

n i

d

k

k

l

l k

  

(36)

Rectilinear Grid

2-D 3-D

(37)

Rectilinear Grid

•Domain D is also an axis-aligned box

•However, the sampling step is not equal

•It is not as simple or as efficient as the uniform grid

•However, improving modeling power

(38)

Structured Grid

•Further relaxing the constraint, a structured grid can be seen as the free deformation of a uniform or rectilinear grid

•The data domain can be non-rectangular

•It allows explicit placement of every sample points

•The matrix-like ordering of the sampling points are preserved

•Topology is preserved

•But, the geometry has changed

(39)

Structured Grid

Circular domain Curved Surface 3D volume

(40)

Unstructured Grid

•It is allowed to define both sample points and cells explicitly

•The most general and flexible grid type

•However, it needs to store

•The coordinates of all sample points pi

•For each cell, the set of vertex indices ci={vi1,…viCi), and for all cells {c1,c2…}

(41)

Unstructured Grid

(42)

•Attribute data is the set of sample values of a sampled dataset

•Attribute = {f

i

}

}) ({ p

i

}, {C

i

}, {f

i

},{Φ

ik

s

 D

Sampled dataset

Attributes

(43)

Attribute Types

•Scalar Attribute

•Vector Attribute

•Color Attribute: c=3

•Tensor Attributes

•Non-Numerical Attributes

1 C

c

R

c

3 or

, 2 C

c c

R

c

(44)

•Scalar, Vector, Color, Tensor, Non-numerical

Scalar Attributes

•E.g., temperature, density,

R R

R R

3 2

:

or , :

f

f

(45)

•Scalar, Vector, Color, Tensor, Non-numerical

Vector Attributes

•E.g.,

•Normal

•Force

•velocity

•A vector has a magnitude and orientation

3 2

R R

R R

3 2

:

or , :

f

f

(46)

•Scalar, Vector, Color, Tensor, Non-numerical

Tensor Attributes

•A high-dimensional generalization of vectors

V V

Vy Vx

V

V V V

V

V V V

V

By Ay Bx

Ay

By Ax Bx

Ax





 

) ,

(

, ,

B A

V V V

Tensor Vector Scalar

•A tensor describes physical quantities that depend on direction

Vector and scalar describes physical quantities that depend on position only

(47)

•Scalar, Vector, Color, Tensor, Non-numerical

Tensor Attributes

•E.g. curvature of a 2-D surface

•E.g., diffusivity, conductivity, stress

Tensor

(48)

•Scalar, Vector, Color, Tensor, Non-numerical

Non-numerical Attributes

•E.g. text, image, voice, and video

•Data can not be interpolated

•Therefore, the dataset has no basis function

•Domain of information of visualization (infovis)

(49)

Scalar, Vector, Color, Tensor, Non-numerical

Color Attributes

•A special type of vector attributes with dimension c=3

•RGB system: convenient for hardware and implementation

R: red G: green B: blue

•HSV system: intuitive for human user

H: Hue

S: Saturation V: Value

(50)

RGB System

•Every color is represented as a mix of “pure” red, green and blue colors in different amount

•Equal amounts of the three colors determines gray shades

•RGB cube’s main diagonal line connecting the points

(0,0,0) and (1,1,1) is the locus of all the grayscale value

(51)

RGB Cube

R

G

B

yellow magenta

Cyan

(52)

HSV System

•Hue: distinguish between different colors of different wavelengths, from red to blue

•Saturation: represent the color of “purity”, or how much hue is diluted with white

S=1, pure, undiluted color S=0, white

•Value: represent the brightness, or luminance

V=0, always dark

V=1, brightest color for a given H and S

(53)

HSV System

HSV Color Cone

(54)

Color, Light,

Electromagnetic Radiation

(55)

RGB to HSV

•All values are in [0,1]

max=max(R,G,B) min=min(R,G,B) diff=max-min

•V = max

•largest RGB component

•S = diff/max

•For hue H, different cases

•H = (G-B)/diff if R=max

•H =2+(B-R)/diff if G=max

•H =4+(R-G)/diff if B=max

•then H=H/6

•H=H+1 if H < 0

•Exp: Full Green Color

•(R,G,B)=(0,1,0) 

•(H,S,V)=(1/3, 1,1)

•Exp: Yellow Color

•(R,G,B)=(1,1,0) 

•(H,S,V)=(1/6, 1, 1)

(56)

HSV to RGB

•huecase = {int} (h*6)

•frac = 6*h – huecase

•lx= v*(1-s)

•ly= v*(1-s*frac)

•lz= v*(1-s(1-frac))

•huecase =6 (0<h<1/6): r=v, g=lz, b=lx

•huecase =1 (1/6<h<2/6): r=ly, g=v, b=lx

•huecase =2 (2/6<h<3/6): r=lx, g=v, b=lz

•huecase =3 (3/6<h<4/6): r=lx, g=ly, b=v

•huecase =4 (4/6<h<5/6): r=lz, g=lx, b=v

•huecase =5 (5/6<h<1): r=v, g=lx, b=ly

•Exp: Full Green Color

•(H,S,V)=(1/3,1,1) 

•(R,G,B)=(0,1,0)

•Exp: Yellow Color

•(H,S,V)=(1/6,1,1) 

•(R,G,B)=(1,1,0)

(57)

Conclusion

•Fundamental issues involved in representing data for visualization applications

•A set of data cells

•Data attributes, several types: scalar vector color and tensor

•Basis function: constant and linear

Simplicity of implementation and direct support in the graphics hardware

•Grid Types: uniform, rectilinear, structured and

unstructured grids

參考文獻

相關文件

It has been well-known that, if △ABC is a plane triangle, then there exists a unique point P (known as the Fermat point of the triangle △ABC) in the same plane such that it

In the algorithm, the cell averages in the resulting slightly non-uniform grid is updated by employing a finite volume method based on a wave- propagation formulation, which is very

Now given the volume fraction for the interface cell C i , we seek a reconstruction that mimics the sub-grid structure of the jump between 0 and 1 in the volume fraction

Population: the form of the distribution is assumed known, but the parameter(s) which determines the distribution is unknown.. Sample: Draw a set of random sample from the

Using a one-factor higher-order item response theory (HO-IRT) model formulation, it is pos- ited that an examinee’s performance in each domain is accounted for by a

• When a number can not be represented exactly with the fixed finite number of digits in a computer, a near-by floating-point number is chosen for approximate

• An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output.. • An algorithm is

In digital systems, a register transfer operation is a basic operation that consists of a transfer of binary information from one set of registers into another set of