Commit c8d3d7d9 authored by Andrey Filippov's avatar Andrey Filippov

cleaning up with eigen, adding debug image generation for LMA

parent 477343de
...@@ -2351,6 +2351,7 @@ public class ImageDtt extends ImageDttCPU { ...@@ -2351,6 +2351,7 @@ public class ImageDtt extends ImageDttCPU {
final boolean td_nopd_only, // only use TD accumulated data if no safe PD is available for the tile. final boolean td_nopd_only, // only use TD accumulated data if no safe PD is available for the tile.
final boolean eig_use_neibs, // use correlation from 9 tiles with neibs, if single-tile fails final boolean eig_use_neibs, // use correlation from 9 tiles with neibs, if single-tile fails
final boolean eig_remove_neibs, //remove weak (by-neibs) tiles if they have strong (by-single) neighbor final boolean eig_remove_neibs, //remove weak (by-neibs) tiles if they have strong (by-single) neighbor
final boolean eig_filt_other, // apply other before-eigen filters
// final double min_str_nofpn, // = 0.25; // final double min_str_nofpn, // = 0.25;
final double eig_str_sum_nofpn,// = 0.8; // 5; final double eig_str_sum_nofpn,// = 0.8; // 5;
final double eig_str_neib_nofpn,// = 0.8; // 5; final double eig_str_neib_nofpn,// = 0.8; // 5;
...@@ -2720,10 +2721,9 @@ public class ImageDtt extends ImageDttCPU { ...@@ -2720,10 +2721,9 @@ public class ImageDtt extends ImageDttCPU {
} }
startAndJoin(threads); startAndJoin(threads);
} }
boolean old_filter = false; // true;
// Reduce weight if differs much from average of 8 neighbors, large disparity, remove too few neibs // Reduce weight if differs much from average of 8 neighbors, large disparity, remove too few neibs
final double scale_num_neib = ((weight_zero_neibs >= 0) && (weight_zero_neibs < 1.0)) ? (weight_zero_neibs * 8/(1.0 - weight_zero_neibs)): 0.0; final double scale_num_neib = ((weight_zero_neibs >= 0) && (weight_zero_neibs < 1.0)) ? (weight_zero_neibs * 8/(1.0 - weight_zero_neibs)): 0.0;
if (old_filter) { if (eig_filt_other) {
ai.set(0); ai.set(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
......
...@@ -451,6 +451,9 @@ public class IntersceneMatchParameters { ...@@ -451,6 +451,9 @@ public class IntersceneMatchParameters {
public double eig_min_sqrt = 1.0; // for sqrt(lambda) - limit minimal sqrt(lambda) - can be sharp for very small max public double eig_min_sqrt = 1.0; // for sqrt(lambda) - limit minimal sqrt(lambda) - can be sharp for very small max
public boolean eig_use_neibs = true; // use correlation from 9 tiles with neibs, if single-tile fails public boolean eig_use_neibs = true; // use correlation from 9 tiles with neibs, if single-tile fails
public boolean eig_remove_neibs = true; // remove weak (by-neibs) tiles if they have strong (by-single) neighbor public boolean eig_remove_neibs = true; // remove weak (by-neibs) tiles if they have strong (by-single) neighbor
public boolean eig_filt_other = false; // apply other before-eigen filters
public double eig_max_rms = 2.0; // eigen-normalized maximal RMS to consider adjustment to be a failure
/* /*
min_str_sum_nofpn 0.22 min_str_sum_nofpn 0.22
...@@ -1358,8 +1361,10 @@ min_str_neib_fpn 0.35 ...@@ -1358,8 +1361,10 @@ min_str_neib_fpn 0.35
"Use correlation from 9 tiles with neibs, if single-tile fails"); "Use correlation from 9 tiles with neibs, if single-tile fails");
gd.addCheckbox ("Remove weak by strong neighbors", this.eig_remove_neibs, gd.addCheckbox ("Remove weak by strong neighbors", this.eig_remove_neibs,
"Remove weak (by-neibs) tiles if they have strong (by-single) neighbor"); "Remove weak (by-neibs) tiles if they have strong (by-single) neighbor");
gd.addCheckbox ("Apply other filters", this.eig_filt_other,
"Apply other (before-eigen) filters");
gd.addNumericField("Maximal eigen-normalized RMS", this.eig_max_rms, 5,7,"",
"Maximal eigen-normalized RMSE for LMA adjustment. Replaces \"Maximal RMS to fail\" setting below.");
gd.addMessage ("Filtering tiles for interscene matching"); gd.addMessage ("Filtering tiles for interscene matching");
...@@ -2048,7 +2053,8 @@ min_str_neib_fpn 0.35 ...@@ -2048,7 +2053,8 @@ min_str_neib_fpn 0.35
this.eig_min_sqrt = gd.getNextNumber(); this.eig_min_sqrt = gd.getNextNumber();
this.eig_use_neibs = gd.getNextBoolean(); this.eig_use_neibs = gd.getNextBoolean();
this.eig_remove_neibs = gd.getNextBoolean(); this.eig_remove_neibs = gd.getNextBoolean();
this.eig_filt_other = gd.getNextBoolean();
this.eig_max_rms = gd.getNextNumber();
this.use_combo_reliable = gd.getNextBoolean(); this.use_combo_reliable = gd.getNextBoolean();
this.ref_need_lma = gd.getNextBoolean(); this.ref_need_lma = gd.getNextBoolean();
this.ref_need_lma_combo = gd.getNextBoolean(); this.ref_need_lma_combo = gd.getNextBoolean();
...@@ -2603,6 +2609,8 @@ min_str_neib_fpn 0.35 ...@@ -2603,6 +2609,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"eig_min_sqrt", this.eig_min_sqrt+""); // double properties.setProperty(prefix+"eig_min_sqrt", this.eig_min_sqrt+""); // double
properties.setProperty(prefix+"eig_use_neibs", this.eig_use_neibs+""); // boolean properties.setProperty(prefix+"eig_use_neibs", this.eig_use_neibs+""); // boolean
properties.setProperty(prefix+"eig_remove_neibs", this.eig_remove_neibs+""); // boolean properties.setProperty(prefix+"eig_remove_neibs", this.eig_remove_neibs+""); // boolean
properties.setProperty(prefix+"eig_filt_other", this.eig_filt_other+""); // boolean
properties.setProperty(prefix+"eig_max_rms", this.eig_max_rms+""); // double
properties.setProperty(prefix+"use_combo_reliable", this.use_combo_reliable+""); // boolean properties.setProperty(prefix+"use_combo_reliable", this.use_combo_reliable+""); // boolean
properties.setProperty(prefix+"ref_need_lma", this.ref_need_lma+""); // boolean properties.setProperty(prefix+"ref_need_lma", this.ref_need_lma+""); // boolean
...@@ -3120,6 +3128,8 @@ min_str_neib_fpn 0.35 ...@@ -3120,6 +3128,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"eig_min_sqrt")!=null) this.eig_min_sqrt=Double.parseDouble(properties.getProperty(prefix+"eig_min_sqrt")); if (properties.getProperty(prefix+"eig_min_sqrt")!=null) this.eig_min_sqrt=Double.parseDouble(properties.getProperty(prefix+"eig_min_sqrt"));
if (properties.getProperty(prefix+"eig_use_neibs")!=null) this.eig_use_neibs=Boolean.parseBoolean(properties.getProperty(prefix+"eig_use_neibs")); if (properties.getProperty(prefix+"eig_use_neibs")!=null) this.eig_use_neibs=Boolean.parseBoolean(properties.getProperty(prefix+"eig_use_neibs"));
if (properties.getProperty(prefix+"eig_remove_neibs")!=null) this.eig_remove_neibs=Boolean.parseBoolean(properties.getProperty(prefix+"eig_remove_neibs")); if (properties.getProperty(prefix+"eig_remove_neibs")!=null) this.eig_remove_neibs=Boolean.parseBoolean(properties.getProperty(prefix+"eig_remove_neibs"));
if (properties.getProperty(prefix+"eig_filt_other")!=null) this.eig_filt_other=Boolean.parseBoolean(properties.getProperty(prefix+"eig_filt_other"));
if (properties.getProperty(prefix+"eig_max_rms")!=null) this.eig_max_rms=Double.parseDouble(properties.getProperty(prefix+"eig_max_rms"));
if (properties.getProperty(prefix+"use_combo_reliable")!=null) this.use_combo_reliable=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_reliable")); if (properties.getProperty(prefix+"use_combo_reliable")!=null) this.use_combo_reliable=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_reliable"));
else if (properties.getProperty(prefix+"use_combo_relaible")!=null) this.use_combo_reliable=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_relaible")); else if (properties.getProperty(prefix+"use_combo_relaible")!=null) this.use_combo_reliable=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_relaible"));
...@@ -3645,6 +3655,8 @@ min_str_neib_fpn 0.35 ...@@ -3645,6 +3655,8 @@ min_str_neib_fpn 0.35
imp.eig_min_sqrt = this.eig_min_sqrt; imp.eig_min_sqrt = this.eig_min_sqrt;
imp.eig_use_neibs = this.eig_use_neibs; imp.eig_use_neibs = this.eig_use_neibs;
imp.eig_remove_neibs = this.eig_remove_neibs; imp.eig_remove_neibs = this.eig_remove_neibs;
imp.eig_filt_other = this.eig_filt_other;
imp.eig_max_rms = this.eig_max_rms;
imp.use_combo_reliable = this.use_combo_reliable; imp.use_combo_reliable = this.use_combo_reliable;
imp.ref_need_lma = this.ref_need_lma; imp.ref_need_lma = this.ref_need_lma;
......
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