This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Notes on Bilinear and Trilinear Interpolation 1 Linear Interpolation in 1D Let us consider first the simplest case of interpolation, namely linear interpolation in 1D. Assume we have 2 points x and x 1 on some axis associated with two values f and f 1 , respectively. We wish to determine the value at some other point x located between x and x 1 using linear interpolation. The situation is illustrated in Figure 1. Figure 1: Linear interpolation in 1D between ( x ,f 0) and ( x 1 ,f 1 ). To do so, we first compute the local coordinate u of x with respect to x and x 1 , which is obtained as: u = x x x 1 x . The value f ( x ) at x can now be computed as f ( x ) = (1 u ) f + uf 1 (1) Note that Equation 1 can also be written in the (maybe?) more familiar form: f ( x ) f = u ( f 1 f ) = ( x x ) f 1 f x 1 x . This latter expression corresponds namely to the equation of a line through ( x ,f ) with slope f 1 f x 1 x . Observe also that in the even simpler case where x = 0 and x 1 = 1 (i.e. linear interpolation in the unit interval), u = x and the previous expression can be simplified as follows: f ( x ) f = x ( f 1 f ) . (2) 1 Figure 2: Bilinear interpolation in unit square. 2 Bilinear Interpolation in 2D We now consider the case of a unit square in the plane and associate a value which each of its 4 vertices (e.g, f (0 , 0) =: f 00 , f (1 , 0) =: f 10 , etc...). We want to interpolate these 4 values at a given position P = ( u,v ) located within the square. Refer to Figure 2. The basic idea behind bilinear interpolation is to break this interpolation problem into successive linear interpolation steps. If we look at Figure 2, we see that the position ( u,v ) is located on the vertical edge connecting ( u, 0) and ( u, 1), and its local coordinates with respect to these two points is v (refer to previous discussion about local coordinates). Additionally, ( u, 0) is located on the bottom edge connecting (0 , 0) and (1 , 0), with local coordinate u . If we apply Equation 2 on that edge, we can determine the value at ( u, 0) to be f ( u, 0) = f 00 + u ( f 10 f 00 ) = (1 u ) f 00 + uf 10 . (3) Applying the exact same reasoning to the position ( u, 1) located on the top edge connecting (0 , 1) to (1 , 1), we obtain: f ( u, 1) = f 01 + u ( f 11 f 01 ) = (1 u ) f 01 + uf 11 . (4) The final step consists in interpolating linearly along the edge ( u, 0) ( u, 1), where the point ( u,v ) has local coordinate v . One gets:....
View Full
Document
 Fall '08
 Staff

Click to edit the document details