01.05.2013 Views

3D As-Rigid-As-Possible Deformations Using MLS - LCG - UFRJ

3D As-Rigid-As-Possible Deformations Using MLS - LCG - UFRJ

3D As-Rigid-As-Possible Deformations Using MLS - LCG - UFRJ

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>3D</strong> <strong>As</strong>-<strong>Rigid</strong>-<strong>As</strong>-<strong>Possible</strong><br />

<strong>Deformations</strong> <strong>Using</strong> <strong>MLS</strong><br />

Alvaro Cuno, Claudio Esperança, Antonio Oliveira, Paulo Cavalcanti<br />

Federal University of Rio de Janeiro - COPPE<br />

May - 2007<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 1


Introduction<br />

• Image deformation using Moving Least Squares (Schaefer et al. SIGGRAPH 2006)<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 2


Introduction<br />

• Image deformation using Moving Least Squares (Schaefer et al. SIGGRAPH 2006)<br />

• Attractive because:<br />

+ Reasonable results<br />

+ No skeletons<br />

+ Meshless<br />

+ Easy to implement (no LA package)<br />

+ Closed-form solutions<br />

+ Interactive<br />

+ Affine, similarity and rigid transformations<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 2


Deformation paradigm<br />

Blue points: initial control points positions {p i }<br />

Black points: moved control points positions {q i }<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 3


Deformation paradigm<br />

Blue points: initial control points positions {p i }<br />

Black points: moved control points positions {q i }<br />

Requeriments of f<br />

• Interpolation: f(p i) = q i<br />

• Identity: q i = p i ⇒ f(v) = v<br />

• Smoothness: f should produce smooth deformations<br />

• f must be an affine transformation<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 3


Schaefer’s method<br />

• Problem: Let {p i} ∈ ℜ 2 and {q i} ∈ ℜ 2 . Then, for pixel v,<br />

find the affine transformation<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 4


Schaefer’s method<br />

• Problem: Let {p i} ∈ ℜ 2 and {q i} ∈ ℜ 2 . Then, for pixel v,<br />

find the affine transformation fv(x) = xM + T that<br />

minimizes<br />

<br />

wi|fv(pi) − qi| 2 ,<br />

where wi = |p i − v| −u ,u ∈ Z +<br />

i<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 4


Schaefer’s method<br />

• Problem: Let {p i} ∈ ℜ 2 and {q i} ∈ ℜ 2 . Then, for pixel v,<br />

find the affine transformation fv(x) = xM + T that<br />

minimizes<br />

<br />

wi|fv(pi) − qi| 2 ,<br />

where wi = |p i − v| −u ,u ∈ Z +<br />

• <strong>MLS</strong>: wi = g(v) ⇒ one solution for each v<br />

i<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 4


<strong>MLS</strong> “rigid ” deformation in <strong>3D</strong><br />

• Optimization problem<br />

min <br />

wi|ˆpiR − ˆqi| 2 = max <br />

(Translation solution = 2D)<br />

i<br />

i<br />

wiˆqiRˆp T i<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 5


<strong>MLS</strong> “rigid ” deformation in <strong>3D</strong><br />

• Optimization problem<br />

min <br />

wi|ˆpiR − ˆqi| 2 = max <br />

(Translation solution = 2D)<br />

i<br />

i<br />

wiˆqiRˆp T i<br />

• Similar to “The Absolute Orientation Problem”<br />

• Find the best transformation for mapping a point cloud<br />

into another<br />

• Exact and approximate solutions<br />

• <strong>MLS</strong>-deformation technique<br />

• Solve the problem adaptively for each pixel v<br />

• Error is weighted by distance from v to the restrictions<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 5


Rotation representation<br />

• Direction Cosine Matrix<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Rotation representation<br />

• Direction Cosine Matrix<br />

• Rotation Matrix ⇒ 9 coefficients<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Rotation representation<br />

• Direction Cosine Matrix<br />

• Rotation Matrix ⇒ 9 coefficients<br />

• Euler angles<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Rotation representation<br />

• Direction Cosine Matrix<br />

• Rotation Matrix ⇒ 9 coefficients<br />

• Euler angles<br />

• Quaternions<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Rotation representation<br />

• Direction Cosine Matrix<br />

• Rotation Matrix ⇒ 9 coefficients<br />

• Euler angles<br />

• Quaternions<br />

• Dual Quaternions<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Rotation representation<br />

• Direction Cosine Matrix<br />

• Rotation Matrix ⇒ 9 coefficients<br />

• Euler angles<br />

• Quaternions<br />

