interpolation via barycentric coordinates · • moving least squares coordinates [manson and...

81
Interpolation via Barycentric Coordinates Pierre Alliez Inria Some material from D. Anisimov

Upload: others

Post on 19-Oct-2020

20 views

Category:

Documents


5 download

TRANSCRIPT

  • Interpolation viaBarycentric Coordinates

    Pierre Alliez

    Inria

    Some material from D. Anisimov

  • Outline

    • Barycenter• Convexity• Barycentric coordinates

    – For Simplices– For point sets

    • Inverse distance (Shepard) • Delaunay / Voronoi• Natural neighbors (Sibson)

    – For convex polyhedra– Generalized barycentric coordinates– Applications

  • BARYCENTER

  • Barycenter

    • Law of lever:

    Center of mass

  • Barycentric coordinates

  • Opposite problem?

    v1 v2p

    ?

  • Opposite problem

    p

    l2/l l1/l unique!

    v1 v2l2l1

  • CONVEXITY

  • Convexity

    A set S is convex if any

    pair of points p,q S

    satisfy pq S.

    p

    q

    non-convex

    q

    p

    convex

    p

    q

    non-convex

    q

    p

    convex

  • CH(S)

    Convex Hull

    p

    q

    non-convex

    q

    p

    convex

    •The convex hull of a set S is:• The minimal convex set that

    contains S, i.e. any convex set C

    such that S C satisfies CH(S) C.

    • The intersection of all convex sets

    that contain S.

    • The set of all convex combinations

    of piS, i.e. all points of the form:S

    p

    q

    non-convex

    q

    p

    convex

    1 1

    , 0, 1n n

    i i i i

    i i

    p

  • CH(S)

    Convex Hulls

    •The convex hull of a set is unique, up to

    collinearities.

    •The boundary of the convex hull of a point set

    is a polygon on a subset of the points.

    S

  • BARYCENTRIC COORDINATES

    FOR SIMPLICES

  • Triangle barycentric coordinates

    A. F. Möbius

    [1790−1868]

    1/36

  • Properties:

    Triangle barycentric coordinates

    2/36

  • Triangle barycentric coordinates

    3/36

    Data interpolation

  • Barycentric Coordinates for Simplices

  • BARYCENTRIC COORDINATES

    FOR POINT SETS

  • Point Set

  • Barycentric Coordinates?

    Weights such that it is a barycenter of the point set?

  • Barycentric Coordinates?

    Weights such that it is a barycenter of the point set?

    A. F. Möbius

    [1790−1868]

    Weights always exist if #points >= dimension

  • Inverse Distance [Shepard]

  • Natural Neighbor Coordinates [Sibson]

  • Voronoi Diagram

  • Voronoi Diagram• The collection of the non-empty Voronoi regions and their faces, together with their

    incidence relations, constitute a cell complex called the Voronoi diagram of E.

    • The locus of points which are equidistant to two sites pi and pj is called a bisector, all bisectors being affine subspaces of IRd (lines in 2D).

    demo

  • Sibson Coordinates

  • Sibson Coordinates

    • Well define over convex hull• Local support• Satisfy Lagrange property• C1 continuity, except at points pi (only C

    0)

  • GENERALIZED

    BARYCENTRIC COORDINATES

  • Quadrilateral?

    Bilinear interpolation

  • Quadrilateral

    Bilinear map on unit square

  • Quadrilateral

    Image of bilinear map on unit square

  • Unified Formula! [Floater]

    signed area

  • Generalized barycentric coordinates

    Properties:

    4/36

  • Interpolation

    5/36

  • Generalized barycentric coordinates

    Different weights -> different coordinate functions

    6/36

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Metric coordinates [Malsch et al., 2005]

    • Harmonic coordinates [Joshi et al., 2007]

    • Maximum entropy coordinates [Hormann and Sukumar, 2008]

    • Complex barycentric coordinates [Weber et al., 2009]

    • Moving least squares coordinates [Manson and Schaefer, 2010]

    • Cubic mean value coordinates [Li and Hu, 2013]

    • Poisson coordinates [Li et al., 2013]

    7/36

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Metric coordinates [Malsch et al., 2005]

    • Harmonic coordinates [Joshi et al., 2007]

    • Maximum entropy coordinates [Hormann and Sukumar, 2008]

    • Complex barycentric coordinates [Weber et al., 2009]

    • Moving least squares coordinates [Manson and Schaefer, 2010]

    • Cubic mean value coordinates [Li and Hu, 2013]

    • Poisson coordinates [Li et al., 2013]

    8/36

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Three-point coordinates [Floater et al., 2006]

    9/36

  • Three-point coordinates

    10/36

  • Three-point coordinates

    Wachspress Mean value Discrete harmonic

    11/36

  • Three-point coordinates

    Wachspress Mean value Discrete harmonic

    12/36

  • Discrete harmonic

    Three-point coordinates

    Wachspress Mean value

    13/36

  • Mean value

    Mean value coordinates

    14/36

  • Mean value

    Mean value coordinates

    15/36

    Positive mean value coordinates [Lipman et al., 2007]

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Metric coordinates [Malsch et al., 2005]

    • Harmonic coordinates [Joshi et al., 2007]

    • Maximum entropy coordinates [Hormann and Sukumar, 2008]

    • Complex barycentric coordinates [Weber et al., 2009]

    • Moving least squares coordinates [Manson and Schaefer, 2010]

    • Cubic mean value coordinates [Li and Hu, 2013]

    • Poisson coordinates [Li et al., 2013]

    16/36

  • Metric coordinates

    17/36

  • Metric coordinates

    18/36

  • Metric coordinates

    19/36

  • Metric coordinates

    20/36

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Metric coordinates [Malsch et al., 2005]

    • Harmonic coordinates [Joshi et al., 2007]

    • Maximum entropy coordinates [Hormann and Sukumar, 2008]

    • Complex barycentric coordinates [Weber et al., 2009]

    • Moving least squares coordinates [Manson and Schaefer, 2010]

    • Cubic mean value coordinates [Li and Hu, 2013]

    • Poisson coordinates [Li et al., 2013]

    21/36

  • Harmonic coordinates

    No closed form!22/36

  • Biharmonic vs Harmonic

    Biharmonic Harmonic

    [Weber et al., 2012]

    23/36

  • Generalized barycentric coordinates

    • Wachspress coordinates [Wachspress, 1975]

    • Discrete harmonic coordinates [Pinkall and Polthier, 1993]

    • Mean value coordinates [Floater, 2003]

    • Metric coordinates [Malsch et al., 2005]

    • Harmonic coordinates [Joshi et al., 2007]

    • Maximum entropy coordinates [Hormann and Sukumar, 2008]

    • Complex barycentric coordinates [Weber et al., 2009]

    • Moving least squares coordinates [Manson and Schaefer, 2010]

    • Cubic mean value coordinates [Li and Hu, 2013]

    • Poisson coordinates [Li et al., 2013]

    28/36

  • Barycentric mapping

    Source polygon Target polygon

    29/36

  • Complex barycentric mapping

    Source polygon Target polygon

    30/36

  • Complex barycentric coordinates

    Induce conformal mappings

    HarmonicGreen

    Three-point coordinates are generalized to complex three-point coordinates

    Green coordinates are members of complex three-point coordinates

    31/36

    [Lipman et al., 2008]

  • APPLICATIONS

  • Editing

  • Image warping

    Original image Warped imageMask

    27/36

  • Principal Component Analysis

    Linear Least Squares Approximation

    Pierre AlliezInria Sophia Antipolis

  • 64

    Definition (point set case)

    Given a point set x1, x2, …, xn Rd, linear least squares

    fitting amounts to find the linear sub-space of Rd

    which

    minimizes the sum of squared distances from the points

    to their projection onto this linear sub-space.

  • 65

    Definition (point set case)

    This problem is equivalent to search for the linear sub-

    space which maximizes the variance of projected

    points, the latter being obtained by eigen decomposition

    of the covariance (scatter) matrix.

    Eigenvectors corresponding to large eigenvalues are the

    directions in which the data has strong component, or

    equivalently large variance. If eigenvalues are the same

    there is no preferable sub-space.

  • 66

    PCA finds an orthogonal basis that best represents given data set.

    The sum of distances2 from the x’ axis is minimized.

    PCA – the general idea

    x

    y

    x’

    y’

  • 67

    PCA – the general idea

    PCA finds an orthogonal basis that best represents given data set.

    PCA finds a best approximating plane (in terms of distances2)

    3D point set

    x y

    z

  • 68

    Notations

    Denote our data points by x1, x2, …, xn Rd

    11 1

    1 2

    22 2

    1 2

    1 2

    , , ,

    n

    n

    dd d

    n

    xx x

    xx x

    xx x

    1 2 dx x xK

    MM M

  • 69

    The origin is zero-order approximation of our data set (a

    point)

    It will be the center of mass:

    It can be shown that:

    The origin of the new axes

    1

    1

    n

    in

    i

    m x

    2

    1

    argminn

    i

    i

    x

    m x - x

  • 70

    Scatter matrix

    Denote yi = xi – m, i = 1, 2, …, n

    where Y is dn matrix with yk as columns (k = 1, 2, …, n)

    TS YY

    1 1 1 1 2

    1 2 1 1 1

    2 2 2 1 2

    1 2 2 2 2

    1 2

    1 2

    d

    n

    d

    n

    d d d d

    n n n n

    y y y y y y

    y y y y y yS

    y y y y y y

    L L

    L

    M M M M M

    L L

    Y YT

  • 71

    Variance of projected points

    In a way, S measures variance (= scatterness) of the data in different directions.

    Let’s look at a line L through the center of mass m, and project our points xi onto it.

    The variance of the projected points x’i is:

    Original set Small variance Large variance

    21

    1

    var( ) || ||n

    in

    i

    L

    x m

    L L L L

  • 72

    Variance of projected points

    Given a direction v, ||v|| = 1, the projection of xi onto L = m + vt

    is:

    || || , || || ,T

    i

    i i ix m v x m v v y v y

    vm

    xi

    x’iL

  • 73

    Variance of projected points

    So,

    2 2 21 1 1

    1 1

    21 1 1 1 1

    var( ) || || ( ) || ||

    || || , ,

    n n

    n n n

    i i

    T T T

    n n n n n

    L Y

    Y Y Y YY S S

    T T

    i i

    T T T

    x - m v y v

    v v v v v v v v v

    2 21 1 1 1

    1 2

    2 2 2 2

    2 1 2 1 2 21 2

    1 1

    1 2

    ( ) || ||

    i n

    n nT d di n

    i i

    d d d d

    i n

    y y y y

    y y y yv v v v v v Y

    y y y y

    T

    iv y v

    L

    L LM M M M

    L

  • 74

    Directions of maximal variance

    So, we have: var(L) =

    Theorem:

    Let f : {v Rd

    | ||v|| = 1} R,

    f (v) = (and S is a symmetric matrix).

    Then, the extrema of f are attained at the eigenvectors of S.

    So, eigenvectors of S are directions of maximal/minimal variance.

  • 75

    Summary so far

    We take the centered data points y1, y2, …, yn Rd

    Construct the scatter matrix

    S measures the variance of the data points

    Eigenvectors of S are directions of max/min variance.

    TS YY

  • 76

    Scatter matrix - eigendecomposition

    S is symmetric

    S has eigendecomposition: S = VVT

    S = v2v1 vd

    12

    d

    v2

    v1

    vd

    The eigenvectors form

    orthogonal basis

  • 77

    Principal components

    Eigenvectors that correspond to big eigenvalues are the

    directions in which the data has strong components (=

    large variance).

    If the eigenvalues are more or less the same – there is no

    preferable direction.

  • 78

    Principal components

    There’s no preferable

    direction

    S looks like this:

    Any vector is an

    eigenvector

    There is a clear preferable

    direction

    S looks like this:

    is close to zero, much

    smaller than .

    TVV

  • 79

    For approximation

    x

    y

    v1

    v2

    x

    y

    This line segment approximates

    the original data set

    The projected data set

    approximates the original data

    set

    x

    y

  • 80

    For approximation

    In general dimension d, the eigenvalues are sorted in

    descending order:

    1 2 … d The eigenvectors are sorted accordingly.

    To get an approximation of dimension d’ < d, we take the d’

    first eigenvectors and look at the subspace they span (d’ =

    1 is a line, d’ = 2 is a plane…)

  • 81

    For approximation

    To get an approximating set, we project the original data

    points onto the chosen subspace:

    xi = m + 1v1 + 2v2 +…+ d’vd’ +…+dvdProjection:

    xi’ = m + 1v1 + 2v2 +…+ d’vd’ +0vd’+1+…+ 0 vd

  • 82

    Optimality of approximation

    The approximation is optimal in least-squares sense. It

    gives the minimal of:

    The projected points have maximal variance.

    2

    1

    n

    k k

    k

    x x

    Original set projection on arbitrary line projection on v1 axis

  • PCA on Point Sets

    83

    1 1 1 1 2

    1 2 1 1 1

    2 2 2 1 2

    1 2 2 2 2

    1 2

    1 2

    d

    n

    d

    n

    d d d d

    n n n n

    y y y y y y

    y y y y y yS

    y y y y y y

    L L

    L

    M M M M M

    L L

    demo

    demos/pca_2d.exe

  • PCA on Geometric Primitives?

    84

    Coordinate relative to center of mass