public class BSpline extends Object
Constructor and Description |
---|
BSpline() |
Modifier and Type | Method and Description |
---|---|
static double[] |
convertToInterpCoef(double[] input,
double[] poles,
double tolerance)
Convert to interpolation coefficients
|
static double[] |
convertToSamples(double[] coef,
double[] samples)
Convert the spline coefficients to samples
|
static int |
factorial(int n)
Factorial
|
static double[] |
finDiffAS(double[] c)
Finite Difference.
|
static double |
initialAntiCausalCoefficient(double[] c,
double z)
Get initial anti-causal coefficients
|
static double |
initialCausalCoefficient(double[] c,
double z,
double tolerance)
Initialization of causal coefficients for mirror boundary conditions
|
static double[] |
integAS(double[] c)
Begin computation of the running sums.
|
static double |
integSA(double[] c,
double[] z)
Begin computation of the running sums.
|
static double |
mean(double[] A)
Calculate mean value on the period (2*length(A)-2)
|
static double[] |
resampling(double[] input,
int nInput,
int nOut,
double scale,
int n1,
int nt)
Geometric transform and resampling
|
static double[] |
resize1D(double[] input,
int n,
int n1,
int n2,
double scale,
boolean coefOrSamples)
Ref: A.
|
static double[] |
tableOfPoles(int splineDegree)
Recover the poles from a lookup table
|
static double[] |
tableOfSamples(int splineDegree)
Recover the B-spline samples values from a lookup table
|
public static double[] resize1D(double[] input, int n, int n1, int n2, double scale, boolean coefOrSamples)
Ref: A. Muñoz-Barrutia, T. Blu, M. Unser, "Least-Squares Image Resizing Using Finite Differences," IEEE Transactions on Image Processing, vol. 10, n. 9, September 2001.
Use: out(x) = input(x/scale)
; scale > 1
expansion;
a < 1
reduction.
Use n=n2
:
(n1==-1)
the standard method (interpolation and resampling)
is applied.(n=n1=n2)
, the orthogonal projection is computed. The error
is the minimum in the least-squares sense.((n1 > -1) && (n1<n2))
, the oblique projection is computed.
The error is slightly greater than the case above.input
- input signaln
- degree of the interpolation spline. It can vary from 0 to 3.n1
- degree of the analysis spline. It can vary from -1 to 3.n2
- degree of the synthesis spline. It can vary from 0 to 3.scale
- zoom factor (scale > 1
expansion; scale < 1
reduction)coefOrSamples
- if working with coefficients coefOrSamples is true; if
working with samples coefOrSamples is falsepublic static double[] convertToSamples(double[] coef, double[] samples)
coef
- input coefficients valuessamples
- output samplespublic static double[] finDiffAS(double[] c)
c
- input signalpublic static double[] resampling(double[] input, int nInput, int nOut, double scale, int n1, int nt)
input
- input signalnInput
- length of the input signalnOut
- length of the resize signalscale
- expansion/reductionn1
- degree of the analysis splinent
- (n+n1+1)public static int factorial(int n)
n
- public static double[] integAS(double[] c)
c
- input coefficientspublic static double integSA(double[] c, double[] z)
c
- coefficientsz
- sumspublic static double mean(double[] A)
A
- public static double[] convertToInterpCoef(double[] input, double[] poles, double tolerance)
input
- poles
- tolerance
- public static double initialAntiCausalCoefficient(double[] c, double z)
c
- coefficientsz
- polepublic static double initialCausalCoefficient(double[] c, double z, double tolerance)
c
- coefficientsz
- poletolerance
- accuracypublic static double[] tableOfPoles(int splineDegree)
splineDegree
- degree of the splinepublic static double[] tableOfSamples(int splineDegree)
splineDegree
- degree of the splineCopyright © 2015–2021 Fiji. All rights reserved.