Graphics Radial Basis Function

download Graphics Radial Basis Function

of 40

Transcript of Graphics Radial Basis Function

  • 8/13/2019 Graphics Radial Basis Function

    1/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Radial Basis Functions for

    Computer Graphics (A BriefIntroduction)

  • 8/13/2019 Graphics Radial Basis Function

    2/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Contents

    1. Introduction to radial basis functions

    2. Mathematics

    3. How to fit a 3D surface4. Applications

  • 8/13/2019 Graphics Radial Basis Function

    3/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Radial Basis Functions andTheir Applications in Graphics

  • 8/13/2019 Graphics Radial Basis Function

    4/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Scattered Data Modeling

  • 8/13/2019 Graphics Radial Basis Function

    5/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Smooth Surfaces

  • 8/13/2019 Graphics Radial Basis Function

    6/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Scattered Data Interpolation Radial Basis Functions (RBFs) are a powerful solution to the

    Problem of Scattered Data Fitting

    N point samples are given as data inputs, we want to interpolate,extrapolate, and/or approximate

    This problem occurs in many areas:

    Mesh repair and model completion

    Surface reconstruction

    Range scanning, geographic surveys, medical data

    Field visualization (2D and 3D) Image warping, morphing, registration

    Artificial intelligence

    Etc.

  • 8/13/2019 Graphics Radial Basis Function

    7/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    2D Radial Basis Functions

    Implicit Curve

    Parametric Height Field

  • 8/13/2019 Graphics Radial Basis Function

    8/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    A Very Brief History Discovered by Duchon in 1977

    Applications to Computer Graphics:

    Savchenko, Pasko, Okunev, Kunii1995 Basic RBF, complicated topology bits

    Turk & OBrien 1999

    Variational implicit surfaces

    Interactive modeling, shape transformation

    Carr et al

    1997Medical Imaging 2001Fast Reconstruction

  • 8/13/2019 Graphics Radial Basis Function

    9/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    3D Radial Basis Functions

    Implicit Surface

    Scalar Field

  • 8/13/2019 Graphics Radial Basis Function

    10/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Extrapolation (Hole-Filling Capability)

    Mesh repair and model completion

    Fit surface to vertices of mesh

    RBF will fill holes

    if it minimizes curvature !!

  • 8/13/2019 Graphics Radial Basis Function

    11/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Smoothing

    Smooth out noisy range scan data

    Repair the rough segmentation

  • 8/13/2019 Graphics Radial Basis Function

    12/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Now a bit of math

    (dont panic)

  • 8/13/2019 Graphics Radial Basis Function

    13/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    The Scattered Data Fitting Problem We wish to reconstruct a function S(x), given N samples (xi, fi),

    such that S(xi)=fi xiare thepoints from measurement

    Reconstructed function is denoted S(x)

    Infinite number of solutions We have specific constraints:

    S(x) should be continuous over the entire domain

    We want a smooth surface

  • 8/13/2019 Graphics Radial Basis Function

    14/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    The Generic Form of RBF Solution

    )()(1

    xxxx PsN

    i

    ii

    normEuclideantheis

    componentpolynomialdegree-lowais)(theis(r)

    centeroftheis

    x

    x

    x

    Pfunctionbasic

    weight ii

  • 8/13/2019 Graphics Radial Basis Function

    15/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Terminology: Support Support is the footprint

    of the function

    Two types of support matters most:

    CompactorFinitesupport:

    function value is zero outside

    of a certain interval

    Non-CompactorInfinitesupport:

    not compact (no interval, goes all the way to )

    3xy

    2xey

  • 8/13/2019 Graphics Radial Basis Function

    16/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Basic Functions ( )

    Essentially, they can be of any functional type However, very difficult to define properties of the RBFs for

    an arbitrary basic function

    Support of function has major implications A non-compactly supported basic function implies aglobal

    solution, dependent on allpoints!

    Allows extrapolation (hole-filling)

  • 8/13/2019 Graphics Radial Basis Function

    17/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Standard (Commonly-Used) BasicFunctions

    Polyharmonics (Cncontinuity)

    2D:

    3D:

    Multiquadric:

    Gaussian: compact support, used in artificial intelligence field

    )log()( 2 rrr n

    12)( nrr

    22)( crr

    2

    )( crer

  • 8/13/2019 Graphics Radial Basis Function

    18/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Polyharmonics 2D Biharmonic:

    Thin-Plate Spline

    3D Biharmonic: C1continuity, Polynomial is degree 1

    Node Restriction: nodes not colinear

    3D Triharmonic: C2continuity, Polynomial is degree 2

    Important Bit: Can provide Cncontinuity

    )log()( 2 rrr

    3)( rr

    rr )(

  • 8/13/2019 Graphics Radial Basis Function

    19/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Guaranteeing Smoothness RBFs are members of , theBeppo-Levi

    space of distributions onR3withsquare integrablesecond derivatives

    has a rotation-invariant semi-norm:

    Semi-norm is a measure of energy of s(x)

    Functions with smaller semi-norm are smoother

    Smoothest function is the RBF (Duchon proved this)

    xdsssssss yzxzxyzzyyxx222222 222

    )(BL 3)2( R

    )(BL 3)2( R

  • 8/13/2019 Graphics Radial Basis Function

    20/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    What about P(x ) ? P(x) ensures minimization of the curvature

    3D Biharmonic: P(x) = a + bx + cy+ dz

    Must solve for coefficients a,b,c,d Adds 4 equations and 4 variables to the linear system

    Additional solution constraints:

    0111 1

    i

    N

    i

    ii

    N

    i

    i

    N

    i

    i

    N

    i

    ii zyx

  • 8/13/2019 Graphics Radial Basis Function

    21/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Finding an RBF Solution The weights and polynomial coefficients are unknowns

    We know N values of s(x):

    We also have 4 side conditions

    )()(0

    j

    N

    i

    ijij Ps xxxx

    jjjNjNjj dzcybxaf xxxx 11

    0111 1

    i

    N

    i

    ii

    N

    i

    i

    N

    i

    i

    N

    i

    ii zyx

  • 8/13/2019 Graphics Radial Basis Function

    22/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    The Linear System Ax = b

    0

    0

    0

    0

    0000

    0000

    0000

    000011

    1

    1 11

    1

    1

    1

    1

    111111

    NN

    N

    N

    N

    NNNNNN

    N

    f

    f

    d

    c

    b

    a

    zz

    yy

    xx

    zyx

    zyx

    ij

    jii

    fxP

    )(

    0 i

    0 iix

    0 iiy

    0 iiz

    ijji xx where

  • 8/13/2019 Graphics Radial Basis Function

    23/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Properties of the Matrix Depends heavily on the basic function

    Polyharmonics:

    Diagonal elements are zeronot diagonally dominant Matrix issymmetricandpositive semi-definite

    Ill-conditioned if there are near-coincident centers

    Compactly-supported basic functions have a sparse matrix Introduce surface artifacts

    Can be numerically unstable

  • 8/13/2019 Graphics Radial Basis Function

    24/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Analytic Gradients Easy to calculate

    Continuous depending on basic function

    Partial derivatives for biharmonic gradient canbe calculated in parallel:

    b

    xxc

    x

    s N

    i

    ii

    1 ixx

    c

    yyc

    y

    s N

    i

    ii

    1 ixx

    d

    zzc

    z

    s N

    i

    ii

    1 ixx

  • 8/13/2019 Graphics Radial Basis Function

    25/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Fitting 3D RBF Surfaces

    (its tricky)

  • 8/13/2019 Graphics Radial Basis Function

    26/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Basic Procedure1. Acquire N surface points

    2. Assign them all the value 0(This will be the iso-value for the surface)

    3. Solve the system, polygonize, and render:

  • 8/13/2019 Graphics Radial Basis Function

    27/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Off-Surface Points Why did we get a blank screen?

    Matrix was Ax = 0

    Trivial solution is s(x) = 0

    We need to constrain the system

    Solution: Off-Surface Points

    Points inside and outside of surface

    Project new centers alongpoint normals

    Assign values: 0 outside

    Projection distance has a large effect on smoothness

  • 8/13/2019 Graphics Radial Basis Function

    28/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Invalid Off-Surface Points

    Have to make sure that

    off-surface points stay

    inside/outside surface!

    Nearest-Neighbor test

  • 8/13/2019 Graphics Radial Basis Function

    29/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Point Normals?

    Easy to get from polygonal meshes

    Difficult to get from anything else

    Can guess normal by fitting a plane to local

    neighborhood of pointsNeed outward-pointing vector to determine orientation

    Range scanner position, black pixels

    For ambiguous cases, dont generate off-surface point

  • 8/13/2019 Graphics Radial Basis Function

    30/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Computational Complexity How long will it take to fit 1,000,000 centers?

    Forever (more or less)

    3.6 TB of memory to hold matrix

    O(N3) to solve the matrix

    O(N) to evaluate a point Infeasible for more than a few thousandcenters

    Fast Multipole Methods make it feasible

    O(N) storage, O(NlogN) fitting and O(1) evaluation Mathematically complex

  • 8/13/2019 Graphics Radial Basis Function

    31/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Center Reduction

    Remove redundant centers

    Greedy algorithm

    Buddha Statue: 543,652 surface points

    80,518 centers

    5 x 10-4accuracy

  • 8/13/2019 Graphics Radial Basis Function

    32/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    FastRBF FarFieldTechnology (.com)

    Commercial implementation

    3D biharmonic fitter with Fast Multipole Methods

    Adaptive Polygonizer that generates optimized triangles

    Grid and Point-Set evaluation

    Expensive They have a free demo limited to 30k centers

    Use iterative reduction to fit surfaces with more points

  • 8/13/2019 Graphics Radial Basis Function

    33/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Applications

    (and eye candy)

  • 8/13/2019 Graphics Radial Basis Function

    34/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Cranioplasty (Carr 97)

  • 8/13/2019 Graphics Radial Basis Function

    35/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Molded Cranial Implant

  • 8/13/2019 Graphics Radial Basis Function

    36/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Morphing

    Turk99 (SIGGRAPH)

    4D Interpolation between two surfaces

  • 8/13/2019 Graphics Radial Basis Function

    37/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Morphing With Influence Shapes

  • 8/13/2019 Graphics Radial Basis Function

    38/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Statue of Liberty

    3,360,300 data points

    402,118 centers

    0.1m accuracy

  • 8/13/2019 Graphics Radial Basis Function

    39/40

    STNY BRKSTATE UNIVERSITY OF NEW YORK

    Department of Computer Science

    Center for Visual Computing

    CSE528 Lectures

    Credits

    Pictures copied from:

    Papers by J.C. Carr and Greg Turk

    FastRBF.com

    References:

  • 8/13/2019 Graphics Radial Basis Function

    40/40

    STNY BRKD t t f C t S i CSE528 L

    Questions?