Sven.Bergmann@unil.ch unil.ch/cbg

Preview:

DESCRIPTION

Sven.Bergmann@unil.ch www.unil.ch/cbg. Alex Alon. How do you connect smoothly between two points?. Cubic Bezier Splines. Smooth Connection Functions can be computed analytically using fundamental notions of theoretical physics. How do you connect smoothly between two points?. - PowerPoint PPT Presentation

Citation preview

Sven.Bergmann@unil.chwww.unil.ch/cbg

Alex Alon

How do you connect smoothly between two points?

Cubic Bezier Splines

Smooth Connection Functions can be computed analytically using fundamental notions of theoretical physics

How do you connect smoothly between two points?

Small curvature radius(high curvature)

Large curvature radius(small curvature)

A cost function sums up the curvature along the curve

ds

The parameter determines the importance of having small curvature =1/r

The cost function can be determined for any given function y(x) describing the curve:

The Smooth Connection Function mimimizes the cost function for a given

and a set of boundary conditions

= 0 [ ]Euler-Lagrange

E. Noether

Examples for Smooth Connection functions

So how do Smooth Connection Functions relate to Shapes?

Many shapes can be approximated

Playing Join-the-dots

http://www.meridiangames.net/game.asp?GID=292

Contours can be defined as interpolation curves through a list of points

Different interpolation schemes lead to different shapes

B-spline interpolationExample for three points: P0 , P1 , P2

For each segment control points are chosen as Pi ± di

By construction this matches the slopes at each point.

From C2 continuity (equal curvatures) it follows that

P1 - 2(P1 - d1) + (P0 + d0) = (P2 - d2) - 2(P1 + d1) + P1 , d0 + 4d1 + d2 = P2 - P0 .

In general case we get banded 3-diagonals linear equations 4d1 + d2 = P2 - P0 - d0 d1 + 4d2 + d3 = P3 - P1 ... ... di + 4di+1 + di+2 = Pi+2 - Pi ... ... dn-2 + 4dn-1 = Pn - Pn-2 - dn

Which can be solved for di.

How to use SCFs for joining the dots?

P0 P1 P2

S01

S12

S = S01(α)+ S12(α)

The total cost is the sum of the cost from each segment.

αα

New optimization problem

𝑆 Σ (α )=∑𝑖=1

𝑛

𝑆𝑖 (α 𝑖 , α 𝑖+1)

The slope at each point affects the cost of the two neighboring segments

P0 P1 P2

S1

S2

P3S3

+ ...

Finding that minimizes corresponds to the best interpolation!

Connecting points by SCFsPro vs Con

Main advantage: • Single tunable parameter controls behavior of

all segment curves (while B-splines have only one solution)

Main disadvantage: • Minimization procedure is computationally

costly (while B-splines require only solving linear equations)

0 20 400.99

0.995

1

1.005

N=3

=1.3

0 20 400.9

0.95

1

=3

0 20 400.4

0.6

0.8

1=10

0 20 400.9

0.95

1

N=4

0 20 400.7

0.8

0.9

1

0 20 400

0.5

1

0 50 1000.7

0.8

0.9

1

N=10

Iteration0 50 1000

0.5

1

Iteration0 50 1000

0.5

1

Iteration

Connecting points by SCFsDoes it work?

Using ‘Gaussian adaptation’ for optimization reduces the cost function

Connecting points by SCFsDoes it work?

0 20 400.99

0.995

1

1.005

N=3

=1.3

0 20 400.9

0.95

1

=3

0 20 400.4

0.6

0.8

1=10

0 20 400.9

0.95

1

N=4

0 20 400.7

0.8

0.9

1

0 20 400

0.5

1

0 50 1000.7

0.8

0.9

1

N=10

Iteration0 50 1000

0.5

1

Iteration0 50 1000

0.5

1

Iteration

The curves evolve differently for each !

Connecting 10 points by SCFs

0 20 400.99

0.995

1

1.005N=3

=1.3

0 20 400.9

0.95

1=3

0 20 400.4

0.6

0.8

1=10

0 20 400.9

0.95

1

N=4

0 20 400.7

0.8

0.9

1

0 20 400

0.5

1

0 50 1000.7

0.8

0.9

1

N=10

Iteration0 50 1000

0.5

1

Iteration0 50 1000

0.5

1

Iteration

And the Octopus?

Not much adaptation with 95 points on the curve …

But there are some subtle differences

Higher promotes round shapes!

Less points introduce more freedom for adaptation

Less points introduce more freedom for adaptation

… and sometimes too much freedom!

Outlook

New ways to define shapes:• Optimal trajectories in transport• Curves in Computer Aided Geometrical Design

New way to analyze shapes• Assigning a typical ν to a shape or a part of it

(e.g. for handwritten letters)

Alex Alon

Thanks! Sven.Bergmann@unil.chwww.unil.ch/cbg