Commit e686150e authored by Andrey Filippov's avatar Andrey Filippov

debugging

parent 1b90adae
...@@ -66,20 +66,24 @@ public class CuasMotionLMA { ...@@ -66,20 +66,24 @@ public class CuasMotionLMA {
public static final int RSLT_MISMATCH_BEFORE = 24; public static final int RSLT_MISMATCH_BEFORE = 24;
public static final int RSLT_MISMATCH_AFTER = 25; // RSLT_MISMATCH_BEFORE+1; public static final int RSLT_MISMATCH_AFTER = 25; // RSLT_MISMATCH_BEFORE+1;
public static final int RSLT_MISMATCH_DIRS= 26; public static final int RSLT_MISMATCH_DIRS= 26;
public static final int RSLT_MATCH_LENGTH= 27; // [RSLT_MATCH_LENGTH] is one less than the total length (0 - isolated) public static final int RSLT_MATCH_LENGTH= 27;
public static final int RSLT_MSCORE = 28; public static final int RSLT_BEFORE_LENGTH= 28; // just for debug
public static final int RSLT_AFTER_LENGTH= 29; // just for debug
// [RSLT_MATCH_LENGTH] is one less than the total length (0 - isolated)
public static final int RSLT_MSCORE = 30;
public static final int RSLT_QA = 29; public static final int RSLT_QA = 31;
public static final int RSLT_QRMS = 30; public static final int RSLT_QRMS = 32;
public static final int RSLT_QRMS_A = 31; public static final int RSLT_QRMS_A = 33;
public static final int RSLT_QCENTER = 32; public static final int RSLT_QCENTER = 34;
public static final int RSLT_QMATCH = 33; public static final int RSLT_QMATCH = 35;
public static final int RSLT_QMATCH_LEN=34; public static final int RSLT_QMATCH_LEN=36;
public static final int RSLT_QSCORE = 35; public static final int RSLT_QSCORE = 37;
public static final int RSLT_STRONGER =36; // index of stronger neighbor (may be more) public static final int RSLT_STRONGER =38; // index of stronger neighbor (may be more)
public static final int RSLT_SLOW = 37; // 1 - slow, 0 - fast public static final int RSLT_SLOW = 39; // 1 - slow, 0 - fast
public static final int RSLT_WHEN = 38; public static final int RSLT_WHEN = 40;
public static final int RSLT_FAIL = 39; public static final int RSLT_FAIL = 41;
public static final int RSLT_LEN = RSLT_FAIL+1; public static final int RSLT_LEN = RSLT_FAIL+1;
...@@ -89,10 +93,12 @@ public class CuasMotionLMA { ...@@ -89,10 +93,12 @@ public class CuasMotionLMA {
"Centr-X","Centr-Y","Centr-max","Centr-frac", "Centr-X","Centr-Y","Centr-max","Centr-frac",
"Vx", "Vy", "V-conf","V-frac", // from motion vectors "Vx", "Vy", "V-conf","V-frac", // from motion vectors
"X-before", "Y-before","X-after","Y-after", // from getHalfBeforeAfterPixXY() "X-before", "Y-before","X-after","Y-after", // from getHalfBeforeAfterPixXY()
"ERR-BEFORE", "ERR-AFTER", "BA-DIRS", "Match-length", // before dir + 16*after dir "ERR-BEFORE", "ERR-AFTER", "BA-DIRS", // before dir + 16*after dir
"Match-length",
"Length-before","Length-after", // just for debug, may be removed later
"*MOTION-SCORE", "*MOTION-SCORE",
"*Q-AMPL","*Q-RMSE","*Q-RMSE/A","*Q-CENTER","*Q-MATCH","*Q-LENGTH","*Q-SCORE", "*Q-AMPL","*Q-RMSE","*Q-RMSE/A","*Q-CENTER","*Q-MATCH","*Q-LENGTH","*Q-SCORE",
"Stronger", "Stronger","Slow",
"WHEN", "FAILURE"}; "WHEN", "FAILURE"};
public static final int FAIL_NONE = 0; public static final int FAIL_NONE = 0;
......
...@@ -840,6 +840,7 @@ min_str_neib_fpn 0.35 ...@@ -840,6 +840,7 @@ min_str_neib_fpn 0.35
public boolean cuas_annotate = true; // save color rendered images (same as videos) public boolean cuas_annotate = true; // save color rendered images (same as videos)
public boolean cuas_annotate_uas = true; // indicate uas from log if available public boolean cuas_annotate_uas = true; // indicate uas from log if available
public Color cuas_text_color = new Color (0, 255, 255);// 220); public Color cuas_text_color = new Color (0, 255, 255);// 220);
public Color cuas_selected_color = new Color (127, 0, 255);// 220);
public String cuas_font_name = "Monospaced"; public String cuas_font_name = "Monospaced";
public int cuas_font_size = 7; // before scaling public int cuas_font_size = 7; // before scaling
public int cuas_font_type = 1; // 0 - PLAIN, 1 - BOLD, 2 - ITALIC public int cuas_font_type = 1; // 0 - PLAIN, 1 - BOLD, 2 - ITALIC
...@@ -855,6 +856,9 @@ min_str_neib_fpn 0.35 ...@@ -855,6 +856,9 @@ min_str_neib_fpn 0.35
public boolean cuas_step_debug = true; // save debug images during per-step cuas recalculation (and show them if not in batch mode) public boolean cuas_step_debug = true; // save debug images during per-step cuas recalculation (and show them if not in batch mode)
public boolean cuas_save_stats = true; // Save target statistics data to find out which test failed and when (or when tile was found good) public boolean cuas_save_stats = true; // Save target statistics data to find out which test failed and when (or when tile was found good)
public boolean cuas_target_debug = false; // save debug images during per-step cuas recalculation (and show them if not in batch mode) public boolean cuas_target_debug = false; // save debug images during per-step cuas recalculation (and show them if not in batch mode)
public boolean cuas_target_score = true ; // show target score and sequence length ijn the final video
public boolean cuas_target_color = true ; // annotate known target with different color
public boolean cuas_overwrite = false; // overwrite num_orient and num_accum public boolean cuas_overwrite = false; // overwrite num_orient and num_accum
public int cuas_num_orient = 2; // initial value for num_orient public int cuas_num_orient = 2; // initial value for num_orient
public int cuas_num_accum = 1; // initial value for num_accum public int cuas_num_accum = 1; // initial value for num_accum
...@@ -2512,7 +2516,11 @@ min_str_neib_fpn 0.35 ...@@ -2512,7 +2516,11 @@ min_str_neib_fpn 0.35
"Indicate UAS position from the UAS flight log, if available."); "Indicate UAS position from the UAS flight log, if available.");
{ {
String scolor = String.format("%08x", getLongColor(this.cuas_text_color)); String scolor = String.format("%08x", getLongColor(this.cuas_text_color));
gd.addStringField ("Tast color",scolor, 8, "Any invalid hex number disables annotation"); gd.addStringField ("Target annotations color",scolor, 8, "Any invalid hex number disables annotation");
}
{
String scolor = String.format("%08x", getLongColor(this.cuas_selected_color));
gd.addStringField ("Selected target annotations color",scolor, 8, "Any invalid hex number disables annotation");
} }
gd.addStringField ("Font name", this.cuas_font_name, 20, gd.addStringField ("Font name", this.cuas_font_name, 20,
"Font name, currently \"Monospaced\"."); "Font name, currently \"Monospaced\".");
...@@ -2542,6 +2550,10 @@ min_str_neib_fpn 0.35 ...@@ -2542,6 +2550,10 @@ min_str_neib_fpn 0.35
" Save target statistics data to find out which test failed and when (or when tile was found good)."); " Save target statistics data to find out which test failed and when (or when tile was found good).");
gd.addCheckbox ("Add debug to the target text", this.cuas_target_debug, gd.addCheckbox ("Add debug to the target text", this.cuas_target_debug,
"Add additional debug text to the ."); "Add additional debug text to the .");
gd.addCheckbox ("Show target score", this.cuas_target_score,
"Show target score and sequence length in the final video.");
gd.addCheckbox ("Use known target color", this.cuas_target_color,
"Annotate known target with different color.");
gd.addCheckbox ("Overwrite number of performed adjustments", this.cuas_overwrite, gd.addCheckbox ("Overwrite number of performed adjustments", this.cuas_overwrite,
"Debug feature: overwrite actual number of performed orientation and disparity refinements to re-run them."); "Debug feature: overwrite actual number of performed orientation and disparity refinements to re-run them.");
...@@ -3625,6 +3637,16 @@ min_str_neib_fpn 0.35 ...@@ -3625,6 +3637,16 @@ min_str_neib_fpn 0.35
this.cuas_text_color = setLongColor(0xCCFF00); this.cuas_text_color = setLongColor(0xCCFF00);
} }
} }
{
String scolor = gd.getNextString();
long lcolor = -1;
try {
lcolor = Long.parseLong(scolor,16);
this.cuas_selected_color = setLongColor(lcolor);
} catch(NumberFormatException e){
this.cuas_selected_color = setLongColor(0xFF0088);
}
}
this.cuas_font_name = gd.getNextString(); this.cuas_font_name = gd.getNextString();
this.cuas_font_size = (int) gd.getNextNumber(); this.cuas_font_size = (int) gd.getNextNumber();
this.cuas_font_type = (int) gd.getNextNumber(); this.cuas_font_type = (int) gd.getNextNumber();
...@@ -3639,6 +3661,8 @@ min_str_neib_fpn 0.35 ...@@ -3639,6 +3661,8 @@ min_str_neib_fpn 0.35
this.cuas_step_debug = gd.getNextBoolean(); this.cuas_step_debug = gd.getNextBoolean();
this.cuas_save_stats = gd.getNextBoolean(); this.cuas_save_stats = gd.getNextBoolean();
this.cuas_target_debug = gd.getNextBoolean(); this.cuas_target_debug = gd.getNextBoolean();
this.cuas_target_score = gd.getNextBoolean();
this.cuas_target_color = gd.getNextBoolean();
this.cuas_overwrite = gd.getNextBoolean(); this.cuas_overwrite = gd.getNextBoolean();
this.cuas_num_orient = (int) gd.getNextNumber(); this.cuas_num_orient = (int) gd.getNextNumber();
...@@ -4641,6 +4665,10 @@ min_str_neib_fpn 0.35 ...@@ -4641,6 +4665,10 @@ min_str_neib_fpn 0.35
long lcolor_annotate = (cuas_text_color == null) ? 0xCCFF00 : getLongColor(this.cuas_text_color); long lcolor_annotate = (cuas_text_color == null) ? 0xCCFF00 : getLongColor(this.cuas_text_color);
properties.setProperty(prefix+"cuas_text_color", lcolor_annotate+""); properties.setProperty(prefix+"cuas_text_color", lcolor_annotate+"");
} }
{
long lcolor_annotate = (cuas_selected_color == null) ? 0xFF0088 : getLongColor(this.cuas_selected_color);
properties.setProperty(prefix+"cuas_selected_color", lcolor_annotate+"");
}
properties.setProperty(prefix+"cuas_font_name", this.cuas_font_name+""); // String properties.setProperty(prefix+"cuas_font_name", this.cuas_font_name+""); // String
properties.setProperty(prefix+"cuas_font_size", this.cuas_font_size+""); // int properties.setProperty(prefix+"cuas_font_size", this.cuas_font_size+""); // int
properties.setProperty(prefix+"cuas_font_type", this.cuas_font_type+""); // int properties.setProperty(prefix+"cuas_font_type", this.cuas_font_type+""); // int
...@@ -4655,6 +4683,8 @@ min_str_neib_fpn 0.35 ...@@ -4655,6 +4683,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_step_debug", this.cuas_step_debug+""); // boolean properties.setProperty(prefix+"cuas_step_debug", this.cuas_step_debug+""); // boolean
properties.setProperty(prefix+"cuas_save_stats", this.cuas_save_stats+""); // boolean properties.setProperty(prefix+"cuas_save_stats", this.cuas_save_stats+""); // boolean
properties.setProperty(prefix+"cuas_target_debug", this.cuas_target_debug+""); // boolean properties.setProperty(prefix+"cuas_target_debug", this.cuas_target_debug+""); // boolean
properties.setProperty(prefix+"cuas_target_score", this.cuas_target_score+""); // boolean
properties.setProperty(prefix+"cuas_target_color", this.cuas_target_color+""); // boolean
properties.setProperty(prefix+"cuas_overwrite", this.cuas_overwrite+""); // boolean properties.setProperty(prefix+"cuas_overwrite", this.cuas_overwrite+""); // boolean
properties.setProperty(prefix+"cuas_num_orient", this.cuas_num_orient+""); // int properties.setProperty(prefix+"cuas_num_orient", this.cuas_num_orient+""); // int
...@@ -5631,6 +5661,11 @@ min_str_neib_fpn 0.35 ...@@ -5631,6 +5661,11 @@ min_str_neib_fpn 0.35
if (lcolor_annotate < 0) this.cuas_text_color = setLongColor(0xCCFF00); if (lcolor_annotate < 0) this.cuas_text_color = setLongColor(0xCCFF00);
else this.cuas_text_color = setLongColor(lcolor_annotate); else this.cuas_text_color = setLongColor(lcolor_annotate);
} }
if (properties.getProperty(prefix+"cuas_selected_color")!=null) {
long lcolor_annotate = Long.parseLong(properties.getProperty(prefix+"cuas_selected_color"));
if (lcolor_annotate < 0) this.cuas_selected_color = setLongColor(0xFF0088);
else this.cuas_selected_color = setLongColor(lcolor_annotate);
}
if (properties.getProperty(prefix+"cuas_font_name")!= null) cuas_font_name=(String) properties.getProperty(prefix+"cuas_font_name"); if (properties.getProperty(prefix+"cuas_font_name")!= null) cuas_font_name=(String) properties.getProperty(prefix+"cuas_font_name");
if (properties.getProperty(prefix+"cuas_font_size")!=null) this.cuas_font_size=Integer.parseInt(properties.getProperty(prefix+"cuas_font_size")); if (properties.getProperty(prefix+"cuas_font_size")!=null) this.cuas_font_size=Integer.parseInt(properties.getProperty(prefix+"cuas_font_size"));
if (properties.getProperty(prefix+"cuas_font_type")!=null) this.cuas_font_type=Integer.parseInt(properties.getProperty(prefix+"cuas_font_type")); if (properties.getProperty(prefix+"cuas_font_type")!=null) this.cuas_font_type=Integer.parseInt(properties.getProperty(prefix+"cuas_font_type"));
...@@ -5645,6 +5680,8 @@ min_str_neib_fpn 0.35 ...@@ -5645,6 +5680,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_step_debug")!=null) this.cuas_step_debug=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_step_debug")); if (properties.getProperty(prefix+"cuas_step_debug")!=null) this.cuas_step_debug=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_step_debug"));
if (properties.getProperty(prefix+"cuas_save_stats")!=null) this.cuas_save_stats=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_save_stats")); if (properties.getProperty(prefix+"cuas_save_stats")!=null) this.cuas_save_stats=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_save_stats"));
if (properties.getProperty(prefix+"cuas_target_debug")!=null) this.cuas_target_debug=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_target_debug")); if (properties.getProperty(prefix+"cuas_target_debug")!=null) this.cuas_target_debug=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_target_debug"));
if (properties.getProperty(prefix+"cuas_target_score")!=null) this.cuas_target_score=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_target_score"));
if (properties.getProperty(prefix+"cuas_target_color")!=null) this.cuas_target_color=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_target_color"));
if (properties.getProperty(prefix+"cuas_overwrite")!=null) this.cuas_overwrite=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_overwrite")); if (properties.getProperty(prefix+"cuas_overwrite")!=null) this.cuas_overwrite=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_overwrite"));
if (properties.getProperty(prefix+"cuas_num_orient")!=null) this.cuas_num_orient=Integer.parseInt(properties.getProperty(prefix+"cuas_num_orient")); if (properties.getProperty(prefix+"cuas_num_orient")!=null) this.cuas_num_orient=Integer.parseInt(properties.getProperty(prefix+"cuas_num_orient"));
...@@ -6617,6 +6654,7 @@ min_str_neib_fpn 0.35 ...@@ -6617,6 +6654,7 @@ min_str_neib_fpn 0.35
imp.cuas_annotate = this.cuas_annotate; imp.cuas_annotate = this.cuas_annotate;
imp.cuas_annotate_uas = this.cuas_annotate_uas; imp.cuas_annotate_uas = this.cuas_annotate_uas;
imp.cuas_text_color= this.cuas_text_color; imp.cuas_text_color= this.cuas_text_color;
imp.cuas_selected_color= this.cuas_selected_color;
imp.cuas_font_name = this.cuas_font_name; imp.cuas_font_name = this.cuas_font_name;
imp.cuas_font_size = this.cuas_font_size; imp.cuas_font_size = this.cuas_font_size;
...@@ -6632,6 +6670,8 @@ min_str_neib_fpn 0.35 ...@@ -6632,6 +6670,8 @@ min_str_neib_fpn 0.35
imp.cuas_step_debug = this.cuas_step_debug; imp.cuas_step_debug = this.cuas_step_debug;
imp.cuas_save_stats = this.cuas_save_stats; imp.cuas_save_stats = this.cuas_save_stats;
imp.cuas_target_debug = this.cuas_target_debug; imp.cuas_target_debug = this.cuas_target_debug;
imp.cuas_target_score = this.cuas_target_score;
imp.cuas_target_color = this.cuas_target_color;
imp.cuas_overwrite = this.cuas_overwrite; imp.cuas_overwrite = this.cuas_overwrite;
imp.cuas_num_orient = this.cuas_num_orient; imp.cuas_num_orient = this.cuas_num_orient;
......
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