dicinterpBspline.hpp

class Bspline : public Interpolator

Public Functions

Bspline(double *img, int px_hori, int px_vert)

Initializes the bicubic interpolator with deformed image data.

Sets up the necessary data structures and computes derivatives required for bicubic interpolation.

Parameters:
  • img – Pointer to the image data array

  • px_hori – Width of the image in pixels

  • px_vert – Height of the image in pixels

virtual double eval(const int ss_x, const int ss_y, const double subpx_x, const double subpx_y) const override

Evaluates the bicubic interpolation at a specified point.

Computes the interpolated value at (x,y) using bicubic interpolation from the surrounding pixel values.

Parameters:
  • x – The x-coordinate of the interpolation point

  • y – The y-coordinate of the interpolation point

Returns:

The interpolated value at (x,y)

virtual double eval_dx(const int ss_x, const int ss_y, const double subpx_x, const double subpx_y) const override

Evaluates the x-derivative of bicubic interpolation at a specified point.

Computes the partial derivative with respect to x at point (x,y).

Parameters:
  • x – The x-coordinate of the point

  • y – The y-coordinate of the point

Returns:

The x-derivative of the interpolated function at (x,y)

virtual double eval_dy(const int ss_x, const int ss_y, const double subpx_x, const double subpx_y) const override

Evaluates the y-derivative of bicubic interpolation at a specified point.

Computes the partial derivative with respect to y at point (x,y).

Parameters:
  • x – The x-coordinate of the point

  • y – The y-coordinate of the point

Returns:

The y-derivative of the interpolated function at (x,y)

virtual InterpVals eval_and_derivs(const int ss_x, const int ss_y, const double subpx_x, const double subpx_y) const override

Evaluates the bicubic interpolation and its derivatives at a specified point.

Computes the interpolated value and its partial derivatives at (x,y) in a single call.

Parameters:
  • x – The x-coordinate of the point

  • y – The y-coordinate of the point

Returns:

Data struct containing the interpolated value and its x and y derivatives

Private Functions

void prefilter_x()
void prefilter_y()

Private Members

std::vector<double> coeff
double *image

Private Static Functions

static inline void basis(double t, double B[4])
static inline void basis_d(double t, double Bd[4])