Commit 71aa98de authored by Andrey Filippov's avatar Andrey Filippov

correction scale

parent 6bc620fb
...@@ -1876,7 +1876,10 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -1876,7 +1876,10 @@ B = |+dy0 -dy1 -2*dy3 |
} }
// create list for infinity data // create list for infinity data
ArrayList<Sample> inf_samples_list = selectInfinityTiles( // /clt_parameters.ly_inf_en,
ArrayList<Sample> inf_samples_list;
if (clt_parameters.ly_inf_en) {
inf_samples_list = selectInfinityTiles(
clt_parameters.fcorr_radius, // final double fcorr_radius, clt_parameters.fcorr_radius, // final double fcorr_radius,
clt_parameters.fcorr_inf_vert,// final boolean use_vertical, clt_parameters.fcorr_inf_vert,// final boolean use_vertical,
0.0, // any > 0.0 0.0, // any > 0.0
...@@ -1922,6 +1925,11 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -1922,6 +1925,11 @@ B = |+dy0 -dy1 -2*dy3 |
for (Sample s: inf_samples_list) { for (Sample s: inf_samples_list) {
s.weight *= weights[0]; s.weight *= weights[0];
} }
} else {
inf_samples_list = new ArrayList<Sample>(); // do not use infinity at all
}
///-----
// Supplement list with the lazy eye scans data - use all tiles // Supplement list with the lazy eye scans data - use all tiles
for (int nTile = 0; nTile < num_tiles; nTile++) if (center_mask[nTile]) { for (int nTile = 0; nTile < num_tiles; nTile++) if (center_mask[nTile]) {
...@@ -1995,7 +2003,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -1995,7 +2003,7 @@ B = |+dy0 -dy1 -2*dy3 |
System.out.println(corr_vector.toString()); System.out.println(corr_vector.toString());
} }
if (apply_extrinsic){ if (apply_extrinsic){
qc.geometryCorrection.getCorrVector().incrementVector(corr_vector); qc.geometryCorrection.getCorrVector().incrementVector(corr_vector, clt_parameters.ly_corr_scale);
if (debugLevel > -1){ if (debugLevel > -1){
System.out.println("New extrinsic corrections:"); System.out.println("New extrinsic corrections:");
System.out.println(qc.geometryCorrection.getCorrVector().toString()); System.out.println(qc.geometryCorrection.getCorrVector().toString());
......
...@@ -2050,7 +2050,7 @@ public class EyesisCorrectionParameters { ...@@ -2050,7 +2050,7 @@ public class EyesisCorrectionParameters {
public double ly_disp_var = 0.5; // 2; // Maximal full disparity difference to 8 neighbors public double ly_disp_var = 0.5; // 2; // Maximal full disparity difference to 8 neighbors
public double ly_inf_frac = 0.5; // Relative weight of infinity calibration data public double ly_inf_frac = 0.5; // Relative weight of infinity calibration data
public boolean ly_on_scan = true; // Calculate and apply lazy eye correction after disparity scan (poly or extrinsic) public boolean ly_on_scan = true; // Calculate and apply lazy eye correction after disparity scan (poly or extrinsic)
public boolean ly_inf_en = true; // Simultaneously correct disparity at infinity (both poly and extrinsic) public boolean ly_inf_en = false; // true; // Simultaneously correct disparity at infinity (both poly and extrinsic)
public boolean ly_inf_force= false; // Force convergence correction during extrinsic, even with no infinity data public boolean ly_inf_force= false; // Force convergence correction during extrinsic, even with no infinity data
public boolean ly_poly = false; // Use polynomial correction, false - correct tilt/azimuth/roll of each sensor public boolean ly_poly = false; // Use polynomial correction, false - correct tilt/azimuth/roll of each sensor
...@@ -2060,6 +2060,7 @@ public class EyesisCorrectionParameters { ...@@ -2060,6 +2060,7 @@ public class EyesisCorrectionParameters {
public double lyf_frac_keep = 0.5; // Keep best fit samples, discard worst public double lyf_frac_keep = 0.5; // Keep best fit samples, discard worst
public int lyf_min_samples = 5; // Minimal number of tiles remaining in the sample public int lyf_min_samples = 5; // Minimal number of tiles remaining in the sample
public boolean lyf_norm_center = true; // Replace samples with a single average with equal weight public boolean lyf_norm_center = true; // Replace samples with a single average with equal weight
public double ly_corr_scale = 1.0; // Scale calculated correction vector
// old fcorr parameters, reuse? // old fcorr parameters, reuse?
// public int fcorr_sample_size = 32; // Use square this size side to detect outliers // public int fcorr_sample_size = 32; // Use square this size side to detect outliers
...@@ -2695,6 +2696,7 @@ public class EyesisCorrectionParameters { ...@@ -2695,6 +2696,7 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"lyf_frac_keep", this.lyf_frac_keep +""); properties.setProperty(prefix+"lyf_frac_keep", this.lyf_frac_keep +"");
properties.setProperty(prefix+"lyf_min_samples", this.lyf_min_samples+""); properties.setProperty(prefix+"lyf_min_samples", this.lyf_min_samples+"");
properties.setProperty(prefix+"lyf_norm_center", this.lyf_norm_center+""); properties.setProperty(prefix+"lyf_norm_center", this.lyf_norm_center+"");
properties.setProperty(prefix+"ly_corr_scale", this.ly_corr_scale +"");
properties.setProperty(prefix+"corr_magic_scale", this.corr_magic_scale +""); properties.setProperty(prefix+"corr_magic_scale", this.corr_magic_scale +"");
...@@ -3282,6 +3284,7 @@ public class EyesisCorrectionParameters { ...@@ -3282,6 +3284,7 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"lyf_frac_keep")!=null) this.lyf_frac_keep=Double.parseDouble(properties.getProperty(prefix+"lyf_frac_keep")); if (properties.getProperty(prefix+"lyf_frac_keep")!=null) this.lyf_frac_keep=Double.parseDouble(properties.getProperty(prefix+"lyf_frac_keep"));
if (properties.getProperty(prefix+"lyf_min_samples")!=null) this.lyf_min_samples=Integer.parseInt(properties.getProperty(prefix+"lyf_min_samples")); if (properties.getProperty(prefix+"lyf_min_samples")!=null) this.lyf_min_samples=Integer.parseInt(properties.getProperty(prefix+"lyf_min_samples"));
if (properties.getProperty(prefix+"lyf_norm_center")!=null) this.lyf_norm_center=Boolean.parseBoolean(properties.getProperty(prefix+"lyf_norm_center")); if (properties.getProperty(prefix+"lyf_norm_center")!=null) this.lyf_norm_center=Boolean.parseBoolean(properties.getProperty(prefix+"lyf_norm_center"));
if (properties.getProperty(prefix+"ly_corr_scale")!=null) this.ly_corr_scale=Double.parseDouble(properties.getProperty(prefix+"ly_corr_scale"));
if (properties.getProperty(prefix+"corr_magic_scale")!=null) this.corr_magic_scale=Double.parseDouble(properties.getProperty(prefix+"corr_magic_scale")); if (properties.getProperty(prefix+"corr_magic_scale")!=null) this.corr_magic_scale=Double.parseDouble(properties.getProperty(prefix+"corr_magic_scale"));
...@@ -3886,6 +3889,7 @@ public class EyesisCorrectionParameters { ...@@ -3886,6 +3889,7 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Keep best fit samples, discard worst", this.lyf_frac_keep, 3); gd.addNumericField("Keep best fit samples, discard worst", this.lyf_frac_keep, 3);
gd.addNumericField("Minimal number of tiles remaining in the sample", this.lyf_min_samples, 0); gd.addNumericField("Minimal number of tiles remaining in the sample", this.lyf_min_samples, 0);
gd.addCheckbox ("Replace samples with a single average with equal weight", this.lyf_norm_center); gd.addCheckbox ("Replace samples with a single average with equal weight", this.lyf_norm_center);
gd.addNumericField("Scale calculated correction vector", this.ly_corr_scale, 3);
gd.addMessage ("---"); gd.addMessage ("---");
// gd.addNumericField("Use square this size side to detect outliers", this.fcorr_sample_size, 0); // gd.addNumericField("Use square this size side to detect outliers", this.fcorr_sample_size, 0);
// gd.addNumericField("Keep tiles only if there are more in each square", this.fcorr_mintiles, 0); // gd.addNumericField("Keep tiles only if there are more in each square", this.fcorr_mintiles, 0);
...@@ -4510,6 +4514,7 @@ public class EyesisCorrectionParameters { ...@@ -4510,6 +4514,7 @@ public class EyesisCorrectionParameters {
this.lyf_frac_keep= gd.getNextNumber(); this.lyf_frac_keep= gd.getNextNumber();
this.lyf_min_samples= (int) gd.getNextNumber(); this.lyf_min_samples= (int) gd.getNextNumber();
this.lyf_norm_center= gd.getNextBoolean(); this.lyf_norm_center= gd.getNextBoolean();
this.ly_corr_scale= gd.getNextNumber();
// this.fcorr_sample_size= (int)gd.getNextNumber(); // this.fcorr_sample_size= (int)gd.getNextNumber();
// this.fcorr_mintiles= (int) gd.getNextNumber(); // this.fcorr_mintiles= (int) gd.getNextNumber();
// this.fcorr_reloutliers= gd.getNextNumber(); // this.fcorr_reloutliers= gd.getNextNumber();
......
...@@ -215,16 +215,17 @@ public class GeometryCorrection { ...@@ -215,16 +215,17 @@ public class GeometryCorrection {
return s; return s;
} }
public void incrementVector(double [] incr) public void incrementVector(double [] incr,
double scale)
{ {
for (int i = 0; i < incr.length; i++){ for (int i = 0; i < incr.length; i++){
vector[i]+=incr[i]; vector[i]+= incr[i] * scale;
} }
} }
public void incrementVector(CorrVector incr) public void incrementVector(CorrVector incr, double scale)
{ {
incrementVector(incr.toArray()); incrementVector(incr.toArray(), scale);
} }
......
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