|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SpatialXform
public class SpatialXform
Class SpatialXform is used for doing non-linear order warping These methods are derived from:
Digital Image Warping, George Wolberg, IEEE Computer Press Monograph, Los Alamitos, CA, 1990. ISBN-0-8186-8944-7 See Section 3.6 Polygonal Transformations pp 61-75. A bivariate polygonal transformation for performing spatial interpolation This generates (aV, bV) from 6 landmarks. u= SUM SUM aU_ij * (x**i) * (y**j) i=0:n i=0:n-1 v= SUM SUM bV_ij * (x**i) * (y**j) i=0:n i=0:n-1 We use (n=2) (for n=1, this is a 3x3 Affine xform).
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker
Field Summary | |
---|---|
(package private) double[][] |
aU
[MXTERMS][MXTERMS]coefficients |
(package private) double[][] |
bV
[MXTERMS][MXTERMS] coefficients |
private static Flicker |
flk
Global instance |
private static Landmark |
lms
landmarks to use |
int |
MXTERMS
Maximum number of terms in spatial transform |
(package private) int |
nU
# of CTRL points in x1[], y2[], zU[] |
(package private) int |
nV
# of CTRL points in y1[], y2[], zV[] |
private static Util |
util
|
(package private) double[] |
wM
(dynamic) weights |
(package private) double[] |
x1
x1 is list of x coordinates for image 1 |
(package private) double[] |
x2
x2 is list of x coordinates for image 2 |
(package private) double[] |
y1
y1 is list of x coordinates for image 1 |
(package private) double[] |
y2
y2 is list of x coordinates for image 2 |
(package private) double[] |
z12U
OUTPUT: z[]= f(x[],y[]) |
(package private) double[] |
z12V
OUTPUT: z[]= f(x[],y[]) |
Constructor Summary | |
---|---|
SpatialXform(Flicker flk)
SpatialXform() - constructor. |
Method Summary | |
---|---|
(package private) static double |
basis(int f,
double x,
double y)
basis() - return (x,y) value of f'th orthogonal basis function. |
void |
cleanup()
cleanup() - destroy data structures |
(package private) static double |
coef(int k,
int nM,
double[] xM,
double[] yM,
double[] wM,
double[] zM,
double[][] aM)
coef() - Find kth mapping function coefficient (Eq. |
boolean |
computeSurfaceWarp(int nM,
int terms,
double[] xM,
double[] yM,
double[] zM,
double[][] aM,
double delta,
int xSize,
int ySize,
double[] sOut)
computeSurfaceWarp() - compute surface warp from data. |
int |
evalPoly(int n,
int xInt,
int yInt,
double[][] aM)
evalPoly() - eval f_n(x,y) |
int |
fitWarpLSQ(int nM,
double[] xM,
double[] yM,
double[] zM,
double[][] aM,
double delta)
fitWarpLSQ() - weighted LSQ spatial transform w/ orthogonal polynomials Based on algorithm described by Ardeshir Goshtasby in "Image resgistration by local approximation methods", Image and Vision computing, Vold 6, No. |
double[][] |
get_aU()
get_aU() - get aU[MXTERMS][MXTERMS] array this is solution to: |
double[][] |
get_bV()
get_bV() - get bV[MXTERMS][MXTERMS] array this is solution to: |
(package private) static double |
init_alpha(int j,
int k,
int nM,
double[] xM,
double[] yM,
double[] wM,
double[][] aM)
init_alpha() - compute parameter alpha(j,k) (EQ. |
(package private) static double |
poly(int k,
double x,
double y,
double[][] aM)
poly() - compute k'th polynomial function at point (x,y). |
boolean |
solvePolyXformCoef()
solvePolyXformCoef() - solve the aU, bV coefficients from LMS data. |
boolean |
warpLSQ(int nM,
double[] xM,
double[] yM,
double[] zM,
double[][] aM,
double delta,
int xSize,
int ySize,
double[] sOut)
warpLSQ() - weighted LSQ spatial transform with orthogonal polynomials Based on algorithm described by Ardeshir Goshtasby in "Image resgistration by local approximation methods", Image and Vision computing, Vold 6, No. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Flicker flk
private static Landmark lms
private static Util util
public final int MXTERMS
int nU
double[] x1
double[] x2
double[] z12U
double[][] aU
int nV
double[] y1
double[] y2
double[] z12V
double[][] bV
double[] wM
Constructor Detail |
---|
public SpatialXform(Flicker flk)
Method Detail |
---|
public void cleanup()
public boolean solvePolyXformCoef()
public final double[][] get_aU()
u= SUM SUM aU_ij * (x**i) * (y**j) i=0:n i=0:n-1
public final double[][] get_bV()
v= SUM SUM bV_ij * (x**i) * (y**j) i=0:n i=0:n-1
public final int evalPoly(int n, int xInt, int yInt, double[][] aM)
f= SUM SUM c_ij * (x**i) * (y**j) i=0:n i=0:n-1
n
- ishighest degree of polynomialxInt
- is pointyInt
- is pointaM
- is [MXTERMS][MXTERMS] coeffs.
static final double basis(int f, double x, double y)
f
- is basis function desiredx
- pointy
- point
static final double poly(int k, double x, double y, double[][] aM)
k
- is k'th fctx
- pointy
- pointaM
- coefficients
static final double coef(int k, int nM, double[] xM, double[] yM, double[] wM, double[] zM, double[][] aM)
k
- is kth mapping functionnM
- is #CTL pts xM[],yM[],zM[]xM
- list of pointsyM
- list of pointswM
- weightszM
- z[]= f(x[],y[]aM
- coefficients
static final double init_alpha(int j, int k, int nM, double[] xM, double[] yM, double[] wM, double[][] aM)
j
- indexk
- indexnM
- is #CTL pts xM[],yM[],zM[]xM
- list of pointsyM
- list of pointswM
- weightsaM
- coefficients
public int fitWarpLSQ(int nM, double[] xM, double[] yM, double[] zM, double[][] aM, double delta)
nM
- is #CTL pts xM[],yM[],zM[]xM
- list of pointsyM
- list of pointszM
- return z[]= f(x[],y[]aM
- coefficientsdelta
- is smoothing factor, 0 is not smooth
public boolean computeSurfaceWarp(int nM, int terms, double[] xM, double[] yM, double[] zM, double[][] aM, double delta, int xSize, int ySize, double[] sOut)
nM
- is # CTRL points xM, yM, zMterms
- is # of termsxM
- pointsyM
- pointszM
- return z[]= f(x[],y[])aM
- coefficientsdelta
- is smoothing factor, 0 is not smoothxSize
- is size of xMySize
- is size of yMsOut
- return fitted surface values of points (xSize by ySize).
public boolean warpLSQ(int nM, double[] xM, double[] yM, double[] zM, double[][] aM, double delta, int xSize, int ySize, double[] sOut)
nM
- is # CTRL points xM, yM, zMxM
- pointsyM
- pointszM
- return z[]= f(x[],y[])aM
- coefficientsdelta
- is smoothing factor, 0 is not smoothxSize
- is size of xMySize
- is size of yMsOut
- return fitted surface values of points (xSize by ySize).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |