How can I understand the equation for bicubic interpolation?

In summary, the wikipedia article on bicubic interpolation appears to describe how to arrive at an equation for bicubic interpolation, but I cannot decipher it. Using the derivatives described I don't understand how to arrive at the relevant equation from the coordinates of the point and the values of the points around it. I don't understand why I can't understand this.
  • #1
Hypatio
151
1
The wikipedia article on bicubic interpolation appears to describe how to arrive at an equation for bicubic interpolation, but I cannot decipher it. Using the derivatives described I don't understand how to arrive at the relevant equation from the coordinates of the point and the values of the points around it.

I don't understand why I can't understand this.
 
Physics news on Phys.org
  • #2
Hypatio said:
The wikipedia article on bicubic interpolation appears to describe how to arrive at an equation for bicubic interpolation, but I cannot decipher it. Using the derivatives described I don't understand how to arrive at the relevant equation from the coordinates of the point and the values of the points around it.

I don't understand why I can't understand this.

Your last point is a tough one to overcome.

But, getting back to bicubic interpolation, the algorithm here is trying to interpolate a surface, or a function f(x,y) = z, rather than the standard cubic interpolation algorithm, which tries to interpolate a simple function, f(x) = y.

Where one uses the derivative f'(x) in order to formulate boundary conditions necessary to provide a unique set of cubic interpolation parameters for the simple function f(x), in the bicubic interpolation of a surface f(x,y), then partial derivatives are required to provide boundary conditions to determine the unique bicubic interpolating parameters.
 
  • #3
SteamKing said:
Your last point is a tough one to overcome.

But, getting back to bicubic interpolation, the algorithm here is trying to interpolate a surface, or a function f(x,y) = z, rather than the standard cubic interpolation algorithm, which tries to interpolate a simple function, f(x) = y.

Where one uses the derivative f'(x) in order to formulate boundary conditions necessary to provide a unique set of cubic interpolation parameters for the simple function f(x), in the bicubic interpolation of a surface f(x,y), then partial derivatives are required to provide boundary conditions to determine the unique bicubic interpolating parameters.

Yes but what is the equation? I don't understand how the equation

[tex]p(x,y) = \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} x^i y^j[/tex]

is expanded to something computationally explicit using the coefficients and derivatives given.
 
  • #4
You have to expand the double summation (the big sigma thingies):

p(x,y) = a00 * x^0*y^0 + a10*x^1*y^0 + a20 * x^2 * y^0 + ... + a33*x^3*y^3

The coefficients a00, a10, etc. are found from the solution of the matrix equation
[A]{alpha} = {x}, where [A] is a 16x16 square matrix and {alpha} and {x} are 16x1 column vectors.

IMO, the Wiki article is written in a very straightforward fashion. Have you studied matrix algebra and systems of equations?
 
  • #5
I have tried to study matrix algebra and systems of equations, but the notation has always seemed convoluted and highly non-intuitive to me, so it is difficult. So the article is probably clear and the trouble is mine.

Looking more closely I think I see how the 16 equations given are related to the inverse matrix (A^-1), but I do not understand how the values a_ij are related to the data.

For instance, part of the solution is the equation f(0,0)=p(0,0)=a_00, but what are these parameters? How do I get them from the known points? How do I get f(0,0) or p(0,0)? I would say that p(0,0) is simply the known at (0,0), but then I don't understand why p(1,0) is somehow equal to a_00+a_10+a_20+a_30...

Also, are the values of x and y between 0 and 3? And why does this algorithm only seem to use four points, when you should actually need 16 points?
 
  • #6
Remember, the bicubic interpolation covers an area, rather than a line.

Look at the illustrations on the right hand side of the article. The area which the bicubic interpolates is 3 units wide by 3 units high. The lower left hand corner has coordinates (x,y) = (0,0) and the upper right hand side has coordinates (x,y) = (3,3)

The bicubic is formulated such that p(x,y) = f(x,y) exactly at each of the 16 points where x and y are integers, for instance, when x = 1 and y = 1.

To clear up the notation, f(x,y) represents a point on the surface to be interpolated, and a formula f(x,y) = some function of x and y may not be known.
However, by measurement or whatever, you know the values of f(x,y) at 16 points.
What you are trying to do is fit a surface to this data so that you can calculate f(x,y) at a random point of your choosing.

The interpolated function you derive from the bicubic procedure is p(x,y) which is what is used to calculate the value of the function f(x,y).

