other dvr algorithms and a comparison jian huang, cs 594, spring 2002

29
Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Upload: emery-joseph

Post on 16-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Other DVR Algorithms and A Comparison

Jian Huang, CS 594, Spring 2002

Page 2: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Papers Covered

• P. Lacroute et. al, SIGGRAPH’94 (shear-warp)

• B. Cabral et. al, VolViz’94 (3D texture mapping)

• M. Meissner et. al, VolViz’2000 (A practical comparison of the four main volume rendering algorithms)

Page 3: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Goal – speed!!• Approach: make viewing rays parallel to each other and

perpendicular to the image– Achieved by a simple shear

shear

warp

Original method only works with orthogonal projection, later extended to perspective projection but less efficient and less known.

Page 4: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Stop rays in every sheared slice and use bilinear interpolation to

estimate a sample value– only interpolate in-slice, not between slices as in usual raycasting– cheap bilinear interpolation instead of trilinear interpolation in raycasting

• Volume is projected onto a baseplane parallel to the volume slices– NOT the image plane: the resulting image is called intermediate image

• Undo the shearing by warping the intermediate image onto the true image plane (use M-1

shear, the inverse of M-shear )

• The mapping of the pixels in the intermediate image to the true image is done via resampling, using another bilinear interpolation

Page 5: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm

Page 6: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• General algorithm:

warpview MSPM

• Where– Mview = general viewing matrix

– P = permutation matrix, which transposes the coordinate system in order to make the z-axis the principal viewing axis

– S = transforms volume into sheared object space

– Mwarp = sheared object coordinates into image coordinates

Page 7: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Parallel vs. Perspective

1000

0100

010

001

pary

x

s

s

S

100

0100

010

001

persp

w

y

x

s

s

s

S

shear

warp

Page 8: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Three properties:

1. scanlines of pixels in the intermediate image are parallel to scanlines of voxels in the volume data

2. (orthogonal projection only) all voxels in a given voxel slice are scaled by the same factor

3. (orthogonal projections only) every voxel slice had the same scale factor, and this factor can be chosen arbitrarily. In particular, we can choose a unity scale factor so that for a given voxel scan-line there is a one-to-one mapping between voxels and intermediate image pixels.

Page 9: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Property one leads to dynamic screen type data structure:

skipwork

skip skip

work

resample and composite

transparent voxel run

non-transparent voxel run

opaque image pixel run

non-opaque image pixel run

Page 10: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Parallel projection:

– efficient reconstruction

– lookup table for shading

– lookup table for opacity correction (thickness)

– three RLE of the actual volume (in x, y, z)

• Perspective Projection:– similar to parallel projection

– except - voxels also need to be scaled!

– Hence more than two voxel scan-lines needed for one image scan-line

Page 11: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Fast classification:

– classification through density and gradient of density– consider “block” of volume, that contains the scan-line– is it transparent?– Yes - if whole block is transparent– No - subdivide block– transparent blocks - lookup through summed area table

SAT

Page 12: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Shear Warp Algorithm• Advantage: Very fast when opacity transfer function is kept

constant

• Disadvantages:– Need to encode the volume after each opacity transfer

change– Need 3 encoded volumes, one for each main viewing axis– True sampling rate in z varies between [1.0, 1.72] due to

shearing• thus Nyquist theorem is almost always violated• leads to staircasing artifacts for diagonal views (e. g., at 45°)

– Always pre- shaded, no post-shading. Blurred zoom-in views

Page 13: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Texture Mapping

2D image 2D polygon

+

Textured-mappedpolygon

Page 14: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Texture Mapping (2)

(0,0) (1,0)

(0,1) (1,1)

Each texel has 2D coordinates assignedto it.

assign the texture coordinatesto each polygon to establish the mapping

(0,0.5) (0.5,0.5)

(0,0) (0.5,0)

Page 15: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Tex. Mapping for Volume Rendering

Remember ray casting …

y

z

Page 16: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Texture based volume rendering

x

z

y

• Render each xz slice in the volume as a texture-mapped polygon• The texture contains RGBA (color and opacity) • The polygons are drawn from back to front

Page 17: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Texture based volume rendering

Algorithm: (using 2D texture mapping hardware)

Turn off the z-buffer; Enable blendingFor (each slice from back to front) { - Load the 2D slice of data into texture memory - Create a polygon corresponding to the slice - Assign texture coordinates to four corners of the polygon - Render and composite the polygon (use OpenGL alpha blending)}

Page 18: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Some Considerations… (2)

What if we change the viewing position?

That is okay, we justchange the eye position(or rotate the polygons and re-render),

Until …

y

z

Page 19: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Some Considerations… (3)

Until …

y

z

You are not going to see anything this way …

This is because the view direction now is Parallel to the slice planes

What do we do?

Page 20: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Some Considerations… (4)

y

z

What do we do?

• Change the orientation of slicing planes

• Now the slice polygons are parallel to XZ plane in the object space

• We need to reorganize the input textures

• Reorganize the textures on the fly is too time consuming. We might want to prepare this texture sets beforehand

Page 21: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Some Considerations… (5)

When do we need to change the slicing planes?

?

y

z

When the major component of view vector changes from z to y

Page 22: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Some Considerations… (6)

Major component of view vector?

Normalized view vector (x,y,z) -> get the maximum one

If x: then the slicing planes are parallel to yz planeIf y: then the slicing planes are parallel to xz planeIf z: then the slicing planes are parallel to xy plane

-> This is called (object-space) axis-aligned method.

Therefore, we need to keep three copies of data aroundall the time!!

Page 23: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Problem

Object-space axis-alighed method can create artifact:Poping Effect

y

z

V = 44.999

V = 45.0001

There is a sudden change of viewing slicing (and thus the samplingrate) then the view vector transits from one major direction to another.The change in the result image intensity can be quite visible

Page 24: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Solution

Use image-aligned slicing plane: the slicing planes are always parallel to the image plane

Page 25: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

3D Texture Mapping

Arbitrary slicing through the volume and texturemapping capabilities are needed

- Arbitrary slicing polygon: this can be computed using software in real time

This is basically polygon-volumeclipping

Page 26: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

3D Texture Mapping

Texture mapping to the arbitrary slices

This requires 3D texture mapping harware

Input texture: volume (pre-classified and shaded) essentially an (R,G,B,) volume

Depending on the position of the polygon, appropriate textures are resampled, constructed andmapped to the polygon.

Page 27: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Solid (3D) Texture Mapping

Now the input texture space is 3D

Texture coordinates: (r,s,t)

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

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

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

(r0,s0,t0) (r1,s1,t1)

(r2,s2,t2) (r3,s3,t3)

Page 28: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

Pros and ConsAdvantages: - Fast with volume sizes that the hardware can take e.g. 2 fps for 256 cube volumes - No popping effect Disadvantages: - Need to compute the slicing planes for every view angle - only supported on high end hardware - low quality without per-pixel classification shading and classification (i.e. post-classification and shading)

Both 2D or 3D hardware texture mapping methods can not computeShading on the fly. The input textures have to be pre-shaded.

With multi-texturing functions, per-pixel shading and classification arebecoming possible.

Page 29: Other DVR Algorithms and A Comparison Jian Huang, CS 594, Spring 2002

A Practical Comparison

• Quality is directly correlated with – how closely the volume ray integration can be approximated – and the quality of volume reconstruction– post-reconstruction shading and classification are key to visual

sharpness of renderings.

• Ray-casting and image-aligned splatting are of high quality, each is more efficient for different types of data sets

• Not considering limitations of hardware precision, 3D texture mapping can achieve high quality as well

• Shear-warp is fast but poor quality