Commit dd7e6ced authored by Andrey Filippov's avatar Andrey Filippov

Implemented multiple-reference (center and 1/4 and 3/4) global LMA pose

refining.
parent 6da5747a
......@@ -26,6 +26,8 @@ public class IntersceneGlobalLmaParameters {
public boolean glob_en;
public boolean glob_exit_after_test; // exit OpticalFlow.buildSeries() immediately after running, do not increment num_orient
public boolean glob_recalculate_quarter_refs; // force regeneration of quarter-reference DSI/INTER-INTRA-LMA files
public boolean glob_quarter_refs_sfm_only; // generate quarter-reference INTER-INTRA-LMA using SfM-only (no pose LMA updates)
public int glob_solver_mode; // 0 - current sparse global refine, 1 - classic LMA-structure implementation
public boolean [] param_sel;
public double [] param_regweights;
......@@ -53,9 +55,11 @@ public class IntersceneGlobalLmaParameters {
public int glob_center_pair_weight_mode;
public IntersceneGlobalLmaParameters() {
glob_en = true;
glob_exit_after_test = true; // TODO: change default to false when debugging is over
glob_solver_mode = GLOB_SOLVER_SPARSE_BANDED;
glob_en = true;
glob_exit_after_test = true; // TODO: change default to false when debugging is over
glob_recalculate_quarter_refs = false;
glob_quarter_refs_sfm_only = true;
glob_solver_mode = GLOB_SOLVER_SPARSE_BANDED;
param_sel = new boolean [ErsCorrection.DP_XYZATR.length];
param_regweights = new double [ErsCorrection.DP_XYZATR.length];
param_lpf = new double [ErsCorrection.DP_XYZATR.length];
......@@ -93,6 +97,10 @@ public class IntersceneGlobalLmaParameters {
"Use global LMA for adjusting scenes poses." );
gd.addCheckbox("Exit after Global LMA (debug mode)", this.glob_exit_after_test,
"exit OpticalFlow.buildSeries() immediately after running, do not increment num_orient enabling re-running next time");
gd.addCheckbox("Recalculate quarter refs each run (debug)", this.glob_recalculate_quarter_refs,
"Force regeneration of quarter-reference -DSI_MAIN and -INTER-INTRA-LMA before Global LMA.");
gd.addCheckbox("Quarter refs use SfM-only generation", this.glob_quarter_refs_sfm_only,
"For quarter references, run scanSfmIMS disparity refinement without per-scene pose LMA adjustment.");
gd.addNumericField("Global LMA solver mode (0/1)", this.glob_solver_mode, 0,3,"",
"0: current sparse/banded global solver, 1: classic LMA-structure global solver.");
gd.addStringField ("Select XYZATR parameters to fit", IntersceneMatchParameters.booleansToString(this.param_sel,2), 40,
......@@ -142,13 +150,15 @@ public class IntersceneGlobalLmaParameters {
"Display debug hyperstack in ImageJ UI.");
gd.addCheckbox("Save only initial+final CSV", this.glob_save_initial_final_only,
"Do not save intermediate outer-loop TIFF/CSV, save only combined initial+final CSV.");
gd.addNumericField("Center pair weight mode (0/1/2)", this.glob_center_pair_weight_mode, 0,3,"",
"0: all pairs enabled, 1: disable center +/-1 pairs, 2: disable center +/-1,+/-2 pairs.");
gd.addNumericField("Center pair weight mode (>=0)", this.glob_center_pair_weight_mode, 0,3,"",
"0: all pairs enabled, N>0: disable center-reference pairs with |scene-center| <= N.");
}
public void dialogAnswers(GenericJTabbedDialog gd) {
this.glob_en = gd.getNextBoolean();
this.glob_exit_after_test = gd.getNextBoolean();
this.glob_solver_mode = clampSolverMode((int) gd.getNextNumber());
this.glob_en = gd.getNextBoolean();
this.glob_exit_after_test = gd.getNextBoolean();
this.glob_recalculate_quarter_refs = gd.getNextBoolean();
this.glob_quarter_refs_sfm_only = gd.getNextBoolean();
this.glob_solver_mode = clampSolverMode((int) gd.getNextNumber());
this.param_sel = IntersceneMatchParameters.StringToBooleans(gd.getNextString(), this.param_sel);
this.param_regweights = IntersceneMatchParameters.StringToDoubles(gd.getNextString(), this.param_regweights);
this.param_lpf = IntersceneMatchParameters.StringToDoubles(gd.getNextString(), this.param_lpf);
......@@ -179,14 +189,13 @@ public class IntersceneGlobalLmaParameters {
if (this.glob_center_pair_weight_mode < 0) {
this.glob_center_pair_weight_mode = 0;
}
if (this.glob_center_pair_weight_mode > 2) {
this.glob_center_pair_weight_mode = 2;
}
}
public void setProperties(String prefix,Properties properties){
properties.setProperty(prefix+"glob_en", this.glob_en+"");
properties.setProperty(prefix+"glob_exit_after_test", this.glob_exit_after_test+"");
properties.setProperty(prefix+"glob_recalculate_quarter_refs", this.glob_recalculate_quarter_refs+"");
properties.setProperty(prefix+"glob_quarter_refs_sfm_only", this.glob_quarter_refs_sfm_only+"");
properties.setProperty(prefix+"glob_solver_mode", this.glob_solver_mode+"");
properties.setProperty(prefix+"param_sel", IntersceneMatchParameters.booleansToString(this.param_sel,2));
properties.setProperty(prefix+"param_regweights",IntersceneMatchParameters.doublesToString(this.param_regweights));
......@@ -218,6 +227,8 @@ public class IntersceneGlobalLmaParameters {
public void getProperties(String prefix,Properties properties){
if (properties.getProperty(prefix+"glob_en")!=null) this.glob_en=Boolean.parseBoolean(properties.getProperty(prefix+"glob_en"));
if (properties.getProperty(prefix+"glob_exit_after_test")!=null) this.glob_exit_after_test=Boolean.parseBoolean(properties.getProperty(prefix+"glob_exit_after_test"));
if (properties.getProperty(prefix+"glob_recalculate_quarter_refs")!=null) this.glob_recalculate_quarter_refs=Boolean.parseBoolean(properties.getProperty(prefix+"glob_recalculate_quarter_refs"));
if (properties.getProperty(prefix+"glob_quarter_refs_sfm_only")!=null) this.glob_quarter_refs_sfm_only=Boolean.parseBoolean(properties.getProperty(prefix+"glob_quarter_refs_sfm_only"));
if (properties.getProperty(prefix+"glob_solver_mode")!=null) this.glob_solver_mode=Integer.parseInt(properties.getProperty(prefix+"glob_solver_mode"));
this.glob_solver_mode = clampSolverMode(this.glob_solver_mode);
if (properties.getProperty(prefix+"param_sel")!=null) this.param_sel= IntersceneMatchParameters.StringToBooleans(properties.getProperty(prefix+"param_sel"),this.param_sel);
......@@ -246,7 +257,6 @@ public class IntersceneGlobalLmaParameters {
if (properties.getProperty(prefix+"glob_save_initial_final_only")!=null) this.glob_save_initial_final_only=Boolean.parseBoolean(properties.getProperty(prefix+"glob_save_initial_final_only"));
if (properties.getProperty(prefix+"glob_center_pair_weight_mode")!=null) this.glob_center_pair_weight_mode=Integer.parseInt(properties.getProperty(prefix+"glob_center_pair_weight_mode"));
if (this.glob_center_pair_weight_mode < 0) this.glob_center_pair_weight_mode = 0;
if (this.glob_center_pair_weight_mode > 2) this.glob_center_pair_weight_mode = 2;
}
@Override
......@@ -254,6 +264,8 @@ public class IntersceneGlobalLmaParameters {
IntersceneGlobalLmaParameters iglp = new IntersceneGlobalLmaParameters();
iglp.glob_en = this.glob_en;
iglp.glob_exit_after_test = this.glob_exit_after_test;
iglp.glob_recalculate_quarter_refs = this.glob_recalculate_quarter_refs;
iglp.glob_quarter_refs_sfm_only = this.glob_quarter_refs_sfm_only;
iglp.glob_solver_mode = this.glob_solver_mode;
iglp.param_sel = this.param_sel.clone();
iglp.param_regweights = this.param_regweights.clone();
......
......@@ -246,6 +246,8 @@ public class QuadCLTCPU {
// only reference scene has a pair of first/last scene in a sequence
public String timestamp_first = null;
public String timestamp_last = null;
public String timestamp_quarter1 = null;
public String timestamp_quarter3 = null;
public String timestamp_index = null; // timestamp of the scene with index of all reference scenes in this sequence
public HashSet<String> ref_scenes = null; // Set of timestamps of the reference scenes in this sequence
// combined clt for center view, only used in cuas mode
......@@ -7755,12 +7757,18 @@ LogTee.clearSceneLog(); // stop per‑scene logging
if (this.timestamp_first != null) {
properties.setProperty(prefix+"timestamp_first", this.timestamp_first);
}
if (this.timestamp_quarter1 != null) {
properties.setProperty(prefix+"timestamp_quarter1", this.timestamp_quarter1);
}
if (this.timestamp_index != null) {
properties.setProperty(prefix+"timestamp_index", this.timestamp_index);
}
if (this.timestamp_last != null) {
properties.setProperty(prefix+"timestamp_last", this.timestamp_last);
}
if (this.timestamp_quarter3 != null) {
properties.setProperty(prefix+"timestamp_quarter3", this.timestamp_quarter3);
}
if (this.quat_corr != null) {
properties.setProperty(prefix+"quat_corr", IntersceneMatchParameters.doublesToString(this.quat_corr));
......@@ -7972,9 +7980,15 @@ LogTee.clearSceneLog(); // stop per‑scene logging
if (properties.getProperty(prefix+"timestamp_first")!=null) {
this.timestamp_first= (String) properties.getProperty(prefix+"timestamp_first");
}
if (properties.getProperty(prefix+"timestamp_quarter1")!=null) {
this.timestamp_quarter1= (String) properties.getProperty(prefix+"timestamp_quarter1");
}
if (properties.getProperty(prefix+"timestamp_last")!=null) {
this.timestamp_last= (String) properties.getProperty(prefix+"timestamp_last");
}
if (properties.getProperty(prefix+"timestamp_quarter3")!=null) {
this.timestamp_quarter3= (String) properties.getProperty(prefix+"timestamp_quarter3");
}
if (properties.getProperty(prefix+"timestamp_index")!=null) {
this.timestamp_index= (String) properties.getProperty(prefix+"timestamp_index");
}
......
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