• Keine Ergebnisse gefunden

Nonlinear Diffusion in Graphics Hardware

N/A
N/A
Protected

Academic year: 2021

Aktie "Nonlinear Diffusion in Graphics Hardware"

Copied!
26
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Nonlinear Diffusion in Graphics Hardware

Based on the homonymous paper by Martin Rumpf and Robert Strzodka

Pascal Gwosdek

13.06.07

(2)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Diffusion

Figure: Linear (top) and nonlinear (bottom) diffusion.Authors:M. Rumpf and R. Strzodka.

(3)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Graphics Hardware

Today: GPUs superior to CPUs in computing power

But: GPUs specialized Restricted range of values Less accuracy

Restricted set of instructions Parallelism dominates sequential

execution by design

Figure: Performance of ATI/AMD GPUs and CPUs.Authors:wired.com, Pascal Gwosdek

(4)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

OpenGL Rendering pipeline

Pixel Data

Pixel Operations Display List

Vertex Data

Evaluators

Rasterization Per-vertex operations and

p r i m i t i v e assembly Per-fragment

operations

Framebuffer Texture

assembly

Figure: The OpenGL rendering pipeline.Authors:OpenGL Architecture Review Board, Pascal Gwosdek

(5)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

OpenGL Rendering pipeline (simplified)

Pixel Data

Pixel Operations Display List

Vertex Data

Evaluators

Rasterization Per-vertex operations and

p r i m i t i v e assembly Per-fragment

operations

Framebuffer Texture

assembly

Figure: The OpenGL rendering pipeline.Authors:OpenGL Architecture Review Board, Pascal Gwosdek

(6)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Figure: Linear combination.Authors:MIA Group, Informationsdienst Wissenschaft e.V., Pascal Gwosdek

Linear combination by glBlendFunc:

result = 0.3· Weickert+0.7· ~ Bruhn ~

(7)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Figure: Multiplication.Authors:MIA Group, Informationsdienst Wissenschaft e.V., Pascal Gwosdek

Componentwise multiplication by glBlendFunc:

result ij = Weickert ~ ij • Bruhn ~ ij

(8)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Figure: Function application.Authors:MIA Group, Pascal Gwosdek

Function application by glPixelMap:

result ij = F ( Weickert ~ ij )

result = F ◦ Weickert ~

(9)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Figure: Index shift.Authors:MIA Group, Pascal Gwosdek

Index shift by change of drawing positions:

result = T γ ◦ Weickert ~

(10)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Figure: Histogram for vector norm.Authors:MIA Group, Pascal Gwosdek

With histograms provided by glGetHistogram, vector norms are easier to compute:

|| Weickert|| ~ k = X n x=0

x k · H(x)

!

1k

(11)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Inner products can be written as norm of componentwise vector products:

h X ~ , ~ Y i = || X ~ • Y ~ || 1

(12)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Vector matrix products can be computed by A X ~ =

X n−1 γ=0

T γ ◦ ( A ~ γ • X ~ ).

with A ~ γ as the composed diagonal vector of A = (a ij ) ij ∈ R n × R n

s.t. γ = j − i mod n.

(13)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Operations

Example: Vector matrix product

1 2 3 4 5 6 7 8 9

 ·

 1 2 3

 =

1 · 1 + 2 · 2 + 3 · 3 4 · 1 + 5 · 2 + 6 · 3 7 · 1 + 8 · 2 + 9 · 3

=

1 · 1 + 2 · 2 + 3 · 3 5 · 2 + 6 · 3 + 4 · 1 9 · 3 + 7 · 1 + 8 · 2

= T 0

 1 · 1 5 · 2 9 · 3

 + T 1

 7 · 1 2 · 2 6 · 3

 + T 2 ◦

 4 · 1 8 · 2 3 · 3

(14)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Overview and Introduction OpenGL Rendering pipeline Operations

Numbers

Graphics hardware is restricted to a fixed point number range from 0 to 1. This turns out to be a technical issue only.

−ρ 0 ρ

0 1 2 1

→ perform linear scaling

(15)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Perona-Malik

Solving the equation system Algorithm

Perona-Malik

The authors use the modification of the Perona-Malik model proposed by Catt´e, Lions, Morel, and Coll:

t u − div (g (∇u ε ) ∇u) = 0, in R + × Ω, u (0, ·) = u 0 , on Ω,

∂ν u = 0, on R + × ∂Ω.

(16)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Perona-Malik

Solving the equation system Algorithm

Discretization

The model is discretized in a semi-implicit manner using forward difference and applying the finite element method, which finally yields

I + τ h 2

g

−→

U ε k

∇ Φ c α , ∇ Φ c β

αβ

!

−→

U k+1 =

−→

U k ,

This formula constitutes a linear system of equations of the form A k

U ~ k

U ~ k+1 = ~ R U ~ k

.