As a suggestion, I recommend you review cubic interpolation of a function y = f(x) thoroughly before you plunge into the bicubic procedure.
 
  • #7
I've had no problem doing cubic interpolation. A scheme is given here, which is the type of algebraic solution I am trying to get for the bicubic case. I tried to find a matrix scheme like that given here for the bicubic case for cubic interpolation so that I could compare the operations, but can't find anything.

Looks like I am failing in two places:
1. I'm failing to see how the coefficients a_00, etc. are obtained from the matrix equation {alpha}=A^-1x since x=[f(0,0) f(1,0) f(0,1)...]^T, where f(x,y) is simply equal to some sum of the coefficients again. I don't see how to solve it unless I ignore them and simply say that f(0,0) etc. are the points.

2. I see how the first four equations are derived, but I don't understand where the derivatives come from. The expanded sum is

[tex]p(x,y)=a_{00}+a_{01}y+a_{02}y^2+a_{03}y^3+a_{10}x+a_{11}xy+a_{12}xy^2+a_{13}xy^3+a_{20}x^2+a_{21}x^2y+a_{22}x^2y^2+a_{23}x^2y^3+a_{30}x^3+a_{31}x^3y+a_{32}x^3y^2+a_{33}x^3y^3[/tex]
If I take the derivative of all the terms (e.g. in x) I should have more terms, e.g.:

[tex]f_x(1,0)=p_x(1,0)=\frac{1}{x}a_{00}+a_{10}+2a_{20}+3a_{30}[/tex]
But they give
[tex]f_x(1,0)=p_x(1,0)=a_{10}+2a_{20}+3a_{30}[/tex]
 
  • #8
To recapitulate from the article:

Suppose the function values f and the derivatives f_x, f_y and f_{xy} are known at the four corners (0,0), (1,0), (0,1), and (1,1) of the unit square. The interpolated surface can then be written:

p(x,y) = double sum formula

You have to know 4 values of the function f(x,y) to be interpolated PLUS 12 values of the derivatives of f(x,y) at the corner points.

The values of the bicubic interpolation and the function are the same at each or the four corners, thus p(x,y) = f(x,y), where x,y = 0 or 1

The values of a are determined by solving the matrix equation [A]{alpha}={x}

Now, the article has done part of the solution by specifying the inverse of [A]
which is what A^-1 = represents.

Then {alpha} = [A]^-1 {x} which is a 16x16 matrix multiplied by a 16x1 column vector

The values of [A]^-1 are given in the article, and the values of {x} are the known values of the function f(x,y) and its derivatives at the corner points.
 
  • #9
Thanks for helping me think about this. It turns out I didn't fully understand that the function values f(x,y) including the derivatives needed to be found from the data, so I just used finite differences and now have a working algorithm.
 

FAQ: How can I understand the equation for bicubic interpolation?

What is a bicubic interpolation scheme?

A bicubic interpolation scheme is a mathematical algorithm used to estimate the values of unknown data points in a grid or image. It is a type of interpolation that uses a cubic polynomial function to approximate the values between known data points.

How does bicubic interpolation differ from other interpolation methods?

Bicubic interpolation differs from other methods, such as linear or bilinear interpolation, in that it uses a more complex mathematical function to estimate the values between known data points. This allows for a more accurate representation of the data and can produce smoother results.

What are the advantages of using bicubic interpolation?

One advantage of bicubic interpolation is that it can produce higher quality results compared to simpler interpolation methods. It can also handle more complex data patterns and produce smoother curves or surfaces. Additionally, bicubic interpolation is less prone to introducing artifacts or distortions in the data.

What are the limitations of bicubic interpolation?

One limitation of bicubic interpolation is that it can be computationally expensive and may not be suitable for real-time applications. It also requires a large number of data points to accurately estimate the values between them. Bicubic interpolation may also struggle with data that has sharp edges or sudden changes in values.

In what fields is bicubic interpolation commonly used?

Bicubic interpolation is commonly used in various fields such as computer graphics, image processing, and data analysis. It is often used to improve the visual quality of images or to interpolate missing data points in datasets. Bicubic interpolation can also be found in applications such as digital zooming, image resizing, and terrain modeling.

Similar threads

Replies
2
Views
5K
Replies
1
Views
3K
Replies
1
Views
10K
Replies
2
Views
11K
Replies
6
Views
2K
Replies
4
Views
2K
Back
Top