Skip to main content
GameDev.net gamedev.net
🔒 Locked

Catmull Rom spline derivative

Started by xargon123 Nov 21, 2010 at 1:22 PM 2 replies 5.3k views
Original Post
xargon123
xargon123
Hello everyone,

I am currently using a Catmull Rom spline to interpolate intensities in an image using the matrix described here:

http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Interpolation_on_the_unit_interval_without_exact_derivatives

So, I am looking at the 16 values in the neighbourhood and applying the shown matrix and calculating the interpolated intensity and this works quite well.

Now, I also need to calculate the derivative of this spline.

Is it then simply, taking the derivatives of that kernel, which would be:

0.5 *

|4x - 3x^2 - 1|
|9x^2 - 10x |
|8x - 9x^2 + 1|
|3x^2 - 2x |

Thanks,
xarg
quasar3d
quasar3d
yes:)

Your control points (pixels) don't change, so you can treat them as constants.
xargon123
xargon123
Great!

Thanks for that :)
xargon123
xargon123
One final question about this:

The reason I need this is because I need to calculate the gradient of the 2D image which was generated by resampling the original image using the Catmull-Rom spline interpolation kernel.

So, the way I understand it is that the gradient of the resampled image should be the same as convolution of the resampled image with this derivative kernel. Does that sound right?

So, since it is a 2D image, the gradient would be a vector field with a 2-element vector at each pixel. The original interpolation worked by looking at the neighborhood 16 values and producing the interpolated intensity. I am struggling to understand how I can get the gradient vector field from this resampled image. I am guessing I somehow have to do the convolution in each axes separately, but struggling to see how that would work.

Thanks,
xarg

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.