Commit b3ad74ea authored by Andrey Filippov's avatar Andrey Filippov

restored loading initial LMA parameters from the previously saved ones

parent a8718162
......@@ -723,6 +723,9 @@ min_str_neib_fpn 0.35
public String terr_model_path = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/models/models_1697875868-1697879449-b/1697877487_245877/v35";
public String terr_model_state = "1697877487_245877-TERR-VEG-STATE";
public String terr_segments_dir = "sections";
public String terr_par_dir = ""; // directory path to intermediate parameters
public String terr_par_file = ""; // file name of the intermediate parameters
public boolean terr_par_restore = false; // restore parameters from file
// terrain/vegetation parameters
public boolean terr_um_en = true;
public double terr_um_sigma = 1.0;
......@@ -1993,9 +1996,13 @@ min_str_neib_fpn 0.35
gd.addTab("Vegetation","See through foliage parameters");
gd.addStringField ("Model path", terr_model_path, 120, "Model directory path with version.");
gd.addStringField ("Model state file", terr_model_state, 50, "Model vegetation source data (w/o extension).");
gd.addStringField ("Segments subdir", terr_segments_dir, 50, "Model vegetation source data (w/o extension).");
gd.addStringField ("Model path", terr_model_path, 120, "Model directory path with version.");
gd.addStringField ("Model state file", terr_model_state, 50, "Model vegetation source data (w/o extension).");
gd.addStringField ("Segments subdir", terr_segments_dir, 50,"Model vegetation source data (w/o extension).");
gd.addStringField ("Restore directory", terr_par_dir, 120, "Directory to resore initial parameters from.");
gd.addStringField ("Restore file", terr_par_file, 120, "Filename to resore initial parameters from.");
gd.addCheckbox ("Restore parameters", terr_par_restore, "Restore initial parameters from file before running LMA.");
gd.addMessage ("Unsharp mask filter of the input data (currently not used as both DC and HF fitting are implemented simultaneously).");
gd.addCheckbox ("Enable UM", terr_um_en, "Enable unsharp mask filter.");
......@@ -2717,19 +2724,24 @@ min_str_neib_fpn 0.35
terr_model_path = gd.getNextString();
terr_model_state = gd.getNextString();
terr_segments_dir = gd.getNextString();
terr_um_en = gd.getNextBoolean();// boolean
terr_um_sigma = gd.getNextNumber();// double
terr_um_weight = gd.getNextNumber();// double
terr_nan_tolerance = gd.getNextNumber();// double
terr_nan_grow = (int) gd.getNextNumber();// int
terr_shrink_veget = (int) gd.getNextNumber();// int
terr_shrink_terrain =(int) gd.getNextNumber();// int
terr_vegetation_over = gd.getNextNumber();// double
terr_filter_veget = (int) gd.getNextNumber();// int
terr_tile_woi = gd.getNextBoolean();// boolean
terr_continue = gd.getNextBoolean();// boolean
terr_par_dir = gd.getNextString();
terr_par_file = gd.getNextString();
terr_par_restore = gd.getNextBoolean(); // boolean
terr_um_en = gd.getNextBoolean(); // boolean
terr_um_sigma = gd.getNextNumber(); // double
terr_um_weight = gd.getNextNumber(); // double
terr_nan_tolerance = gd.getNextNumber(); // double
terr_nan_grow = (int) gd.getNextNumber(); // int
terr_shrink_veget = (int) gd.getNextNumber(); // int
terr_shrink_terrain =(int) gd.getNextNumber(); // int
terr_vegetation_over = gd.getNextNumber(); // double
terr_filter_veget = (int) gd.getNextNumber(); // int
terr_tile_woi = gd.getNextBoolean(); // boolean
terr_continue = gd.getNextBoolean(); // boolean
terr_woi_enclos = stringToRectangle(gd.getNextString());// Rectangle
terr_woi_step = stringToRectangle(gd.getNextString());// Rectangle
terr_woi_last = stringToRectangle(gd.getNextString());// Rectangle
......@@ -3395,6 +3407,10 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"terr_model_state", terr_model_state+""); // String
properties.setProperty(prefix+"terr_segments_dir", terr_segments_dir+""); // String
properties.setProperty(prefix+"terr_par_dir", terr_par_dir+""); // String
properties.setProperty(prefix+"terr_par_file", terr_par_file+""); // String
properties.setProperty(prefix+"terr_par_restore", terr_par_restore+""); // boolean
properties.setProperty(prefix+"terr_um_en", terr_um_en+""); // boolean
properties.setProperty(prefix+"terr_um_sigma", terr_um_sigma+""); // double
properties.setProperty(prefix+"terr_um_weight", terr_um_weight+""); // double
......@@ -4094,6 +4110,10 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"terr_model_path")!= null) terr_model_path=(String) properties.getProperty(prefix+"terr_model_path");
if (properties.getProperty(prefix+"terr_model_state")!= null) terr_model_state=(String) properties.getProperty(prefix+"terr_model_state");
if (properties.getProperty(prefix+"terr_segments_dir")!= null) terr_segments_dir=(String) properties.getProperty(prefix+"terr_segments_dir");
if (properties.getProperty(prefix+"terr_par_dir")!= null) terr_par_dir=(String) properties.getProperty(prefix+"terr_par_dir");
if (properties.getProperty(prefix+"terr_par_file")!= null) terr_par_file=(String) properties.getProperty(prefix+"terr_par_file");
if (properties.getProperty(prefix+"terr_par_restore")!= null) terr_par_restore=Boolean.parseBoolean(properties.getProperty(prefix+"terr_par_restore"));
if (properties.getProperty(prefix+"terr_um_en")!= null) terr_um_en=Boolean.parseBoolean(properties.getProperty(prefix+"terr_um_en"));
if (properties.getProperty(prefix+"terr_um_sigma")!= null) terr_um_sigma=Double.parseDouble(properties.getProperty(prefix+"terr_um_sigma"));
......@@ -4762,6 +4782,10 @@ min_str_neib_fpn 0.35
imp.terr_model_state = this. terr_model_state;
imp.terr_segments_dir = this. terr_segments_dir;
imp.terr_par_dir = this. terr_par_dir;
imp.terr_par_file = this. terr_par_file;
imp.terr_par_restore = this.terr_par_restore;
imp.terr_um_en = this.terr_um_en;
imp.terr_um_sigma = this.terr_um_sigma;
imp.terr_um_weight = this.terr_um_weight;
......
......@@ -3,10 +3,12 @@ package com.elphel.imagej.vegetation;
import java.awt.Rectangle;
public class VegetationSegment {
public Rectangle woi_veg;
public Rectangle woi;
public double [] scene_offsets;
public double [][] tva;
public VegetationSegment(
Rectangle woi_veg,
Rectangle woi,
double [] scene_offsets, // has NaNs
double [][] tva) {
......
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