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

Working on orientation adjustment camera to IMS

parent b098f6c0
...@@ -7922,6 +7922,12 @@ public class Interscene { ...@@ -7922,6 +7922,12 @@ public class Interscene {
rms[3] = initial_rms[1]; rms[3] = initial_rms[1];
if (rms.length >= 5) { if (rms.length >= 5) {
rms[4] = lma_result; rms[4] = lma_result;
if ((rms.length >= 6) && (last_rms.length > 2)){
rms[5] = last_rms[2];
if ((rms.length >= 7) && (last_rms.length > 3)){
rms[6] = last_rms[3];
}
}
} }
} }
} }
...@@ -8212,6 +8218,12 @@ public class Interscene { ...@@ -8212,6 +8218,12 @@ public class Interscene {
rms[3] = initial_rms[1]; rms[3] = initial_rms[1];
if (rms.length >= 5) { if (rms.length >= 5) {
rms[4] = lma_result; rms[4] = lma_result;
if ((rms.length >= 6) && (last_rms.length > 2)){
rms[5] = last_rms[2];
if ((rms.length >= 7) && (last_rms.length > 3)){
rms[6] = last_rms[3];
}
}
} }
} }
} }
......
...@@ -1104,8 +1104,9 @@ min_str_neib_fpn 0.35 ...@@ -1104,8 +1104,9 @@ min_str_neib_fpn 0.35
public double wser_inf_thresh = 0.5; // Undefined yet parameter to select which segments to use in infinity disparity adjustment public double wser_inf_thresh = 0.5; // Undefined yet parameter to select which segments to use in infinity disparity adjustment
public boolean wser_orient_en = true; // per-series orientation dcamera-to-imu adjust enable public boolean wser_orient_en = true; // per-series orientation dcamera-to-imu adjust enable
public double wser_orient_transl = 0.5; // weight of translations for orientation. public double wser_orient_transl = 0.5; // weight of translations for orientation, AGL-corrected.
public boolean wser_orient_save = true; // Save per-series infinity adjustments data as CSV file public boolean wser_orient_save = true; // Save per-series infinity adjustments data as CSV file
public boolean wser_orient_series = true; // Save per-series orientations and summary
public boolean wser_orient_apply = false; // Apply per-series infinity correction public boolean wser_orient_apply = false; // Apply per-series infinity correction
public double wser_orient_thresh = 0.5; // Undefined yet parameter to select which segments to use in infinity disparity adjustment public double wser_orient_thresh = 0.5; // Undefined yet parameter to select which segments to use in infinity disparity adjustment
...@@ -1138,7 +1139,8 @@ min_str_neib_fpn 0.35 ...@@ -1138,7 +1139,8 @@ min_str_neib_fpn 0.35
public int quat_num_iter = 20; public int quat_num_iter = 20;
public double quat_reg_w = 0.25; public double quat_reg_w = 0.25;
public double quat_max_ratio = 5.0; // max derivatives difference public double quat_max_ratio = 3.0; // 5.0; // max derivatives ratio
public double quat_max_damping = 0.5; // maximal regularization weight
public double quat_max_change = 0.1; // radians public double quat_max_change = 0.1; // radians
public double quat_min_transl = 5.0; // meters to adjust by translation public double quat_min_transl = 5.0; // meters to adjust by translation
public double quat_min_rot = 0.1; // radians to adjust by rotation public double quat_min_rot = 0.1; // radians to adjust by rotation
...@@ -1881,7 +1883,7 @@ min_str_neib_fpn 0.35 ...@@ -1881,7 +1883,7 @@ min_str_neib_fpn 0.35
gd.addCheckbox ("Apply IMS orientation correction ", this.apply_quat_corr, gd.addCheckbox ("Apply IMS orientation correction ", this.apply_quat_corr,
"Apply camera orientation correction from predicted by IMS when generating output files - used only for ground planes."); "Apply camera orientation correction from predicted by IMS when generating output files - used only for ground planes.");
gd.addCheckbox ("Use IMS orientation correction internally", this.use_quat_corr, gd.addCheckbox ("Use IMS orientation correction internally", this.use_quat_corr,
"Depreceted? Use camera orientation correction from predicted by IMS internally from the previous calculations."); "Deprecated? Use camera orientation correction from predicted by IMS internally from the previous calculations.");
gd.addCheckbox ("Inertial only initial poses", this.inertial_only, gd.addCheckbox ("Inertial only initial poses", this.inertial_only,
"Use only IMU (DID_PIMU) data for initial egomotion, not the GNSS-aided IMS output."); "Use only IMU (DID_PIMU) data for initial egomotion, not the GNSS-aided IMS output.");
...@@ -3253,8 +3255,10 @@ min_str_neib_fpn 0.35 ...@@ -3253,8 +3255,10 @@ min_str_neib_fpn 0.35
"Per-series orientation dcamera-to-imu adjust enable."); "Per-series orientation dcamera-to-imu adjust enable.");
gd.addNumericField("Translations weight", this.wser_orient_transl, 5,7,"", gd.addNumericField("Translations weight", this.wser_orient_transl, 5,7,"",
"Weight of translations for orientation (remaining - orintation)."); "Weight of translations for orientation (remaining - orintation).");
gd.addCheckbox ("Save per-series orientation correction", this.wser_orient_save, gd.addCheckbox ("Save scene sequence orientation correction", this.wser_orient_save,
"Save per-series orintation adjustments data as CSV file."); "Save scene sequence orintation adjustments data as CSV file.");
gd.addCheckbox ("Save per-series orientation correction", this.wser_orient_series,
"Save per-series orintation adjustments data as CSV files and their summary table in index scene folder.");
gd.addCheckbox ("Apply per-series orientation correction", this.wser_orient_apply, gd.addCheckbox ("Apply per-series orientation correction", this.wser_orient_apply,
"Apply per-series orientation correction."); "Apply per-series orientation correction.");
gd.addNumericField("Orientation adjustment thershold", this.wser_orient_thresh, 5,7,"", gd.addNumericField("Orientation adjustment thershold", this.wser_orient_thresh, 5,7,"",
...@@ -3318,6 +3322,8 @@ min_str_neib_fpn 0.35 ...@@ -3318,6 +3322,8 @@ min_str_neib_fpn 0.35
gd.addNumericField("Maximal derivatives by axes ratio", this.quat_max_ratio, 3,5,"x", gd.addNumericField("Maximal derivatives by axes ratio", this.quat_max_ratio, 3,5,"x",
"If difference is larger, add regularization to reduce it."); "If difference is larger, add regularization to reduce it.");
gd.addNumericField("Maximal regularization fraction (<1)", this.quat_max_damping, 3,5,"x",
"If difference is larger, add regularization to reduce it.");
gd.addNumericField("Maximal correction angles change", this.quat_max_change, 3,5,"rad", gd.addNumericField("Maximal correction angles change", this.quat_max_change, 3,5,"rad",
"Do not update corrections if any angle is above this limit. "); "Do not update corrections if any angle is above this limit. ");
gd.addNumericField("Minimal translation for mount calibration", this.quat_min_transl, 3,5,"m", gd.addNumericField("Minimal translation for mount calibration", this.quat_min_transl, 3,5,"m",
...@@ -4611,6 +4617,7 @@ min_str_neib_fpn 0.35 ...@@ -4611,6 +4617,7 @@ min_str_neib_fpn 0.35
this.wser_orient_en = gd.getNextBoolean(); this.wser_orient_en = gd.getNextBoolean();
this.wser_orient_transl = gd.getNextNumber(); this.wser_orient_transl = gd.getNextNumber();
this.wser_orient_save = gd.getNextBoolean(); this.wser_orient_save = gd.getNextBoolean();
this.wser_orient_series = gd.getNextBoolean();
this.wser_orient_apply = gd.getNextBoolean(); this.wser_orient_apply = gd.getNextBoolean();
this.wser_orient_thresh = gd.getNextNumber(); this.wser_orient_thresh = gd.getNextNumber();
...@@ -4643,6 +4650,7 @@ min_str_neib_fpn 0.35 ...@@ -4643,6 +4650,7 @@ min_str_neib_fpn 0.35
this.quat_reg_w = gd.getNextNumber(); this.quat_reg_w = gd.getNextNumber();
this.quat_max_ratio = gd.getNextNumber(); this.quat_max_ratio = gd.getNextNumber();
this.quat_max_damping = gd.getNextNumber();
this.quat_max_change = gd.getNextNumber(); this.quat_max_change = gd.getNextNumber();
this.quat_min_transl = gd.getNextNumber(); this.quat_min_transl = gd.getNextNumber();
this.quat_min_rot = gd.getNextNumber(); this.quat_min_rot = gd.getNextNumber();
...@@ -5853,6 +5861,7 @@ min_str_neib_fpn 0.35 ...@@ -5853,6 +5861,7 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"wser_orient_en", this.wser_orient_en+""); // boolean properties.setProperty(prefix+"wser_orient_en", this.wser_orient_en+""); // boolean
properties.setProperty(prefix+"wser_orient_transl", this.wser_orient_transl+""); // double properties.setProperty(prefix+"wser_orient_transl", this.wser_orient_transl+""); // double
properties.setProperty(prefix+"wser_orient_save", this.wser_orient_save+""); // boolean properties.setProperty(prefix+"wser_orient_save", this.wser_orient_save+""); // boolean
properties.setProperty(prefix+"wser_orient_series", this.wser_orient_series+""); // boolean
properties.setProperty(prefix+"wser_orient_apply", this.wser_orient_apply+""); // boolean properties.setProperty(prefix+"wser_orient_apply", this.wser_orient_apply+""); // boolean
properties.setProperty(prefix+"wser_orient_thresh", this.wser_orient_thresh+""); // double properties.setProperty(prefix+"wser_orient_thresh", this.wser_orient_thresh+""); // double
...@@ -5884,6 +5893,7 @@ min_str_neib_fpn 0.35 ...@@ -5884,6 +5893,7 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"quat_reg_w", this.quat_reg_w+""); // double properties.setProperty(prefix+"quat_reg_w", this.quat_reg_w+""); // double
properties.setProperty(prefix+"quat_max_ratio", this.quat_max_ratio+""); // double properties.setProperty(prefix+"quat_max_ratio", this.quat_max_ratio+""); // double
properties.setProperty(prefix+"quat_max_damping", this.quat_max_damping+""); // double
properties.setProperty(prefix+"quat_max_change", this.quat_max_change+""); // double properties.setProperty(prefix+"quat_max_change", this.quat_max_change+""); // double
properties.setProperty(prefix+"quat_min_transl", this.quat_min_transl+""); // double properties.setProperty(prefix+"quat_min_transl", this.quat_min_transl+""); // double
properties.setProperty(prefix+"quat_min_rot", this.quat_min_rot+""); // double properties.setProperty(prefix+"quat_min_rot", this.quat_min_rot+""); // double
...@@ -7079,6 +7089,7 @@ min_str_neib_fpn 0.35 ...@@ -7079,6 +7089,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"wser_orient_en")!=null) this.wser_orient_en=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_en")); if (properties.getProperty(prefix+"wser_orient_en")!=null) this.wser_orient_en=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_en"));
if (properties.getProperty(prefix+"wser_orient_transl")!=null) this.wser_orient_transl=Double.parseDouble (properties.getProperty(prefix+"wser_orient_transl")); if (properties.getProperty(prefix+"wser_orient_transl")!=null) this.wser_orient_transl=Double.parseDouble (properties.getProperty(prefix+"wser_orient_transl"));
if (properties.getProperty(prefix+"wser_orient_save")!=null) this.wser_orient_save=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_save")); if (properties.getProperty(prefix+"wser_orient_save")!=null) this.wser_orient_save=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_save"));
if (properties.getProperty(prefix+"wser_orient_series")!=null) this.wser_orient_series=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_series"));
if (properties.getProperty(prefix+"wser_orient_apply")!=null) this.wser_orient_apply=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_apply")); if (properties.getProperty(prefix+"wser_orient_apply")!=null) this.wser_orient_apply=Boolean.parseBoolean(properties.getProperty(prefix+"wser_orient_apply"));
if (properties.getProperty(prefix+"wser_orient_thresh")!=null) this.wser_orient_thresh=Double.parseDouble (properties.getProperty(prefix+"wser_orient_thresh")); if (properties.getProperty(prefix+"wser_orient_thresh")!=null) this.wser_orient_thresh=Double.parseDouble (properties.getProperty(prefix+"wser_orient_thresh"));
...@@ -7110,6 +7121,7 @@ min_str_neib_fpn 0.35 ...@@ -7110,6 +7121,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"quat_reg_w")!=null) this.quat_reg_w=Double.parseDouble(properties.getProperty(prefix+"quat_reg_w")); if (properties.getProperty(prefix+"quat_reg_w")!=null) this.quat_reg_w=Double.parseDouble(properties.getProperty(prefix+"quat_reg_w"));
if (properties.getProperty(prefix+"quat_max_ratio")!=null) this.quat_max_ratio=Double.parseDouble(properties.getProperty(prefix+"quat_max_ratio")); if (properties.getProperty(prefix+"quat_max_ratio")!=null) this.quat_max_ratio=Double.parseDouble(properties.getProperty(prefix+"quat_max_ratio"));
if (properties.getProperty(prefix+"quat_max_damping")!=null) this.quat_max_damping=Double.parseDouble(properties.getProperty(prefix+"quat_max_damping"));
if (properties.getProperty(prefix+"quat_max_change")!=null) this.quat_max_change=Double.parseDouble(properties.getProperty(prefix+"quat_max_change")); if (properties.getProperty(prefix+"quat_max_change")!=null) this.quat_max_change=Double.parseDouble(properties.getProperty(prefix+"quat_max_change"));
if (properties.getProperty(prefix+"quat_min_transl")!=null) this.quat_min_transl=Double.parseDouble(properties.getProperty(prefix+"quat_min_transl")); if (properties.getProperty(prefix+"quat_min_transl")!=null) this.quat_min_transl=Double.parseDouble(properties.getProperty(prefix+"quat_min_transl"));
if (properties.getProperty(prefix+"quat_min_rot")!=null) this.quat_min_rot=Double.parseDouble(properties.getProperty(prefix+"quat_min_rot")); if (properties.getProperty(prefix+"quat_min_rot")!=null) this.quat_min_rot=Double.parseDouble(properties.getProperty(prefix+"quat_min_rot"));
...@@ -8284,6 +8296,7 @@ min_str_neib_fpn 0.35 ...@@ -8284,6 +8296,7 @@ min_str_neib_fpn 0.35
imp.wser_orient_en = this.wser_orient_en; imp.wser_orient_en = this.wser_orient_en;
imp.wser_orient_transl = this.wser_orient_transl; imp.wser_orient_transl = this.wser_orient_transl;
imp.wser_orient_save = this.wser_orient_save; imp.wser_orient_save = this.wser_orient_save;
imp.wser_orient_series = this.wser_orient_series;
imp.wser_orient_apply = this.wser_orient_apply; imp.wser_orient_apply = this.wser_orient_apply;
imp.wser_orient_thresh = this.wser_orient_thresh; imp.wser_orient_thresh = this.wser_orient_thresh;
...@@ -8316,6 +8329,7 @@ min_str_neib_fpn 0.35 ...@@ -8316,6 +8329,7 @@ min_str_neib_fpn 0.35
imp.quat_reg_w = this.quat_reg_w; imp.quat_reg_w = this.quat_reg_w;
imp.quat_max_ratio = this.quat_max_ratio; imp.quat_max_ratio = this.quat_max_ratio;
imp.quat_max_damping = this.quat_max_damping;
imp.quat_max_change = this.quat_max_change; imp.quat_max_change = this.quat_max_change;
imp.quat_min_transl = this.quat_min_transl; imp.quat_min_transl = this.quat_min_transl;
imp.quat_min_rot = this.quat_min_rot; imp.quat_min_rot = this.quat_min_rot;
......
...@@ -8673,6 +8673,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8673,6 +8673,7 @@ if (debugLevel > -100) return true; // temporarily !
boolean air_mode_en = clt_parameters.imp.air_mode_en; // fast airplane mode boolean air_mode_en = clt_parameters.imp.air_mode_en; // fast airplane mode
boolean save_series_infinity = clt_parameters.imp.wser_inf_save; // true; // Save per-series infinity adjustments data as CSV file boolean save_series_infinity = clt_parameters.imp.wser_inf_save; // true; // Save per-series infinity adjustments data as CSV file
boolean save_series_orient = clt_parameters.imp.wser_orient_save; boolean save_series_orient = clt_parameters.imp.wser_orient_save;
boolean process_segments = clt_parameters.imp.wser_orient_series;
if (run_pre_series) { if (run_pre_series) {
if (debugLevel > -4) { if (debugLevel > -4) {
System.out.println("===== Conditions met for all segment of the scene series, will run per-series calibrations ====="); System.out.println("===== Conditions met for all segment of the scene series, will run per-series calibrations =====");
...@@ -8697,13 +8698,14 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8697,13 +8698,14 @@ if (debugLevel > -100) return true; // temporarily !
// TODO: implement // TODO: implement
// for testing running adjustImuOrient for the last segment in this series // for testing running adjustImuOrient for the last segment in this series
double [][] orient_rslt = save_series_orient ? (new double [ref_scenes.length][]) : null; double [][] orient_rslt = save_series_orient ? (new double [ref_scenes.length][]) : null;
double [] infinity_multi = SeriesInfinityCorrection.adjustImuOrientMulti( double [] quatcorr_multi = SeriesInfinityCorrection.adjustImuOrientMulti(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
ref_scenes, // QuadCLT [] quadCLTs, ref_scenes, // QuadCLT [] quadCLTs,
index_scenes[0], // QuadCLT index_CLT, // normally - just the last in quadCLTs index_scenes[0], // QuadCLT index_CLT, // normally - just the last in quadCLTs
save_series_orient, // boolean save_series_orient, save_series_orient, // boolean save_sequence_orient,
process_segments, // boolean process_segments,
orient_rslt, // double [][] orient_rslt, orient_rslt, // double [][] orient_rslt,
debugLevel); // int debugLevel) debugLevel+1); // int debugLevel)
if (orient_rslt != null) { if (orient_rslt != null) {
} }
} }
......
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