Package smile.interpolation
Class BicubicInterpolation
java.lang.Object
smile.interpolation.BicubicInterpolation
- All Implemented Interfaces:
Serializable
,Interpolation2D
Bicubic interpolation in a two-dimensional regular grid. Bicubic
spline interpolation guarantees the continuity of the first derivatives,
as well as the continuity of a cross-derivative.
Note that CubicSplineInterpolation2D guarantees the continuity of the first and second function derivatives but bicubic spline guarantees continuity of only gradient and cross-derivative. Second derivatives could be discontinuous.
In image processing, bicubic interpolation is often chosen over bilinear interpolation or nearest neighbor in image resampling, when speed is not an issue. Images resampled with bicubic interpolation are smoother and have fewer interpolation artifacts.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
interpolate
(double x1p, double x2p) Interpolate the data at a given 2-dimensional point.toString()
-
Constructor Details
-
BicubicInterpolation
public BicubicInterpolation(double[] x1, double[] x2, double[][] y) Constructor. The value in x1 and x2 must be monotonically increasing.- Parameters:
x1
- the 1st dimension value.x2
- the 2nd dimension value.y
- the function values at(x1, x2)
.
-
-
Method Details
-
interpolate
public double interpolate(double x1p, double x2p) Description copied from interface:Interpolation2D
Interpolate the data at a given 2-dimensional point.- Specified by:
interpolate
in interfaceInterpolation2D
- Parameters:
x1p
- the 1st dimension value.x2p
- the 2nd dimension value.- Returns:
- the interpolated function value.
-
toString
-