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

prepared elevation data, starting elevation LMA fitting

parent 5980d194
...@@ -5802,11 +5802,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -5802,11 +5802,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
} else if (label.equals("Process Merged")) { } else if (label.equals("Process Merged")) {
OrangeTest.processMerged(); OrangeTest.processMerged();
} else if (label.equals("Vegetation LMA")) { } else if (label.equals("Vegetation LMA")) {
VegetationModel.testVegetationLMA( VegetationModel.processVegetationLMA(
CLT_PARAMETERS, //CLTParameters clt_parameters, CLT_PARAMETERS, //CLTParameters clt_parameters,
false); //boolean combine_segments); false); //boolean combine_segments);
} else if (label.equals("Combine LMA Segments")) { } else if (label.equals("Combine LMA Segments")) {
VegetationModel.testVegetationLMA( VegetationModel.processVegetationLMA(
CLT_PARAMETERS, //CLTParameters clt_parameters, CLT_PARAMETERS, //CLTParameters clt_parameters,
true); //boolean combine_segments); true); //boolean combine_segments);
} }
......
...@@ -760,7 +760,9 @@ min_str_neib_fpn 0.35 ...@@ -760,7 +760,9 @@ min_str_neib_fpn 0.35
public double terr_difference = 100.0; // vegetation is 100 warmer (target) public double terr_difference = 100.0; // vegetation is 100 warmer (target)
public double terr_pull_cold = 0.001; // pull vegetations to warm, terrain to cold public double terr_pull_cold = 0.001; // pull vegetations to warm, terrain to cold
public double terr_alpha_dflt = 0.5;
public double terr_alpha_contrast = 1.0; // initial alpha contrast (>=1.0)
public double terr_alpha_dflt = 0.5; // now unused
public double terr_alpha_loss = 100.0; public double terr_alpha_loss = 100.0;
public double terr_alpha_offset = 0.0; public double terr_alpha_offset = 0.0;
public double terr_alpha_lpf = 2.5; // pull to average of 4 neighbors public double terr_alpha_lpf = 2.5; // pull to average of 4 neighbors
...@@ -775,6 +777,7 @@ min_str_neib_fpn 0.35 ...@@ -775,6 +777,7 @@ min_str_neib_fpn 0.35
public double terr_veget_lpf = 0.2; // pull vegetation to average of 4 neighbors (very small - maybe not needed) public double terr_veget_lpf = 0.2; // pull vegetation to average of 4 neighbors (very small - maybe not needed)
public double terr_terr_pull0 = 0.05; // pull terrain to zero (makes sense with UM public double terr_terr_pull0 = 0.05; // pull terrain to zero (makes sense with UM
public double terr_veget_pull0 = 0.05; // pull vegetation to zero (makes sense with UM public double terr_veget_pull0 = 0.05; // pull vegetation to zero (makes sense with UM
public double terr_scenes_pull0 = 1.0; // pull average scene offset to zero
// LMA parameters // LMA parameters
public double terr_boost_parallax = 3.0; // public double terr_boost_parallax = 3.0; //
...@@ -2013,15 +2016,19 @@ min_str_neib_fpn 0.35 ...@@ -2013,15 +2016,19 @@ min_str_neib_fpn 0.35
gd.addNumericField("Min influenced scenes",terr_min_scenes, 0,3, "", "Minimal number of scenes (inside woi) vegetation pixel must influence."); gd.addNumericField("Min influenced scenes",terr_min_scenes, 0,3, "", "Minimal number of scenes (inside woi) vegetation pixel must influence.");
gd.addNumericField("Minimal samples/scene",terr_min_samples_scene, 0,3,"","Minimal samples per scene used for fitting (skip scene if less)."); gd.addNumericField("Minimal samples/scene",terr_min_samples_scene, 0,3,"","Minimal samples per scene used for fitting (skip scene if less).");
gd.addNumericField("Minimum scenes used", terr_min_total_scenes, 0,3,"", "Minimal total number of scenes used (skip segment if less)."); gd.addNumericField("Minimum scenes used", terr_min_total_scenes, 0,3,"", "Minimal total number of scenes used (skip segment if less).");
gd.addNumericField("Minimal pixels fitted",terr_min_pixels, 0,3,"", "Minimal number of terrain and vegetation pixels used for fitting in this segment(skip segment if less)."); gd.addNumericField("Minimal pixels fitted",terr_min_pixels, 0,3,"", "Minimal number of terrain and vegetation pixels used for fitting in this segment(skip segment if less).");
gd.addCheckbox ("Start by temperature", terr_warm_veget, "Start with vegetation warmer than terrain."); gd.addCheckbox ("Start by temperature", terr_warm_veget, "Start with vegetation warmer than terrain.");
gd.addNumericField("Warmest terrain", terr_warmest, 5,7,"", "Above - vegetation. below - terrain."); gd.addNumericField("Warmest terrain", terr_warmest, 5,7,"", "Above - vegetation. below - terrain.");
gd.addNumericField("Initial split", terr_initial_split, 5,7,"", "Initial alpha: terrain 0.0+, vegetation 1.0-."); gd.addNumericField("Initial split", terr_initial_split, 5,7,"", "Initial alpha: terrain 0.0+, vegetation 1.0-.");
gd.addNumericField("Min. split fraction", terr_min_split_frac, 5,7,"", "minimal modality fraction to use split by temperature (otherwise use default alpha)."); gd.addNumericField("Min. split fraction", terr_min_split_frac, 5,7,"", "minimal modality fraction to use split by temperature (otherwise use default alpha).");
gd.addNumericField("Vegetation warmer", terr_difference, 5,7,"", "Pull vegetation to be this warmer."); gd.addNumericField("Vegetation warmer", terr_difference, 5,7,"", "Pull vegetation to be this warmer.");
gd.addNumericField("Pull terrain cold", terr_pull_cold, 5,7,"", "Pull vegetations to warm, terrain to cold."); gd.addNumericField("Pull terrain cold", terr_pull_cold, 5,7,"", "Pull vegetations to warm, terrain to cold.");
gd.addNumericField("Alpha initial contrast",terr_alpha_contrast, 5,7,"","Initial alpha contrast (>= 1.0).");
gd.addNumericField("Defalt alpha", terr_alpha_dflt, 5,7,"", "Default vegetation alpha."); gd.addNumericField("Defalt alpha", terr_alpha_dflt, 5,7,"", "Default vegetation alpha.");
gd.addNumericField("Alpha loss", terr_alpha_loss, 5,7,"", "Alpha quadratic growing loss for when out of [0,1] range"); gd.addNumericField("Alpha loss", terr_alpha_loss, 5,7,"", "Alpha quadratic growing loss for when out of [0,1] range");
gd.addNumericField("Alpha offset", terr_alpha_offset, 5,7,"", "Start alpha losses above 0.0 and below 1.0 by this value."); gd.addNumericField("Alpha offset", terr_alpha_offset, 5,7,"", "Start alpha losses above 0.0 and below 1.0 by this value.");
gd.addNumericField("Alpha diffusion", terr_alpha_lpf, 5,7,"", "Alpha diffusion to 4 ortho neighbors."); gd.addNumericField("Alpha diffusion", terr_alpha_lpf, 5,7,"", "Alpha diffusion to 4 ortho neighbors.");
gd.addCheckbox ("Alpha piece-linear", terr_alpha_piece_linear, "Piece-linear alpha (_/\u203E, false - 0.0-cosine-1.0."); gd.addCheckbox ("Alpha piece-linear", terr_alpha_piece_linear, "Piece-linear alpha (_/\u203E, false - 0.0-cosine-1.0.");
...@@ -2035,6 +2042,7 @@ min_str_neib_fpn 0.35 ...@@ -2035,6 +2042,7 @@ min_str_neib_fpn 0.35
gd.addNumericField("Vegetation diffusion", terr_veget_lpf, 5,7,"", "LPF for vegetation pixels (diffusion to 4 neighbors)."); gd.addNumericField("Vegetation diffusion", terr_veget_lpf, 5,7,"", "LPF for vegetation pixels (diffusion to 4 neighbors).");
gd.addNumericField("Terrain pull zero", terr_terr_pull0, 5,7,"", "Terrain pixels pull to 0 (makes sense with UM)."); gd.addNumericField("Terrain pull zero", terr_terr_pull0, 5,7,"", "Terrain pixels pull to 0 (makes sense with UM).");
gd.addNumericField("Vegetation pull zero", terr_veget_pull0, 5,7,"", "Vegetation pixels pull to 0 (makes sense with UM)."); gd.addNumericField("Vegetation pull zero", terr_veget_pull0, 5,7,"", "Vegetation pixels pull to 0 (makes sense with UM).");
gd.addNumericField("Pull scene offset", terr_scenes_pull0, 5,7,"", "Pull average scene offset to zero.");
gd.addMessage ("LMA parameters"); gd.addMessage ("LMA parameters");
gd.addNumericField("Boost parallax", terr_boost_parallax, 5,7,"", "Increase weight of scenes that have high parallax to the reference one."); gd.addNumericField("Boost parallax", terr_boost_parallax, 5,7,"", "Increase weight of scenes that have high parallax to the reference one.");
...@@ -2721,6 +2729,7 @@ min_str_neib_fpn 0.35 ...@@ -2721,6 +2729,7 @@ min_str_neib_fpn 0.35
terr_min_split_frac = gd.getNextNumber();// double terr_min_split_frac = gd.getNextNumber();// double
terr_difference = gd.getNextNumber();// double terr_difference = gd.getNextNumber();// double
terr_pull_cold = gd.getNextNumber();// double terr_pull_cold = gd.getNextNumber();// double
terr_alpha_contrast = gd.getNextNumber();// double
terr_alpha_dflt = gd.getNextNumber();// double terr_alpha_dflt = gd.getNextNumber();// double
terr_alpha_loss = gd.getNextNumber();// double terr_alpha_loss = gd.getNextNumber();// double
terr_alpha_offset = gd.getNextNumber();// double terr_alpha_offset = gd.getNextNumber();// double
...@@ -2737,7 +2746,7 @@ min_str_neib_fpn 0.35 ...@@ -2737,7 +2746,7 @@ min_str_neib_fpn 0.35
terr_veget_lpf = gd.getNextNumber();// double terr_veget_lpf = gd.getNextNumber();// double
terr_terr_pull0 = gd.getNextNumber();// double terr_terr_pull0 = gd.getNextNumber();// double
terr_veget_pull0 = gd.getNextNumber();// double terr_veget_pull0 = gd.getNextNumber();// double
terr_scenes_pull0 = gd.getNextNumber();// double
terr_boost_parallax = gd.getNextNumber();// double terr_boost_parallax = gd.getNextNumber();// double
terr_max_parallax = gd.getNextNumber();// double terr_max_parallax = gd.getNextNumber();// double
terr_hifreq_weight = gd.getNextNumber();// double terr_hifreq_weight = gd.getNextNumber();// double
...@@ -3392,6 +3401,8 @@ min_str_neib_fpn 0.35 ...@@ -3392,6 +3401,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"terr_difference", terr_difference+""); // double properties.setProperty(prefix+"terr_difference", terr_difference+""); // double
properties.setProperty(prefix+"terr_pull_cold", terr_pull_cold+""); // double properties.setProperty(prefix+"terr_pull_cold", terr_pull_cold+""); // double
properties.setProperty(prefix+"terr_alpha_contrast", terr_alpha_contrast+""); // double
properties.setProperty(prefix+"terr_alpha_dflt", terr_alpha_dflt+""); // double properties.setProperty(prefix+"terr_alpha_dflt", terr_alpha_dflt+""); // double
properties.setProperty(prefix+"terr_alpha_loss", terr_alpha_loss+""); // double properties.setProperty(prefix+"terr_alpha_loss", terr_alpha_loss+""); // double
properties.setProperty(prefix+"terr_alpha_offset", terr_alpha_offset+""); // double properties.setProperty(prefix+"terr_alpha_offset", terr_alpha_offset+""); // double
...@@ -3406,6 +3417,7 @@ min_str_neib_fpn 0.35 ...@@ -3406,6 +3417,7 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"terr_veget_lpf", terr_veget_lpf+""); // double properties.setProperty(prefix+"terr_veget_lpf", terr_veget_lpf+""); // double
properties.setProperty(prefix+"terr_terr_pull0", terr_terr_pull0+""); // double properties.setProperty(prefix+"terr_terr_pull0", terr_terr_pull0+""); // double
properties.setProperty(prefix+"terr_veget_pull0", terr_veget_pull0+""); // double properties.setProperty(prefix+"terr_veget_pull0", terr_veget_pull0+""); // double
properties.setProperty(prefix+"terr_scenes_pull0", terr_scenes_pull0+""); // double
properties.setProperty(prefix+"terr_boost_parallax", terr_boost_parallax+""); // double properties.setProperty(prefix+"terr_boost_parallax", terr_boost_parallax+""); // double
properties.setProperty(prefix+"terr_max_parallax", terr_max_parallax+""); // double properties.setProperty(prefix+"terr_max_parallax", terr_max_parallax+""); // double
...@@ -4082,6 +4094,8 @@ min_str_neib_fpn 0.35 ...@@ -4082,6 +4094,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"terr_difference")!= null) terr_difference=Double.parseDouble(properties.getProperty(prefix+"terr_difference")); if (properties.getProperty(prefix+"terr_difference")!= null) terr_difference=Double.parseDouble(properties.getProperty(prefix+"terr_difference"));
if (properties.getProperty(prefix+"terr_pull_cold")!= null) terr_pull_cold=Double.parseDouble(properties.getProperty(prefix+"terr_pull_cold")); if (properties.getProperty(prefix+"terr_pull_cold")!= null) terr_pull_cold=Double.parseDouble(properties.getProperty(prefix+"terr_pull_cold"));
if (properties.getProperty(prefix+"terr_alpha_contrast")!= null) terr_alpha_contrast=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_contrast"));
if (properties.getProperty(prefix+"terr_alpha_dflt")!= null) terr_alpha_dflt=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_dflt")); if (properties.getProperty(prefix+"terr_alpha_dflt")!= null) terr_alpha_dflt=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_dflt"));
if (properties.getProperty(prefix+"terr_alpha_loss")!= null) terr_alpha_loss=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_loss")); if (properties.getProperty(prefix+"terr_alpha_loss")!= null) terr_alpha_loss=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_loss"));
if (properties.getProperty(prefix+"terr_alpha_offset")!= null) terr_alpha_offset=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_offset")); if (properties.getProperty(prefix+"terr_alpha_offset")!= null) terr_alpha_offset=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_offset"));
...@@ -4097,6 +4111,7 @@ min_str_neib_fpn 0.35 ...@@ -4097,6 +4111,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"terr_veget_lpf")!= null) terr_veget_lpf=Double.parseDouble(properties.getProperty(prefix+"terr_veget_lpf")); if (properties.getProperty(prefix+"terr_veget_lpf")!= null) terr_veget_lpf=Double.parseDouble(properties.getProperty(prefix+"terr_veget_lpf"));
if (properties.getProperty(prefix+"terr_terr_pull0")!= null) terr_terr_pull0=Double.parseDouble(properties.getProperty(prefix+"terr_terr_pull0")); if (properties.getProperty(prefix+"terr_terr_pull0")!= null) terr_terr_pull0=Double.parseDouble(properties.getProperty(prefix+"terr_terr_pull0"));
if (properties.getProperty(prefix+"terr_veget_pull0")!= null) terr_veget_pull0=Double.parseDouble(properties.getProperty(prefix+"terr_veget_pull0")); if (properties.getProperty(prefix+"terr_veget_pull0")!= null) terr_veget_pull0=Double.parseDouble(properties.getProperty(prefix+"terr_veget_pull0"));
if (properties.getProperty(prefix+"terr_scenes_pull0")!= null) terr_scenes_pull0=Double.parseDouble(properties.getProperty(prefix+"terr_scenes_pull0"));
if (properties.getProperty(prefix+"terr_boost_parallax")!= null) terr_boost_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_boost_parallax")); if (properties.getProperty(prefix+"terr_boost_parallax")!= null) terr_boost_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_boost_parallax"));
if (properties.getProperty(prefix+"terr_max_parallax")!= null) terr_max_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_max_parallax")); if (properties.getProperty(prefix+"terr_max_parallax")!= null) terr_max_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_max_parallax"));
...@@ -4741,6 +4756,7 @@ min_str_neib_fpn 0.35 ...@@ -4741,6 +4756,7 @@ min_str_neib_fpn 0.35
imp.terr_min_split_frac = this.terr_min_split_frac; imp.terr_min_split_frac = this.terr_min_split_frac;
imp.terr_difference = this.terr_difference; imp.terr_difference = this.terr_difference;
imp.terr_pull_cold = this.terr_pull_cold; imp.terr_pull_cold = this.terr_pull_cold;
imp.terr_alpha_contrast = this.terr_alpha_contrast;
imp.terr_alpha_dflt = this.terr_alpha_dflt; imp.terr_alpha_dflt = this.terr_alpha_dflt;
imp.terr_alpha_loss = this.terr_alpha_loss; imp.terr_alpha_loss = this.terr_alpha_loss;
imp.terr_alpha_offset = this.terr_alpha_offset; imp.terr_alpha_offset = this.terr_alpha_offset;
...@@ -4756,6 +4772,7 @@ min_str_neib_fpn 0.35 ...@@ -4756,6 +4772,7 @@ min_str_neib_fpn 0.35
imp.terr_veget_lpf = this.terr_veget_lpf; imp.terr_veget_lpf = this.terr_veget_lpf;
imp.terr_terr_pull0 = this.terr_terr_pull0; imp.terr_terr_pull0 = this.terr_terr_pull0;
imp.terr_veget_pull0 = this.terr_veget_pull0; imp.terr_veget_pull0 = this.terr_veget_pull0;
imp.terr_scenes_pull0 = this.terr_scenes_pull0;
imp.terr_boost_parallax = this.terr_boost_parallax; imp.terr_boost_parallax = this.terr_boost_parallax;
imp.terr_max_parallax = this.terr_max_parallax; imp.terr_max_parallax = this.terr_max_parallax;
......
...@@ -6368,7 +6368,7 @@ public class OpticalFlow { ...@@ -6368,7 +6368,7 @@ public class OpticalFlow {
// int [] first_last = quadCLTs[ref_index].getFirstLastIndex(quadCLTs); // int [] first_last = quadCLTs[ref_index].getFirstLastIndex(quadCLTs);
QuadCLT [] quadCLT_tail = new QuadCLT [quadCLTs.length - earliest_scene]; QuadCLT [] quadCLT_tail = new QuadCLT [quadCLTs.length - earliest_scene];
System.arraycopy(quadCLTs, earliest_scene, quadCLT_tail, 0, quadCLT_tail.length); System.arraycopy(quadCLTs, earliest_scene, quadCLT_tail, 0, quadCLT_tail.length);
VegetationModel.test_vegetation( VegetationModel.prepareVegetationData(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
quadCLT_tail, // QuadCLT [] quadCLTs, quadCLT_tail, // QuadCLT [] quadCLTs,
ref_index-earliest_scene, // int ref_index, ref_index-earliest_scene, // int ref_index,
......
...@@ -8786,6 +8786,27 @@ ImageDtt.startAndJoin(threads); ...@@ -8786,6 +8786,27 @@ ImageDtt.startAndJoin(threads);
* @return data array made of input data with replaced NaN limited by * @return data array made of input data with replaced NaN limited by
* optional prohibit array and amount of growth. * optional prohibit array and amount of growth.
*/ */
public static double [] fillNaNs(
final double [] data,
final boolean [] prohibit,
int width,
final int grow,
double diagonal_weight, // relative to ortho
int num_passes,
final double max_rchange) // = 0.01
{
return fillNaNs(
data, // final double [] data,
null, // final double [] data_nan,
prohibit, // final boolean [] prohibit_in,
width, // int width,
grow, // final int grow,
diagonal_weight, //double diagonal_weight, // relative to ortho
num_passes, // int num_passes,
max_rchange, // final double max_rchange, // = 0.01
ImageDtt.THREADS_MAX); // final int threadsMax)
}
public static double [] fillNaNs( public static double [] fillNaNs(
final double [] data, final double [] data,
final boolean [] prohibit, final boolean [] prohibit,
......
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