Commit b56ba447 authored by Andrey Filippov's avatar Andrey Filippov

Adding "importance"

parent 97bfc4bf
......@@ -39,14 +39,27 @@ public class CuasMotionLMA {
public static final int RSLT_Y = 1;
public static final int RSLT_A = 2;
public static final int RSLT_R0 = 3;
public static final int RSLT_K = 4;
public static final int RSLT_C = 5;
public static final int RSLT_RMS = 6;
public static final int RSLT_ITERS = 7;
public static final int RSLT_LEN = RSLT_ITERS+1;
public static final String [] LMA_TITLES = {"X-OFFS","Y-OFFS", "AMPLITUDE","RADIUS","OVERSHOOT","OFFSET","RMSE","ITERATIONS"};
public static final int RSLT_R1 = 4;
public static final int RSLT_K = 5;
public static final int RSLT_C = 6;
public static final int RSLT_RMS = 7;
public static final int RSLT_RMS_A = 8;
public static final int RSLT_MAX2A = 9;
public static final int RSLT_ITERS =10;
public static final int RSLT_FAIL = 11;
public static final int RSLT_LEN = RSLT_FAIL+1;
public static final String [] LMA_TITLES = {"X-OFFS","Y-OFFS", "AMPLITUDE","RADIUS","RAD_POS", "OVERSHOOT","OFFSET","RMSE","RMSE/A","MAX2A","ITERATIONS","FAILURE"};
public static final int FAIL_NONE = 0;
public static final int FAIL_A_LOW = 1; // amplitude is too low
public static final int FAIL_ACENT = 2; // ratio of maximal pixel to amplitude is too low
public static final int FAIL_RMSE = 3; // RMSE is too high
public static final int FAIL_RMSE_R = 4; // BOTH RMSE is not sufficient and RMSE/A is too high
public static final int FAIL_R0_HIGH = 5; // Full radius (including negative overshoot) is too high
public static final int FAIL_R1_LOW = 6; // Inner (positive) peak radius is too low
public static final int FAIL_K_LOW = 7; // Overshoot is too low (not used, it can be down to 0)
public static final int FAIL_K_HIGH = 8; // Overshoot is too high
public static final int FAIL_FAR = 9; // Peak is too far from the center
private int width;
private double [][] window;
......@@ -62,6 +75,7 @@ public class CuasMotionLMA {
private double [] last_ymfx = null;
private double [][] last_jt = null;
private int iters = -2; // never ran
private double max_val = 0;
public CuasMotionLMA(
int width,
......@@ -110,10 +124,13 @@ public class CuasMotionLMA {
double yc, // relative to center =width/2
double r0,
double k,
double lmax_val, // maximal pixel value near the centroid maximum to be used for comparison with A
int debugLevel) {
max_val = lmax_val;
y_vector = tile_data;
double x0 = Math.min(Math.max(xc + width/2, 0), width-1);
double y0 = Math.min(Math.max(yc + width/2, 0), width-1);
int ix0 = (int) Math.round(x0);
int iy0 = (int) Math.round(y0);
......@@ -182,9 +199,12 @@ public class CuasMotionLMA {
rslt[RSLT_Y] = getCenter()[1];
rslt[RSLT_A] = getA();
rslt[RSLT_R0] = getR0();
rslt[RSLT_R1] = getR0() / ((getK()>1) ? getK() : 1.0);
rslt[RSLT_K] = getK();
rslt[RSLT_C] = getC();
rslt[RSLT_RMS] = getRMS();
rslt[RSLT_RMS_A] = getRMS()/getA();
rslt[RSLT_MAX2A] = max_val/getA(); // ratio of maximal value to LMA amplitude
rslt[RSLT_ITERS] = getIters();
return rslt;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment