Class SplineInterpolator

java.lang.Object
imagingbook.common.image.interpolation.SplineInterpolator
All Implemented Interfaces:
PixelInterpolator
Direct Known Subclasses:
CatmullRomInterpolator, CubicBSplineInterpolator, MitchellNetravaliInterpolator

public class SplineInterpolator extends Object implements PixelInterpolator

A PixelInterpolator implementing spline interpolation in 2D. See Sec. 22.4 of [1] for additional details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/09/16
See Also:
  • Constructor Details

    • SplineInterpolator

      public SplineInterpolator(double a, double b)
      Constructor for creating a custom spline interpolator.
      Parameters:
      a - spline control parameter
      b - spline control parameter
  • Method Details

    • getInterpolatedValue

      public float getInterpolatedValue(ScalarAccessor ia, double x, double y)
      Description copied from interface: PixelInterpolator
      Returns the interpolated pixel value for the specified position.
      Specified by:
      getInterpolatedValue in interface PixelInterpolator
      Parameters:
      ia - a ScalarAccessor to the interpolated image
      x - continuous interpolation position (horiz.)
      y - continuous interpolation position (vert.)
      Returns:
      the interpolated pixel value at position (x,y).
    • getWeight

      public double getWeight(double x)
      Description copied from interface: PixelInterpolator
      Returns the value of the one-dimensional weight function w(x), that is the weight given to some pixel at distance x from the current interpolation point. This method is primarily used for testing.
      Specified by:
      getWeight in interface PixelInterpolator
      Parameters:
      x - the position relative to the interpolation point
      Returns:
      the weight for this position