Hardware-Based Nonlinear Hardware-Based Nonlinear Filtering and Segmentation Filtering and Segmentation using High-Level Shading using High-Level Shading Languages Languages I. Viola, A. Kanitsar, I. Viola, A. Kanitsar, M. M. E. E. Gr Gr öller öller Institute of Computer Graphics and Institute of Computer Graphics and Algorithms Algorithms Vienna University of Technology Vienna University of Technology Vienna, Austria Vienna, Austria
23
Embed
Hardware-Based Nonlinear Filtering and Segmentation using High-Level Shading Languages I. Viola, A. Kanitsar, M. E. Gröller Institute of Computer Graphics.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Hardware-Based Nonlinear Filtering Hardware-Based Nonlinear Filtering and Segmentation using High-Level and Segmentation using High-Level
Shading LanguagesShading Languages
I. Viola, A. Kanitsar, I. Viola, A. Kanitsar, M.M. E. GrE. Grölleröller
Institute of Computer Graphics and AlgorithmsInstitute of Computer Graphics and Algorithms
Vienna University of TechnologyVienna University of Technology
Filtering in Graphics HardwareFiltering in Graphics HardwareIssuesIssues
data representation: texturesdata representation: textures 3D texture3D texture stack of 2D texturesstack of 2D textures
access to value: texture fetchaccess to value: texture fetch neighborhood addressing: texture offsetneighborhood addressing: texture offset
we use 5 we use 5××55××5 neighborhood5 neighborhood filter implementation: perfilter implementation: per--fragment stagefragment stage results: rendered into off-screen bufferresults: rendered into off-screen buffer
9 / 23Ivan Viola Vienna University of Technology
TEXTURE STACK OFF-SCREEN BUFFER STACK
Data RepresentationData Representation
TEXTURE STACK OFF-SCREEN BUFFER STACK
10 / 23Ivan Viola Vienna University of Technology
Neighborhood AddressingNeighborhood Addressing
Two alternatives:Two alternatives:
directly in fragment programdirectly in fragment program requires additional computation requires additional computation
pre-compute in per-vertex stagepre-compute in per-vertex stage store in vertex attributesstore in vertex attributes interpolation “for-free”interpolation “for-free” swizzle operatorswizzle operator
11 / 23Ivan Viola Vienna University of Technology
+ float4(-2, 2, -1,1)IN.TEXCOORD0.xyxy
OUT.TEXCOORD0.xyzw=
Address Pre-computationAddress Pre-computation
IN.TEXCOORD0.xy
OUT.TEXCOORD0.xy =
+ float4(-2, 2
FILTER KERNEL
XY
X-2Y+2
X-1Y+1
PER-VERTEX STAGE
TEXCOORD0.xyTEXCOORD0.zw
TEXCOORD0.zyTEXCOORD0.xw
XY XW
ZWZY
12 / 23Ivan Viola Vienna University of Technology
Per-fragment StagePer-fragment Stage medical data - 12 bit precisionmedical data - 12 bit precision
fixed point 12-bit arithmeticsfixed point 12-bit arithmetics use cache coherenceuse cache coherence exploit 4D instructionsexploit 4D instructions reduce conditionalsreduce conditionals reduce number of registersreduce number of registers push computation to per-vertex stagepush computation to per-vertex stage
13 / 23Ivan Viola Vienna University of Technology
Median FilterMedian Filter central value of ordered setcentral value of ordered set implementationimplementation
CPU-based CPU-based sorting sorting GPU-based GPU-based similar to similar to quickselect()quickselect()
3 1
5 5
2 7
4
6
7
1 2 3 4 5 5 6 7 7
14 / 23Ivan Viola Vienna University of Technology
GPU-based Median FilterGPU-based Median Filter input data 12 bit [0..4095]input data 12 bit [0..4095] multi-pass approachmulti-pass approach not efficient on CPUnot efficient on CPU exploiting GPU 4D arithmeticsexploiting GPU 4D arithmetics
0 1 2 3 4 5 6 7
15 / 23Ivan Viola Vienna University of Technology
edge preservation: anisotropic filter kerneledge preservation: anisotropic filter kernel product of two weightsproduct of two weights::
geometric:geometric:
photometric:photometric:
Bilateral FilterBilateral Filter
x
f(x)
high geometric weightlow geometric weight
high geometric weightlow photometric weight
16 / 23Ivan Viola Vienna University of Technology
GPU-based Bilateral FilterGPU-based Bilateral Filter weights are precomputedweights are precomputed geometric weight stored geometric weight stored
in unused vertex in unused vertex attributes (attributes (COLOR0COLOR0))
photometric weight photometric weight stored in 1D stored in 1D mirrormirror LUT LUT
Rotated Mask FilterRotated Mask Filteranisotropic noise removal with edge anisotropic noise removal with edge
preservationpreservationsplits filter mask into sub-regionssplits filter mask into sub-regionsmean and variance value for each sub-mean and variance value for each sub-
regionregion result – mean value of sub-region with result – mean value of sub-region with