Commit 9a4d969e authored by Andrey Filippov's avatar Andrey Filippov

Profiling and convenience features

parent 5961834e
...@@ -160,28 +160,29 @@ public class CuasMotionLMA { ...@@ -160,28 +160,29 @@ public class CuasMotionLMA {
public static final String EXTRA_SLICE_DISCARD_ON_LOAD = "Targets"; public static final String EXTRA_SLICE_DISCARD_ON_LOAD = "Targets";
public static final int FAIL_PENDING = -1; // By Claude on 05/07/2026: motion sentinel — tile tracked but not yet processed by LMA public static final int FAIL_PENDING = -1; // By Claude on 05/07/2026: motion sentinel — tile tracked but not yet processed by LMA
public static final int FAIL_NONE = 0; public static final int FAIL_NONE = 0;
public static final int FAIL_MOTION = 1; // motion strength/fraction too low public static final int FAIL_MOTION = 1; // motion strength/fraction too low, also - motion score too low
public static final int FAIL_NO_MAX = 2; // no suitable local maximum public static final int FAIL_NO_MAX = 2; // no suitable local maximum
public static final int FAIL_CENT_STR = 3; // centroid amplitude is too low public static final int FAIL_CENT_STR = 3; // centroid amplitude is too low
public static final int FAIL_CENT_FRAC = 4; // centroid fraction (energy in the peak fraction of all) is too low public static final int FAIL_CENT_FRAC = 4; // centroid fraction (energy in the peak fraction of all) is too low
public static final int FAIL_LMA = 5; // LMA fail to converge public static final int FAIL_LMA = 5; // LMA fail to converge
public static final int FAIL_A_PRE = 6; // amplitude is too low at preliminary filter (just after LMA) public static final int FAIL_A_PRE = 6; // amplitude is too low at preliminary filter (just after LMA)
public static final int FAIL_A_LOW = 7; // amplitude is too low public static final int FAIL_A_LOW = 7; // amplitude is too low
public static final int FAIL_ACENT = 8; // ratio of maximal pixel to amplitude is too low public static final int FAIL_Q_LOW = 8; // score too low
public static final int FAIL_RMSE = 9; // RMSE is too high public static final int FAIL_ACENT = 9; // ratio of maximal pixel to amplitude is too low
public static final int FAIL_RMSE_R = 10; // BOTH RMSE is not sufficient and RMSE/A is too high public static final int FAIL_RMSE = 10; // RMSE is too high
public static final int FAIL_R0_HIGH = 11; // Full radius (including negative overshoot) is too high public static final int FAIL_RMSE_R = 11; // BOTH RMSE is not sufficient and RMSE/A is too high
public static final int FAIL_R1_LOW = 12; // Inner (positive) peak radius is too low public static final int FAIL_R0_HIGH = 12; // Full radius (including negative overshoot) is too high
public static final int FAIL_K_LOW = 13; // Overshoot is too low (not used, it can be down to 0) public static final int FAIL_R1_LOW = 13; // Inner (positive) peak radius is too low
public static final int FAIL_K_HIGH = 14; // Overshoot is too high public static final int FAIL_K_LOW = 14; // Overshoot is too low (not used, it can be down to 0)
public static final int FAIL_FAR = 15; // Peak is too far from the center public static final int FAIL_K_HIGH = 15; // Overshoot is too high
public static final int FAIL_VCORR = 16; // MV refinement (fine pass) resulted in a too high correction (not yet checked) public static final int FAIL_FAR = 16; // Peak is too far from the center
public static final int FAIL_HORIZON = 17; // Peak is below horizon public static final int FAIL_VCORR = 17; // MV refinement (fine pass) resulted in a too high correction (not yet checked)
public static final int FAIL_MISMATCH = 18; // Mismatch on both ends is too high public static final int FAIL_HORIZON = 18; // Peak is below horizon
public static final int FAIL_NEIGHBOR = 19; // failed because some neighbor is stronger public static final int FAIL_MISMATCH = 19; // Mismatch on both ends is too high
public static final int FAIL_DUPLICATE= 20; // coordinate are (almost) the same as those of a stronger tile public static final int FAIL_NEIGHBOR = 20; // failed because some neighbor is stronger
public static final int FAIL_USED= 21; // non-centered used to generate centered, remove this public static final int FAIL_DUPLICATE= 21; // coordinate are (almost) the same as those of a stronger tile
public static final int FAIL_FL_ONLY= 22; // Flight log data only, no target detected here public static final int FAIL_USED= 22; // non-centered used to generate centered, remove this
public static final int FAIL_FL_ONLY= 23; // Flight log data only, no target detected here
public static final int CENTERED_NO = 0; public static final int CENTERED_NO = 0;
public static final int CENTERED_YES = 1; public static final int CENTERED_YES = 1;
......
...@@ -823,9 +823,15 @@ min_str_neib_fpn 0.35 ...@@ -823,9 +823,15 @@ min_str_neib_fpn 0.35
public int cuas_num_cycles = 25; // number of cycles of testing and removing bad targets // will get out earlier public int cuas_num_cycles = 25; // number of cycles of testing and removing bad targets // will get out earlier
public int cuas_trim_first = 5; // Trim targets after first (non-centered) pass (if > 0) public int cuas_trim_first = 5; // Trim targets after first (non-centered) pass (if > 0)
public boolean cuas_early_en = true; // Apply early fail filter after phase 1
public double cuas_early_mscore = 0.0015;// Minimal motion score (RSLT_MSCORE)
public double cuas_early_vstr = 0.007; // Minimal MV confidence (RSLT_VSTR)
public double cuas_early_score = 0.32; // Minimal score (RSLT_QSCORE)
public double cuas_early_amp = 0.35; // Minimal amplitude (RSLT_A)
// Recalculate Motion Vectors before centered \"tracking camera\" // Recalculate Motion Vectors before centered \"tracking camera\"
public boolean cuas_recalc_mv = true; // Recalculate motion vectors before centered targets accumulation by masking far-from target areas // public boolean cuas_recalc_mv = true; // Recalculate motion vectors before centered targets accumulation by masking far-from target areas
public int cuas_recalc_mv_num = 2; // Number of recalculations of the motion vectors before centered targets accumulation by masking far-from target areas public int cuas_recalc_mv_num = 2; // Number of recalculations of the motion vectors before centered targets accumulation by masking far-from target areas
public double cuas_recalc_mv_boost = 4.0; // Scale default number of correlation pairs for motion vectors calculation public double cuas_recalc_mv_boost = 4.0; // Scale default number of correlation pairs for motion vectors calculation
public double cuas_recalc_mv_corr = 4.0; // Scale corr_offset for refinement pass (will use (int)Math.round() public double cuas_recalc_mv_corr = 4.0; // Scale corr_offset for refinement pass (will use (int)Math.round()
...@@ -908,7 +914,8 @@ min_str_neib_fpn 0.35 ...@@ -908,7 +914,8 @@ min_str_neib_fpn 0.35
public boolean cuas_slow_en = true; // enable slow (almost static) target detection // verify temporal offset with fast public boolean cuas_slow_en = true; // enable slow (almost static) target detection // verify temporal offset with fast
public double cuas_slow_ra = 50.0; // running averaging for slow targets public double cuas_slow_ra = 50.0; // running averaging for slow targets
public double cuas_slow_score = 1.0; // scale scores for slow target mode public double cuas_slow_score = 1.0; // scale scores for slow target mode
public double cuas_score_mv = 0.0; // minimal score for the motion vectors //70: Phase1-mscore Rectangle(51, 38, 10, 1) scenes:[0, 235] min = 0.001979102846235037, max = 0.1058499738574028
public double cuas_score_mv = 0.0015; // minimal score for the motion vectors
public double cuas_score_lma = 1.6; // minimal score for the target LMA public double cuas_score_lma = 1.6; // minimal score for the target LMA
public double cuas_factor_lim = 5.0; // limit each individual score factor public double cuas_factor_lim = 5.0; // limit each individual score factor
public double cuas_factor_pow = 1.0; // raise score factor to this power before combining public double cuas_factor_pow = 1.0; // raise score factor to this power before combining
...@@ -2771,9 +2778,19 @@ min_str_neib_fpn 0.35 ...@@ -2771,9 +2778,19 @@ min_str_neib_fpn 0.35
gd.addNumericField("Trim targets after non-centered pass", this.cuas_trim_first, 0,3,"", gd.addNumericField("Trim targets after non-centered pass", this.cuas_trim_first, 0,3,"",
"Trim targets after first (non-centered) pass (if > 0)."); "Trim targets after first (non-centered) pass (if > 0).");
gd.addMessage("=== Early Fail Filters (after phase 1) ===");
gd.addCheckbox ("Apply early fail filters", this.cuas_early_en,
"Reduce number of target candidates after phase 1.");
gd.addNumericField("Motion score (RSLT_MSCORE)", this.cuas_early_mscore, 5,8,"",
"Minimal motion score (RSLT_MSCORE).");
gd.addNumericField("Motion confidence (RSLT_VSTR)", this.cuas_early_vstr, 5,8,"",
"Minimal MV confidence (RSLT_VSTR).");
gd.addNumericField("Score (RSLT_QSCORE)", this.cuas_early_score, 5,8,"",
"Minimal score (RSLT_QSCORE).");
gd.addNumericField("Amplitude (RSLT_A)", this.cuas_early_amp, 5,8,"",
"Minimal amplitude (RSLT_A).");
gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ==="); gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ===");
// gd.addCheckbox ("Refine motion vectors", this.cuas_recalc_mv,
// "Recalculate motion vectors before centered targets accumulation by masking far-from target areas.");
gd.addNumericField("Refine morion vector passes", this.cuas_recalc_mv_num, 0,3,"", gd.addNumericField("Refine morion vector passes", this.cuas_recalc_mv_num, 0,3,"",
"Number of MV refinement passes: 0 - no refinement, 1 - coarse, 2 coarse+fine."); "Number of MV refinement passes: 0 - no refinement, 1 - coarse, 2 coarse+fine.");
gd.addNumericField("Boost number of correlation pairs", this.cuas_recalc_mv_boost, 5,8,"x", gd.addNumericField("Boost number of correlation pairs", this.cuas_recalc_mv_boost, 5,8,"x",
...@@ -2916,6 +2933,9 @@ min_str_neib_fpn 0.35 ...@@ -2916,6 +2933,9 @@ min_str_neib_fpn 0.35
gd.addNumericField("Minimal max pixel to amplitude ratio", this.cuas_lma_a2a, 5,8,"", gd.addNumericField("Minimal max pixel to amplitude ratio", this.cuas_lma_a2a, 5,8,"",
"Minimal ratio of the maximal pixel near fitted maximum to the LMA amplitude."); "Minimal ratio of the maximal pixel near fitted maximum to the LMA amplitude.");
gd.addMessage("=== Reuse already calculated targets ===");
gd.addMessage("=== Slow targets detection ==="); gd.addMessage("=== Slow targets detection ===");
gd.addCheckbox ("Enable slow targets detection", this.cuas_slow_en, gd.addCheckbox ("Enable slow targets detection", this.cuas_slow_en,
"Enable slow (almost static) target detection // verify temporal offset with fast."); "Enable slow (almost static) target detection // verify temporal offset with fast.");
...@@ -4454,7 +4474,12 @@ min_str_neib_fpn 0.35 ...@@ -4454,7 +4474,12 @@ min_str_neib_fpn 0.35
this.cuas_num_cycles = (int) gd.getNextNumber(); this.cuas_num_cycles = (int) gd.getNextNumber();
this.cuas_trim_first = (int) gd.getNextNumber(); this.cuas_trim_first = (int) gd.getNextNumber();
// this.cuas_recalc_mv = gd.getNextBoolean(); this.cuas_early_en = gd.getNextBoolean();
this.cuas_early_mscore = gd.getNextNumber();
this.cuas_early_vstr = gd.getNextNumber();
this.cuas_early_score = gd.getNextNumber();
this.cuas_early_amp = gd.getNextNumber();
this.cuas_recalc_mv_num = (int) gd.getNextNumber(); this.cuas_recalc_mv_num = (int) gd.getNextNumber();
this.cuas_recalc_mv_boost = gd.getNextNumber(); this.cuas_recalc_mv_boost = gd.getNextNumber();
this.cuas_recalc_mv_corr = gd.getNextNumber(); this.cuas_recalc_mv_corr = gd.getNextNumber();
...@@ -5777,6 +5802,12 @@ min_str_neib_fpn 0.35 ...@@ -5777,6 +5802,12 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_num_cycles", this.cuas_num_cycles+""); // int properties.setProperty(prefix+"cuas_num_cycles", this.cuas_num_cycles+""); // int
properties.setProperty(prefix+"cuas_trim_first", this.cuas_trim_first+""); // int properties.setProperty(prefix+"cuas_trim_first", this.cuas_trim_first+""); // int
properties.setProperty(prefix+"cuas_early_en", this.cuas_early_en+""); // boolean
properties.setProperty(prefix+"cuas_early_mscore", this.cuas_early_mscore+""); // double
properties.setProperty(prefix+"cuas_early_vstr", this.cuas_early_vstr+""); // double
properties.setProperty(prefix+"cuas_early_score", this.cuas_early_score+""); // double
properties.setProperty(prefix+"cuas_early_amp", this.cuas_early_amp+""); // double
properties.setProperty(prefix+"cuas_recalc_mv_num", this.cuas_recalc_mv_num+""); // int properties.setProperty(prefix+"cuas_recalc_mv_num", this.cuas_recalc_mv_num+""); // int
properties.setProperty(prefix+"cuas_recalc_mv_boost", this.cuas_recalc_mv_boost+"");// double properties.setProperty(prefix+"cuas_recalc_mv_boost", this.cuas_recalc_mv_boost+"");// double
properties.setProperty(prefix+"cuas_recalc_mv_corr", this.cuas_recalc_mv_corr+""); // double properties.setProperty(prefix+"cuas_recalc_mv_corr", this.cuas_recalc_mv_corr+""); // double
...@@ -7034,6 +7065,12 @@ min_str_neib_fpn 0.35 ...@@ -7034,6 +7065,12 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_num_cycles")!=null) this.cuas_num_cycles=Integer.parseInt(properties.getProperty(prefix+"cuas_num_cycles")); if (properties.getProperty(prefix+"cuas_num_cycles")!=null) this.cuas_num_cycles=Integer.parseInt(properties.getProperty(prefix+"cuas_num_cycles"));
if (properties.getProperty(prefix+"cuas_trim_first")!=null) this.cuas_trim_first=Integer.parseInt(properties.getProperty(prefix+"cuas_trim_first")); if (properties.getProperty(prefix+"cuas_trim_first")!=null) this.cuas_trim_first=Integer.parseInt(properties.getProperty(prefix+"cuas_trim_first"));
if (properties.getProperty(prefix+"cuas_early_en")!=null) this.cuas_early_en=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_early_en"));
if (properties.getProperty(prefix+"cuas_early_mscore")!=null) this.cuas_early_mscore=Double.parseDouble(properties.getProperty(prefix+"cuas_early_mscore"));
if (properties.getProperty(prefix+"cuas_early_vstr")!=null) this.cuas_early_vstr=Double.parseDouble(properties.getProperty(prefix+"cuas_early_vstr"));
if (properties.getProperty(prefix+"cuas_early_score")!=null) this.cuas_early_score=Double.parseDouble(properties.getProperty(prefix+"cuas_early_score"));
if (properties.getProperty(prefix+"cuas_early_amp")!=null) this.cuas_early_amp=Double.parseDouble(properties.getProperty(prefix+"cuas_early_amp"));
if (properties.getProperty(prefix+"cuas_recalc_mv_num")!=null) this.cuas_recalc_mv_num=Integer.parseInt(properties.getProperty(prefix+"cuas_recalc_mv_num")); if (properties.getProperty(prefix+"cuas_recalc_mv_num")!=null) this.cuas_recalc_mv_num=Integer.parseInt(properties.getProperty(prefix+"cuas_recalc_mv_num"));
if (properties.getProperty(prefix+"cuas_recalc_mv_boost")!=null) this.cuas_recalc_mv_boost=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_boost")); if (properties.getProperty(prefix+"cuas_recalc_mv_boost")!=null) this.cuas_recalc_mv_boost=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_boost"));
if (properties.getProperty(prefix+"cuas_recalc_mv_corr")!=null) this.cuas_recalc_mv_corr=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_corr")); if (properties.getProperty(prefix+"cuas_recalc_mv_corr")!=null) this.cuas_recalc_mv_corr=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_corr"));
...@@ -8308,6 +8345,12 @@ min_str_neib_fpn 0.35 ...@@ -8308,6 +8345,12 @@ min_str_neib_fpn 0.35
imp.cuas_num_cycles = this.cuas_num_cycles; imp.cuas_num_cycles = this.cuas_num_cycles;
imp.cuas_trim_first = this.cuas_trim_first; imp.cuas_trim_first = this.cuas_trim_first;
imp.cuas_early_en = this.cuas_early_en;
imp.cuas_early_mscore = this.cuas_early_mscore;
imp.cuas_early_vstr = this.cuas_early_vstr;
imp.cuas_early_score = this.cuas_early_score;
imp.cuas_early_amp = this.cuas_early_amp;
imp.cuas_recalc_mv_num = this.cuas_recalc_mv_num; imp.cuas_recalc_mv_num = this.cuas_recalc_mv_num;
imp.cuas_recalc_mv_boost = this.cuas_recalc_mv_boost; imp.cuas_recalc_mv_boost = this.cuas_recalc_mv_boost;
imp.cuas_recalc_mv_corr = this.cuas_recalc_mv_corr; imp.cuas_recalc_mv_corr = this.cuas_recalc_mv_corr;
......
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