|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.opt.CoordinateTransform
public class CoordinateTransform
Find a best linear combination of input coordinates to fit output coordinates. Finds a_io (a with subscripts i and o) to best approximate the linear transform.
out_o = sum_i ( a_io * in_i )where in_i are input coordinates,
The optimum coefficients minimize this least squares error:
sum_oj [ sum_i ( a_io * in_ij ) - out_oj ]^2where in_ij is an input array of different coordinates,
Normal equations (indexed by k) are solved independently for each o:
sum_ij ( in_kj * in_ij * a_io ) = sum_j ( in_kj * out_oj )The Hessian is
H = sum_j ( in_kj * in_ij )
and the gradient b = - sum_j ( in_kj * out_oj )
The solution is undamped and may not behave as you want for degenerate solutions.
If the linear transform needs a translation shift, then include a constant as one of the input coordinates.
| Constructor Summary | |
|---|---|
CoordinateTransform(int dimensionOut,
int dimensionIn)
Constructor sets number of input and output coordinates. |
|
| Method Summary | |
|---|---|
void |
add(double[] out,
double[] in)
Add an observation of a set of input and output coordinates You should add enough of these to determine (or overdetermine) a unique linear mapping. |
double[] |
get(double[] in)
For a given set of input coordinates, return the linearly predicted output coordinates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CoordinateTransform(int dimensionOut,
int dimensionIn)
dimensionOut - Number of output coordinates.dimensionIn - Number of input coordinates.| Method Detail |
|---|
public void add(double[] out,
double[] in)
out - A set of observered output coordinates
with an unknown linear relationship to input coordinates.in - A set of observered input coordinates
that should be linearly combined to calculate each of the
output coordinates.
To allow translation, include a constant 1.public double[] get(double[] in)
in - A set of input coordinates
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||