• Dual Quaternions<br />

• Axis-Angle : {(ex ey ez),α}<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 6


Optimization problem<br />

max F(e,α) = e M e T + cos(α)(E − e M e T ) + sin(α)V e T<br />

s.t. e = 1,<br />

cos 2 (α) + sin 2 (α) = 1<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 7


Optimization problem<br />

max F(e,α) = e M e T + cos(α)(E − e M e T ) + sin(α)V e T<br />

s.t. e = 1,<br />

cos 2 (α) + sin 2 (α) = 1<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 7


Optimization problem<br />

max F(e,α) = e M e T + cos(α)(E − e M e T ) + sin(α)V e T<br />

where<br />

M= <br />

i wiˆq T i ˆpi =<br />

s.t. e = 1,<br />

⎛ <br />

⎜ <br />

⎝<br />

<br />

i wiˆqixˆpix<br />

i wiˆqiyˆpix<br />

i wiˆqizˆpix<br />

cos 2 (α) + sin 2 (α) = 1<br />

<br />

<br />

<br />

i wiˆqixˆpiy<br />

i wiˆqiyˆpiy<br />

i wiˆqizˆpiy<br />

<br />

<br />

<br />

i wiˆqixˆpiz<br />

i wiˆqiyˆpiz<br />

i wiˆqizˆpiz<br />

E = <br />

i wiˆqi · ˆpi= Trace(M),<br />

V = <br />

i wiˆpi׈qi = (M23−M32 M31−M13 M12−M21)<br />

⎞<br />

⎟<br />

⎠ ,<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 7


Eigenvalue problem<br />

• Kuhn-Tucker optimality conditions gives us<br />

<br />

M + M T + VT <br />

V<br />

e<br />

λ − 2E<br />

T = λ e T ,<br />

• Characteristic polynomial P(λ) (3th degree)<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 8


Eigenvalue problem<br />

• Kuhn-Tucker optimality conditions gives us<br />

<br />

M + M T + VT <br />

V<br />

e<br />

λ − 2E<br />

T = λ e T ,<br />

• Characteristic polynomial P(λ) (3th degree)<br />

• Depressed quartic equation (using y = λ − E)<br />

y 4 −2M 2 y 2 −8 det(M)y+M 4 −4 <br />

where Mk is the k th column of M.<br />

i<br />

<br />

j


Eigenvalue problem<br />

• Kuhn-Tucker optimality conditions gives us<br />

<br />

M + M T + VT <br />

V<br />

e<br />

λ − 2E<br />

T = λ e T ,<br />

• Characteristic polynomial P(λ) (3th degree)<br />

• Depressed quartic equation (using y = λ − E)<br />

y 4 −2M 2 y 2 −8 det(M)y+M 4 −4 <br />

where Mk is the k th column of M.<br />

• It can be shown F(e,α) = λ − E = y<br />

i<br />

<br />

j


Eigenvalue problem<br />

• Kuhn-Tucker optimality conditions gives us<br />

<br />

M + M T + VT <br />

V<br />

e<br />

λ − 2E<br />

T = λ e T ,<br />

• Characteristic polynomial P(λ) (3th degree)<br />

• Depressed quartic equation (using y = λ − E)<br />

y 4 −2M 2 y 2 −8 det(M)y+M 4 −4 <br />

where Mk is the k th column of M.<br />

• It can be shown F(e,α) = λ − E = y<br />

i<br />

<br />

• ∴ max F(e,α) → y must be the largest real root<br />

j


Solving the depressed equation<br />

• Any depressed quartic equation y 4 + ay 2 + by + c may be<br />

factored as (y 2 + py + q)(y 2 − py + s), where p must satisfy<br />

p 6 + 2ap 4 + (a 2 − 4ac)p 2 − b 2 = 0.<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 9


Solving the depressed equation<br />

• Any depressed quartic equation y 4 + ay 2 + by + c may be<br />

factored as (y 2 + py + q)(y 2 − py + s), where p must satisfy<br />

p 6 + 2ap 4 + (a 2 − 4ac)p 2 − b 2 = 0.<br />

• If p 2 = z then we must solve cubic equation<br />

z 3 − 4M 2 z 2 +<br />

