27.01.2014 Views

Barycentric Coordinates for Arbitrary Polygons in the Plane

Barycentric Coordinates for Arbitrary Polygons in the Plane

Barycentric Coordinates for Arbitrary Polygons in the Plane

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14 K. Hormann<br />

This is due to <strong>the</strong> large l<strong>in</strong>ear system that needs to be solved and <strong>the</strong> large number<br />

of basis functions that have to be evaluated. In general, if n is <strong>the</strong> number of vertices<br />

<strong>in</strong> Ψ and k is <strong>the</strong> number of samples per edge, <strong>the</strong>n solv<strong>in</strong>g <strong>the</strong> l<strong>in</strong>ear system with a<br />

standard method is an O(k 3 · n 3 ) operation and evaluat<strong>in</strong>g <strong>the</strong> m pixels of Î is of order<br />

O(m·k·n). Of course <strong>the</strong>re exist specialized solvers that can reduce <strong>the</strong> cost <strong>for</strong> solv<strong>in</strong>g<br />

<strong>the</strong> l<strong>in</strong>ear system, but <strong>the</strong> advantage of <strong>the</strong> barycentric warp is that it does not require<br />

any system to be solved and <strong>the</strong> whole computation is of order O(m · n) only.<br />

We conclude that <strong>the</strong> barycentric warp is particularly useful whenever straight edges<br />

need to be preserved. For example, mak<strong>in</strong>g <strong>the</strong> boundary of <strong>the</strong> rectangular image<br />

one of <strong>the</strong> source and <strong>the</strong> target polygons guarantees that <strong>the</strong> warped image will be<br />

rectangular too; see Figure 9.<br />

5.3 Transf<strong>in</strong>ite Interpolation<br />

Our generalized barycentric coord<strong>in</strong>ates also provide an efficient solution to <strong>the</strong> follow<strong>in</strong>g<br />

<strong>in</strong>terpolation problem. Given a set of closed planar curves c j and some<br />

d-dimensional data over <strong>the</strong>se curves d j : c j → IR d we would like to have a function<br />

F : IR 2 → IR d that <strong>in</strong>terpolates <strong>the</strong> given data, i.e. F (v) = d j (v) <strong>for</strong> any v ∈ c j .<br />

The obvious approach is to approximate <strong>the</strong> given curves c j with a set of polygons<br />

Ψ whose vertices v i lie on <strong>the</strong> curves c j . Then <strong>the</strong> function F <strong>in</strong> Equation (12) with<br />

f i = d j (v i ) clearly is an approximate solution of <strong>the</strong> stated <strong>in</strong>terpolation problem. And<br />

as <strong>the</strong> polygons Ψ converge to <strong>the</strong> curves c j by <strong>in</strong>creas<strong>in</strong>g <strong>the</strong> sampl<strong>in</strong>g density, so does<br />

<strong>the</strong> function F converge to <strong>the</strong> desired solution.<br />

The <strong>in</strong>terest<strong>in</strong>g fact now is that <strong>the</strong> structure of our generalized barycentric coord<strong>in</strong>ates<br />

allows an efficient update of <strong>the</strong> solution if <strong>the</strong> sampl<strong>in</strong>g density is <strong>in</strong>creased.<br />

Assume that we computed F (v) and also W (v) from Equation (9) <strong>for</strong> some polygon Ψ<br />

and <strong>the</strong>n ref<strong>in</strong>e Ψ to ̂Ψ by add<strong>in</strong>g a vertex ˆv with data value ˆf = d j (ˆv) between v j and<br />

v j+1 . Then it follows from Appendix A that <strong>the</strong> ref<strong>in</strong>ed <strong>in</strong>terpolation function ̂F (v) can<br />

be written as<br />

with<br />

̂F (v) = F (v) + ŵ(v)<br />

Ŵ (v) ( ˆf − ρ(v)F (v) − σ(v)f j − τ(v)f j+1 ) (14)<br />

Ŵ (v) = W (v) + ρ(v)ŵ(v) (15)<br />

where ŵ(v) is <strong>the</strong> new homogeneous coord<strong>in</strong>ate function <strong>for</strong> ˆv and ρ(v), σ(v), and τ(v)<br />

are <strong>the</strong> normalized barycentric coord<strong>in</strong>ates of ˆv with respect to <strong>the</strong> triangle [v, v j , v j+1 ].<br />

Note that ρ, σ, and τ can be computed from <strong>the</strong> same <strong>in</strong>gredients as ŵ.<br />

In <strong>the</strong> example <strong>in</strong> Figure 11, we exploited this recurrence relation as follows. We<br />

first sampled <strong>the</strong> three given curves uni<strong>for</strong>mly with 100 vertices v i and computed <strong>the</strong><br />

curve normals n i at v i . Then we evaluated <strong>the</strong> <strong>in</strong>terpolat<strong>in</strong>g function F as well as W<br />

on a regular 512×512 grid, yield<strong>in</strong>g values F kl and W kl with 0 ≤ k, l ≤ 511. We<br />

INSTITUT FÜR INFORMATIK

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

Saved successfully!

Ooh no, something went wrong!