Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH...

56
Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy

Transcript of Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH...

Page 1: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Image Deformation Using Moving Least Squares

Scott Schaefer, Travis McPhail, Joe Warren

SIGGRAPH 2006

Presented by Nirup Reddy

Page 2: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 3: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 4: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Input Affine Similarity Rigid

Page 5: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Outline

Introduction Previous work MLS with points MLS with line segments Conclusions

Page 6: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Introduction

Image deformation Animation, morphing, medical imaging… Controlled by handles: points, lines… Function f

Interpolation: f(pi)=qi (handles)

Smoothness ~ smooth deformations Identity: qi=pif(x)=x

Similar to scattered data interpolation

Page 7: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Previous Work Grid/Polygon handles

Free-form deformations [Sederberg and Parry 1986; Lee et al. 1995]

Require aligning grid lines with image features Line handles

[Beier and Neely 1992] Undesirable folding

Point handles RBF

Thin-plate splines [Bookstein 1989] Local non-uniform scaling and shearing

As-rigid-as-possible deformations [Igarashi et al. 2005]

Solve on the whole triangulation Discontinuities

Page 8: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Previous Work

Page 9: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

As-Rigid-As-Possible Shape Manipulation

Page 10: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Thin-plate spline As-rigid-as-possible

Page 11: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Previous Work Grid/Polygon handles

Free-form deformations [Sederberg and Parry 1986; Lee et al. 1995]

Require aligning grid lines with image features Line handles

[Beier and Neely 1992] Undesirable folding

Point handles RBF

Thin-plate splines [Bookstein 1989] Local non-uniform scaling and shearing

As-rigid-as-possible deformations [Igarashi et al. 2005]

Solve on the whole triangulation Discontinuities

Page 12: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 13: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 14: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 15: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

i

ii ppF 2|ˆ)(|

Page 16: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 17: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

i

iii ppFw 2|ˆ)(|

Page 18: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 19: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Moving Least Squares Deformation Build image deformations based on handles

(pi,qi) Interpolation Smoothness Identity

Given a point v, solve for the best lv(x):

Deformation function f(v)=lv(v) Locally defined --- MOVING Least Squares Satisfy the three properties

i

iivi qplw 2|)(| 2||

1

vpw

ii

Page 20: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Affine Transform Affine transform: lv(x)=xM+T Translation can be removed: T=q*-p*M

So, lv(x)=(x-p*)M+q*

The new cost function:

M could be different class of transformations

i i

i ii

w

pwp*

i i

i ii

w

qwq*

2|ˆˆ|

iiii qMpw

*ˆ ppp ii *ˆ qqq ii

Page 21: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Affine Deformations Solution

The deformation function

Aj can be precomputed

Contains non-uniform scaling and shear

j

jTjj

iii

Ti qpwpwpM ˆˆ)ˆˆ( 1

*ˆ)( qqAvfj

jja Ti

iii

Tij ppwppvA ˆ)ˆˆ)(( 1

*

Page 22: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Deformations

Only include translation, rotation, and uniform scaling

Remove shear from deformation

Page 23: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Deformations

Only include translation, rotation, and uniform scaling

Remove shear from deformation

Page 24: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Deformations (Cont.) A special subset of affine transforms

Translation Rotation Constraints: Uniform-scaling

Requirement: MTM=λ2I Define , where M2=M1

┴ Cost function (Least squares problem) still

quadratic in M1

where (x,y)┴=(-y,x)

Page 25: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Deformations (Cont.)

Solution for matrix M

where Solution for deformation function

where Property

Preserves angles better than affine deformations

Local scaling can hurt realism

Page 26: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Rigid Deformations Deformations should not

include scaling and shear [Alexa 2000; Igarashi et al.

2005] Best rigid transformation

can be found from best similarity transformation Remove local uniform

scaling MTM=I

Page 27: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Rigid Deformations Deformations should not

include scaling and shear [Alexa 2000; Igarashi et al.

2005] Best rigid transformation

can be found from best similarity transformation Remove local uniform

scaling MTM=I

Page 28: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Rigid Deformations (Cont.) Solution for matrix M

Solution for deformation function

where , and Ai is as in similarity deformations.

Limited precomputation

Page 29: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 30: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Example: Actual Image

Page 31: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Deformation’s

Affine Similarity Rigid

Page 32: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Comparison:

Affine Similarity RigidNon-uniform

scaling and shearLocal scaling can

often lead to undesirable

Deformations But Preserves

angles

Deformation is quiterealistic

Computation time very low abt 1.5ms

Highest was computed as 3.4ms

Highest was computed 3.8ms

Page 33: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 34: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 35: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 36: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 37: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Some Rigid Deformation Results

Page 38: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 39: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 40: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 41: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Deformation with Curves

Handles are control curves instead of control points

Cost function

T still can be removed

Page 42: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Limitations:

May be difficult to evaluate for arbitrary functions

We restrict these functions to be line segments and derive closed-form solutions for the deformations in terms of the end-points of these segments

Page 43: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Affine Lines

Represent line segments as matrix products

Cost function

Minimizer

Page 44: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Affine Lines (Cont.)

Deformation

Page 45: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Lines

Cost function

Minimizer

Page 46: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Similarity Lines (Cont.)

Deformation

Page 47: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Rigid Lines

Derive from similarity lines

Deformation

Page 48: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 49: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 50: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.
Page 51: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Implementation

Pixel by pixel --- expensive Deformation on a downsampled

grid Fill quads using bilinear

interpolation

Page 52: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Timing

Grid size: 100x100

Page 53: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Limitation: Foldbacks

Page 54: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Conclusions

Moving Least Squares 2x2 linear system at each grid point

Real-time

Similarity and rigid transformations More realistic results Extension: line segments Closed-form expressions

Page 55: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Applications Of MLS: Very powerful tool in

computer graphics Animation Medical

Imaging Image Warping Image Morphing

Page 56: Image Deformation Using Moving Least Squares Scott Schaefer, Travis McPhail, Joe Warren SIGGRAPH 2006 Presented by Nirup Reddy.

Conclusions (Cont.)

Future Work Adding topological information Generalizing to 3D to deform surfaces Handles can be any curves