Commit ba9466e1 authored by Andrey Filippov's avatar Andrey Filippov

Improving matching stability, added parameters

parent f468c5ba
...@@ -23,7 +23,19 @@ public class PairwiseOrthoMatch implements Serializable { ...@@ -23,7 +23,19 @@ public class PairwiseOrthoMatch implements Serializable {
this.jtj = jtj; this.jtj = jtj;
this.zoom_lev=zoom_lev; this.zoom_lev=zoom_lev;
} }
public PairwiseOrthoMatch clone() {
double [][] affine = {this.affine[0].clone(),this.affine[1].clone()};
double [][] jtj = new double [this.jtj.length][];
for (int i = 0; i < this.jtj.length; i++) {
jtj[i] = this.jtj[i].clone();
}
PairwiseOrthoMatch pom = new PairwiseOrthoMatch(
affine,
jtj,
this.rms,
this.zoom_lev);
return pom;
}
public PairwiseOrthoMatch getInverse(double [] rd) { public PairwiseOrthoMatch getInverse(double [] rd) {
double [][] affine = OrthoMap.invertAffine(getAffine()); double [][] affine = OrthoMap.invertAffine(getAffine());
PairwiseOrthoMatch inverted_match = new PairwiseOrthoMatch( PairwiseOrthoMatch inverted_match = new PairwiseOrthoMatch(
......
...@@ -107,6 +107,20 @@ public class IntersceneMatchParameters { ...@@ -107,6 +107,20 @@ public class IntersceneMatchParameters {
public double rln_sngl_rstr = 0.3; // minimal single-tile phase correlation maximums relative to max str public double rln_sngl_rstr = 0.3; // minimal single-tile phase correlation maximums relative to max str
public double rln_neib_rstr = 0.4; // minimal neighbors phase correlation maximums relative to max str public double rln_neib_rstr = 0.4; // minimal neighbors phase correlation maximums relative to max str
public boolean ospir_existing = false; // use existing pair
public boolean ospir_invert = false; // invert existing pair
public double ospir_step = 8.0; // spiral step (pix)
public double ospir_range = 50.0; // spiral radius (pix)
public double ospir_good_rms = 0.27; // maximal immediately acceptable LMA RMS for the initial search
public double ospir_max_rms = 0.35; // maximal acceptable LMA RMS - best during initial search
public int ospir_overlap = 3000; // do not try to match if there is too small overlap (scaled pixels)
public int ospir_num_iter = 5; // maximal number of LMA iterations during initial search
public boolean ospir_ignore_rms = false; // ignore RMS worsening during spiral search
public int ospir_debug = 0; // Debug level during sppiral search
public double [] getImsMountATR() { public double [] getImsMountATR() {
return new double [] { return new double [] {
ims_mount_atr[0] * Math.PI/180, ims_mount_atr[0] * Math.PI/180,
...@@ -694,6 +708,20 @@ public class IntersceneMatchParameters { ...@@ -694,6 +708,20 @@ public class IntersceneMatchParameters {
"Minimal single-tile phase correlation maximums relative to maximal strength."); "Minimal single-tile phase correlation maximums relative to maximal strength.");
gd.addNumericField("Minimal relative strength (neighbors)", this.rln_neib_rstr, 5,8,"", gd.addNumericField("Minimal relative strength (neighbors)", this.rln_neib_rstr, 5,8,"",
"Minimal neighbors phase correlation maximums relative to maximal strength."); "Minimal neighbors phase correlation maximums relative to maximal strength.");
gd.addMessage ("Initial spiral search for image matching");
gd.addCheckbox ("Use existing image pair", this.ospir_existing, "Use existing affine settings for this pair, do not use spiral search.");
gd.addCheckbox ("Invert existing image pair", this.ospir_invert, "Invert existing image pair affine transform, do not use spiral search.");
gd.addNumericField("Spiral search step", this.ospir_step, 3,7,"scaled pix", "Distance between spiral search probes, in scaled pixels.");
gd.addNumericField("Spiral search radius", this.ospir_range, 3,7,"scaled pix", "Maximal radius of the spiral search, in scaled pixels.");
gd.addNumericField("RMSE to end search", this.ospir_good_rms, 3,7,"scaled pix", "Maximal RMSE to consider match, in scaled pixels.");
gd.addNumericField("Satisfactory RMSE", this.ospir_max_rms, 3,7,"scaled pix", "Maximal RMSE to consider match, in scaled pixels.");
gd.addNumericField("Minimal overlap", this.ospir_overlap, 0,4,"scaled pix ^ 2","Minimal overlap area in square scaled pixels.");
gd.addNumericField("LMA iterations", this.ospir_num_iter, 0,2,"", "Number of LMA iterations during spiral search.");
gd.addCheckbox ("Ignore worsening RMSE", this.ospir_ignore_rms, "Ignore worsening/not improving RMSE during spiral search.");
gd.addNumericField("Spiral search debug level", this.ospir_debug, 0,3,"","Debug level during Spiral search.");
//
gd.addTab ("Scene Series", "Processing series of scenes and multi-series sets"); gd.addTab ("Scene Series", "Processing series of scenes and multi-series sets");
gd.addMessage ("Build series options"); gd.addMessage ("Build series options");
...@@ -1534,7 +1562,18 @@ public class IntersceneMatchParameters { ...@@ -1534,7 +1562,18 @@ public class IntersceneMatchParameters {
this.rln_n_recenter = (int) gd.getNextNumber(); this.rln_n_recenter = (int) gd.getNextNumber();
this.rln_sngl_rstr = gd.getNextNumber(); this.rln_sngl_rstr = gd.getNextNumber();
this.rln_neib_rstr = gd.getNextNumber(); this.rln_neib_rstr = gd.getNextNumber();
this.ospir_existing = gd.getNextBoolean();
this.ospir_invert = gd.getNextBoolean();
this.ospir_step = gd.getNextNumber();
this.ospir_range = gd.getNextNumber();
this.ospir_good_rms = gd.getNextNumber();
this.ospir_max_rms = gd.getNextNumber();
this.ospir_overlap = (int) gd.getNextNumber();
this.ospir_num_iter = (int) gd.getNextNumber();
this.ospir_ignore_rms = gd.getNextBoolean();
this.ospir_debug = (int) gd.getNextNumber();
this.center_reference = gd.getNextBoolean(); this.center_reference = gd.getNextBoolean();
this.overlap_sequences = gd.getNextBoolean(); this.overlap_sequences = gd.getNextBoolean();
this.reset_photometric = gd.getNextBoolean(); this.reset_photometric = gd.getNextBoolean();
...@@ -1994,7 +2033,18 @@ public class IntersceneMatchParameters { ...@@ -1994,7 +2033,18 @@ public class IntersceneMatchParameters {
properties.setProperty(prefix+"rln_cent_radius", this.rln_cent_radius +""); // double properties.setProperty(prefix+"rln_cent_radius", this.rln_cent_radius +""); // double
properties.setProperty(prefix+"rln_n_recenter", this.rln_n_recenter+""); // int properties.setProperty(prefix+"rln_n_recenter", this.rln_n_recenter+""); // int
properties.setProperty(prefix+"rln_sngl_rstr", this.rln_sngl_rstr +""); // double properties.setProperty(prefix+"rln_sngl_rstr", this.rln_sngl_rstr +""); // double
properties.setProperty(prefix+"rln_neib_rstr", this.rln_neib_rstr +""); // double properties.setProperty(prefix+"rln_neib_rstr", this.rln_neib_rstr +"");
properties.setProperty(prefix+"ospir_existing", this.ospir_existing +""); // boolean
properties.setProperty(prefix+"ospir_invert", this.ospir_invert +""); // boolean
properties.setProperty(prefix+"ospir_step", this.ospir_step +""); // double
properties.setProperty(prefix+"ospir_range", this.ospir_range +""); // double
properties.setProperty(prefix+"ospir_good_rms", this.ospir_good_rms +""); // double
properties.setProperty(prefix+"ospir_max_rms", this.ospir_max_rms +""); // double
properties.setProperty(prefix+"ospir_overlap", this.ospir_overlap +""); // int
properties.setProperty(prefix+"ospir_num_iter", this.ospir_num_iter +""); // int
properties.setProperty(prefix+"ospir_ignore_rms", this.ospir_ignore_rms +""); // boolean
properties.setProperty(prefix+"ospir_debug", this.ospir_debug +""); // int
properties.setProperty(prefix+"center_reference", this.center_reference + ""); // boolean properties.setProperty(prefix+"center_reference", this.center_reference + ""); // boolean
properties.setProperty(prefix+"overlap_sequences", this.overlap_sequences + ""); // boolean properties.setProperty(prefix+"overlap_sequences", this.overlap_sequences + ""); // boolean
...@@ -2420,6 +2470,17 @@ public class IntersceneMatchParameters { ...@@ -2420,6 +2470,17 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"rln_sngl_rstr")!=null) this.rln_sngl_rstr=Double.parseDouble(properties.getProperty(prefix+"rln_sngl_rstr")); if (properties.getProperty(prefix+"rln_sngl_rstr")!=null) this.rln_sngl_rstr=Double.parseDouble(properties.getProperty(prefix+"rln_sngl_rstr"));
if (properties.getProperty(prefix+"rln_neib_rstr")!=null) this.rln_neib_rstr=Double.parseDouble(properties.getProperty(prefix+"rln_neib_rstr")); if (properties.getProperty(prefix+"rln_neib_rstr")!=null) this.rln_neib_rstr=Double.parseDouble(properties.getProperty(prefix+"rln_neib_rstr"));
if (properties.getProperty(prefix+"ospir_existing")!=null) this.ospir_existing=Boolean.parseBoolean(properties.getProperty(prefix+ "ospir_existing"));
if (properties.getProperty(prefix+"ospir_invert")!=null) this.ospir_invert=Boolean.parseBoolean(properties.getProperty(prefix+ "ospir_invert"));
if (properties.getProperty(prefix+"ospir_step")!=null) this.ospir_step=Double.parseDouble(properties.getProperty(prefix+ "ospir_step"));
if (properties.getProperty(prefix+"ospir_range")!=null) this.ospir_range=Double.parseDouble(properties.getProperty(prefix+ "ospir_range"));
if (properties.getProperty(prefix+"ospir_good_rms")!=null) this.ospir_good_rms=Double.parseDouble(properties.getProperty(prefix+ "ospir_good_rms"));
if (properties.getProperty(prefix+"ospir_max_rms")!=null) this.ospir_max_rms=Double.parseDouble(properties.getProperty(prefix+ "ospir_max_rms"));
if (properties.getProperty(prefix+"ospir_overlap")!=null) this.ospir_overlap=Integer.parseInt(properties.getProperty(prefix+ "ospir_overlap"));
if (properties.getProperty(prefix+"ospir_num_iter")!=null) this.ospir_num_iter=Integer.parseInt(properties.getProperty(prefix+ "ospir_num_iter"));
if (properties.getProperty(prefix+"ospir_ignore_rms")!=null) this.ospir_ignore_rms=Boolean.parseBoolean(properties.getProperty(prefix+"ospir_ignore_rms"));
if (properties.getProperty(prefix+"ospir_debug")!=null) this.ospir_debug=Integer.parseInt(properties.getProperty(prefix+ "ospir_debug"));
if (properties.getProperty(prefix+"center_reference")!=null) this.center_reference=Boolean.parseBoolean(properties.getProperty(prefix+"center_reference")); if (properties.getProperty(prefix+"center_reference")!=null) this.center_reference=Boolean.parseBoolean(properties.getProperty(prefix+"center_reference"));
if (properties.getProperty(prefix+"overlap_sequences")!=null) this.overlap_sequences=Boolean.parseBoolean(properties.getProperty(prefix+"overlap_sequences")); if (properties.getProperty(prefix+"overlap_sequences")!=null) this.overlap_sequences=Boolean.parseBoolean(properties.getProperty(prefix+"overlap_sequences"));
if (properties.getProperty(prefix+"reset_photometric")!=null) this.reset_photometric=Boolean.parseBoolean(properties.getProperty(prefix+"reset_photometric")); if (properties.getProperty(prefix+"reset_photometric")!=null) this.reset_photometric=Boolean.parseBoolean(properties.getProperty(prefix+"reset_photometric"));
...@@ -2871,7 +2932,17 @@ public class IntersceneMatchParameters { ...@@ -2871,7 +2932,17 @@ public class IntersceneMatchParameters {
imp.rln_cent_radius = this.rln_cent_radius; imp.rln_cent_radius = this.rln_cent_radius;
imp.rln_n_recenter = this.rln_n_recenter; imp.rln_n_recenter = this.rln_n_recenter;
imp.rln_sngl_rstr = this.rln_sngl_rstr; imp.rln_sngl_rstr = this.rln_sngl_rstr;
imp.rln_neib_rstr = this.rln_neib_rstr; imp.rln_neib_rstr = this.rln_neib_rstr;
imp.ospir_existing = this.ospir_existing;
imp.ospir_step = this.ospir_step;
imp.ospir_range = this.ospir_range;
imp.ospir_good_rms = this.ospir_good_rms;
imp.ospir_max_rms = this.ospir_max_rms;
imp.ospir_overlap = this.ospir_overlap;
imp.ospir_num_iter = this.ospir_num_iter;
imp.ospir_ignore_rms = this.ospir_ignore_rms;
imp.ospir_debug = this.ospir_debug;
imp.center_reference = this.center_reference; imp.center_reference = this.center_reference;
imp.overlap_sequences = this.overlap_sequences; imp.overlap_sequences = this.overlap_sequences;
......
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