16( <br />

i j


Solving the depressed equation<br />

• Any depressed quartic equation y 4 + ay 2 + by + c may be<br />

factored as (y 2 + py + q)(y 2 − py + s), where p must satisfy<br />

p 6 + 2ap 4 + (a 2 − 4ac)p 2 − b 2 = 0.<br />

• If p 2 = z then we must solve cubic equation<br />

z 3 − 4M 2 z 2 +<br />

16( <br />

i j


Rotation parameters<br />

• The original system „<br />

M + M T + VT V<br />

λ−2E<br />

«<br />

− λI eT =0,<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 10


Rotation parameters<br />

• The original system „<br />

M + M T + VT V<br />

λ−2E<br />

as<br />

(M + M T − λI) “<br />

eT (λ−2E)<br />

−V· eT ”<br />

=V T<br />

«<br />

− λI eT =0, can be written<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 10


Rotation parameters<br />

• The original system „<br />

M + M T + VT V<br />

λ−2E<br />

as<br />

(M + M T − λI) “<br />

eT (λ−2E)<br />

−V· eT ”<br />

=V T<br />

• Thus, the rotation axis e can be found solving<br />

where e = u<br />

||u||<br />

(M + M T − λI)u T = V T ,<br />

«<br />

− λI eT =0, can be written<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 10


Rotation parameters<br />

• The original system „<br />

M + M T + VT V<br />

λ−2E<br />

as<br />

(M + M T − λI) “<br />

eT (λ−2E)<br />

−V· eT ”<br />

=V T<br />

• Thus, the rotation axis e can be found solving<br />

where e = u<br />

||u||<br />

(M + M T − λI)u T = V T ,<br />

• Finally, the angular parameters<br />

cos(α) =<br />

«<br />

− λI eT =0, can be written<br />

1 − u2<br />

−2u<br />

1 + u2, sin(α) =<br />

1 + u2 COPPE-<strong>UFRJ</strong>, May - 2007 – p. 10


Algorithm<br />

Algorithm 1: Compute deformed position<br />

Input: v, {pi}, {qi}<br />

Output: Deformed vertex position v ′<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

[p∗,q∗] ← WeightedCentroid(v, {pi}, {qi});<br />

M ← CorrelationMatrix(p∗, q∗);<br />

λ ← LargestRootOfP(M) + Trace(M) ; // eigenvalue<br />

e ← RotationAxis(M, λ) ;<br />

[sin(α), cos(α)] ← SinCos(M, e) ;<br />

ˆv ← v − p∗;<br />

d ← (ˆve T )e + cos(α)(ˆv T − (ˆve T )e) + sin(α)(ˆv × e);<br />

v ′ ← q∗ + d;<br />

return v ′<br />

9 COPPE-<strong>UFRJ</strong>, May - 2007 – p. 11


Results<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 12


Results (cont.)<br />

Table 1: FPS* for deformation of several models<br />

Model Vertices Control points FPS<br />

Dolphin 2811 4 40<br />

Homer 5103 6 22<br />

Plane 1089 132 19.5<br />

Dino 14050 5 6.5<br />

Bar 6146 256 2<br />

Cylinder 1058 322 9.5<br />

*PC Pentium IV 3.2GHz, Linux, C++, OpenGL (naive implementation)<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 13


Extensions<br />

Similarity deformation: min <br />

µs =<br />

<br />

y<br />

i wi|µsˆpiR − ˆqi| 2 ,<br />

i wiˆpi 2, ∴ v′ ← q∗ + µsd<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 14


Extensions<br />

Similarity deformation: min <br />

µs =<br />

<br />

y<br />

i wi|µsˆpiR − ˆqi| 2 ,<br />

i wiˆpi 2, ∴ v′ ← q∗ + µsd<br />

Initial Affine Simil. <strong>Rigid</strong> COPPE-<strong>UFRJ</strong>, May - 2007 – p. 14


Extensions (cont.)<br />

Deformation using line segments<br />

min <br />

i<br />

1<br />

0 wi|pi(t)R + T − qi(t)| 2<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 15


Discussion<br />

• Non-smooth results<br />

(a) w(d) = d −2 w(d) = d −3 w(d) = d −4<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 16


Discussion (cont.)<br />

• Space deformation gives non-natural results for meshes<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 17


Discussion (cont.)<br />

• Resistance to large translations<br />

Initial <strong>MLS</strong>-rigid RBF<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 18


Future work<br />

• Mixing <strong>MLS</strong> with RBFs<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 19


Future work<br />

• Mixing <strong>MLS</strong> with RBFs<br />

• Change the distance metric<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 19


Future work<br />

• Skeleton-driven deformation<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 20


Future work<br />

• Skeleton-driven deformation<br />

• Scalability, more controlable, character animation, etc.<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 20


. . . Thanks<br />

COPPE-<strong>UFRJ</strong>, May - 2007 – p. 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!