(17)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Perona-Malik

Solving the equation system Algorithm

Solving the equation system

Two iterative solvers for the linear equation system are compared:

The Jacobi Iteration F

X ~ i

= D −1

R ~ − (A − D) X ~ i , with D as the diagonal of A and

the Conjugate Gradient (CG) method, which is based on a minimization problem for

Φ( X ~ ) = 1

2 X ~ T A X ~ − X ~ T R.

(18)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Perona-Malik

Solving the equation system Algorithm

Algorithm

nonlinear diffusion {

load image, parameters init hardware

encode image U ~

0

forall (timesteps k ) {

store R ~

k

← U ~

k

calc diffusivity A init solver X ~

0

← U ~

k

forall (iterations l )

calc X ~

l+1

← F “

~ X

l

store U ~

k+1

← X ~

l+1

decode U ~

k+1

and display }

}

(19)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Results

Figure: Comparison of different solvers.Top:Adaptive software preconditioned CG [sic!].Middle:Jacobi solver on graphics hardware.Bottom:CG solver on graphics hardware.Authors:M. Rumpf and R. Strzodka.

(20)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Results

Figure: Comparison of different solvers (Zoom).Left:Adaptive software preconditioned CG [sic!].Middle:Jacobi solver on graphics hardware.Right:CG solver on graphics hardware.Authors:M. Rumpf and R. Strzodka.

(21)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Results

Method t / 100 iterations

CG solver in software ”fast”

Jacobi solver on NVidia GeForce2 Ultra ≈ 1.7 sec

Jacobi solver on SGI Onyx2 17 sec

CG solver on SGI Onyx2 42 sec

Table: Comparison of different solvers, for 256×256 px images.Note:The authors do not mention the time of the reference implementation, but speak of ”surprisingly weak performance” of the ”slower” hardware implementations on the SGI Onyx.Authors:M. Rumpf and R. Strzodka.

(22)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Discussion

Possible reasons for the weak performance:

read back of framebuffer about 60 times slower than writing

glGetHistogram slow

Figure: Excerpt of the OpenGL rendering pipeline.

Authors:OpenGL Architecture Review Board, Pascal Gwosdek

(23)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Summary

Linear algebra in graphics hardware Nonlinear diffusion

Overview Implementation Results

Problems

(24)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

References

OpenGL Architecture Review Board, Dave Shreiner, Mason Woo, Jackie Neider, and Tom Davis.

OpenGL Programming Guide.

http://www.opengl.org/documentation/red book/.

E. Bruce Pitman.

Conjugate Gradient Method.

http://www.ccr.buffalo.edu/class-notes/hpc2-00/

odes/node4.html, 2000.

Martin Rumpf and Robert Strzodka.

Nonlinear Diffusion in Graphics Hardware.

In Proceedings of EG/IEEE TCVG Symposium on Visualization VisSym ’01, pages 75–84. Universit¨ at Bonn, Springer, 2001.

Robert Strzodka.

Hardware Efficient PDE Solvers in Quantized Image Processing.

PhD thesis, Fachbereich Mathematik der Universit¨ at Duisburg-Essen, 2004.

Wikipedia.

Finite Element Method.

http://en.wikipedia.org/wiki/Finite element method,

2007.

(25)

Graphics Hardware Nonlinear Diffusion Results and Conclusion

Results Discussion Summary

Discussion

Thank you!

Please feel free to ask questions.

(26)

CG Solver

Solving the equation system - The CG method

The CG solver is given by

F X ~ i

= X ~ i +

D r ~ i , ~ r i E D A p ~ i , ~ p i E · p ~ i ,

with the search directions p ~ i = r ~ i +

D r ~ i , ~ r i E

D r i ~ −1 , ~ r i−1 E · p i−1 ~

and the residuals

r ~ i = ~ R − A X ~ i .

Referenzen

ÄHNLICHE DOKUMENTE

The following procedures could expose you to hazardous voltages. To avoid pos- sible personal injury and damage to the graphics controller, always turn off the power switch,

Using the Graphics Tablet Some General Guidelines The Pen Cartridge The Pen Switch The Tablet's Sensitivity The Lexan Writing Surface The Tablet Switches The Tablet's Active

[r]

The original values of the control points for each invocation are compared to the new values, and, if they vary, the using statements associated with these invocations each

The VIEWPORT statement establishes viewport boundar ies or assigns the values of the current boundaries to variables. The SET VIEWPORT statement establishes the

Also Included In the GRAPHICS ANIMATION package Is a CHARACTER MAKER program to aid you In creating your own graphics characters and saving them for Inclusion

Experimental results using synthetic and real-world data sets showed that our GPU algorithm provide a significant speed improvement over the CPU algo- rithm, with linear scalability

X'aaaa' Denotes the display storage address within the current page (that is, a word boundary) to which a branch will be made if the specified conditions are satisfied. The