public abstract class WarpFunction2
extends java.lang.Object
Warping is the computation of the sequence g(y) = f(x(y)). Unwarping is the computation of the sequence f(x) = g(y(x)).
For warping, we need the function x(y) = y-u(x(y)) = y-uy(y). We compute the displacement uy(y) by iteration so that uy(y) = u(x(y)).
We also define a midpoint m(x) = (x+y(x))/2, and compute the displacement um(m) = u(x(m)) from u(x) by iteration so that um(m) = u(x(m)).
Modifier | Constructor and Description |
---|---|
protected |
WarpFunction2(int n1,
int n2) |
Modifier and Type | Method and Description |
---|---|
static WarpFunction2 |
constant(double u1,
double u2,
int n1,
int n2)
Returns a warping for a constant shift.
|
static WarpFunction2 |
constantPlusSinusoid(double c1,
double c2,
double u1,
double u2,
int n1,
int n2)
Returns a constant-plus-sinusoidal warping.
|
static WarpFunction2 |
gaussian(double u1,
double u2,
int n1,
int n2)
Returns a derivative-of-Gaussian warping.
|
static WarpFunction2 |
sinusoid(double u1,
double u2,
int n1,
int n2)
Returns a sinusoidal warping.
|
abstract double |
u1(double x1,
double x2)
Returns the 1st component of the shift u(x).
|
float[][] |
u1m()
Returns an array[n2][n1] of 1st components of shifts um(m) = u(x(m)).
|
double |
u1m(double m1,
double m2)
Returns the 1st component of the shift um(m) = u(x(m)).
|
float[][] |
u1x()
Returns an array[n2][n1] of 1st components of shifts u(x).
|
double |
u1x(double x1,
double x2)
Returns the 1st component of the shift u(x).
|
float[][] |
u1y()
Returns an array[n2][n1] of 1st components of shifts uy(y) = u(x(y)).
|
double |
u1y(double y1,
double y2)
Returns the 1st component of the shift uy(y) = u(x(y)).
|
abstract double |
u2(double x1,
double x2)
Returns the 2nd component of the shift u(x).
|
float[][] |
u2m()
Returns an array[n2][n1] of 2nd components of shifts um(m) = u(x(m)).
|
double |
u2m(double m1,
double m2)
Returns the 2nd component of the shift um(m) = u(x(m)).
|
float[][] |
u2x()
Returns an array[n2][n1] of 2nd components of shifts u(x).
|
double |
u2x(double x1,
double x2)
Returns the 2nd component of the shift u(x).
|
float[][] |
u2y()
Returns an array[n2][n1] of 2nd components of shifts uy(y) = u(x(y)).
|
double |
u2y(double y1,
double y2)
Returns the 2nd component of the shift uy(y) = u(x(y)).
|
float[][] |
unwarp(float[][] g)
Unwarps a sampled function using only all components of shifts.
|
float[][] |
unwarp1(float[][] g)
Unwarps a sampled function using only 1st components of shifts.
|
float[][] |
warp(float[][] f)
Warps a sampled function using only all components of shifts.
|
float[][] |
warp1(float[][] f)
Warps a sampled function using only 1st components of shifts.
|
public static WarpFunction2 constant(double u1, double u2, int n1, int n2)
u1
- shift in 1st dimension.u2
- shift in 2nd dimension.n1
- number of samples in 1st dimension.n2
- number of samples in 2nd dimension.public static WarpFunction2 gaussian(double u1, double u2, int n1, int n2)
u1
- maximum shift in 1st dimension.u2
- maximum shift in 2nd dimension.n1
- number of samples in 1st dimension.n2
- number of samples in 2nd dimension.public static WarpFunction2 sinusoid(double u1, double u2, int n1, int n2)
u1
- maximum shift in 1st dimension.u2
- maximum shift in 2nd dimension.n1
- number of samples in 1st dimension.n2
- number of samples in 2nd dimension.public static WarpFunction2 constantPlusSinusoid(double c1, double c2, double u1, double u2, int n1, int n2)
c1
- constant shift in 1st dimension.c2
- constant shift in 2nd dimension.u1
- maximum sinusoidal shift in 1st dimension.u2
- maximum sinusoidal shift in 2nd dimension.n1
- number of samples in 1st dimension.n2
- number of samples in 2nd dimension.public abstract double u1(double x1, double x2)
x1
- 1st coordinate of the point x.x2
- 2nd coordinate of the point x.public abstract double u2(double x1, double x2)
x1
- 1st coordinate of the point x.x2
- 2nd coordinate of the point x.public double u1x(double x1, double x2)
x1
- 1st coordinate of the point x.x2
- 2nd coordinate of the point x.public double u2x(double x1, double x2)
x1
- 1st coordinate of the point x.x2
- 2nd coordinate of the point x.public double u1m(double m1, double m2)
m1
- 1st coordinate of the point m.m2
- 2nd coordinate of the point m.public double u2m(double m1, double m2)
m1
- 1st coordinate of the point m.m2
- 2nd coordinate of the point m.public double u1y(double y1, double y2)
y1
- 1st coordinate of the point y.y2
- 2nd coordinate of the point y.public double u2y(double y1, double y2)
y1
- 1st coordinate of the point y.y2
- 2nd coordinate of the point y.public float[][] u1x()
public float[][] u2x()
public float[][] u1m()
public float[][] u2m()
public float[][] u1y()
public float[][] u2y()
public float[][] warp1(float[][] f)
f
- array of values f(x).public float[][] warp(float[][] f)
f
- array of values f(x).public float[][] unwarp1(float[][] g)
g
- array of values g(x).public float[][] unwarp(float[][] g)
g
- array of values g(x).