Commit 5fb0ddfb authored by Andrey Filippov's avatar Andrey Filippov

More debugging

parent b7758748
......@@ -129,6 +129,7 @@ import com.elphel.imagej.tileprocessor.SymmVector;
import com.elphel.imagej.tileprocessor.TwoQuadCLT;
import com.elphel.imagej.tileprocessor.lwoc.LwirWorld;
import com.elphel.imagej.vegetation.VegetationModel;
import com.elphel.imagej.vegetation.VegetationSegment;
import ij.CompositeImage;
import ij.IJ;
......@@ -863,6 +864,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton("Process Merged", panelOrange, color_process);
addButton("Vegetation LMA", panelOrange, color_process);
addButton("Combine LMA Segments", panelOrange, color_process);
addButton("Generate LWIR target", panelOrange, color_process);
plugInFrame.add(panelOrange);
}
plugInFrame.pack();
......@@ -5805,6 +5807,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
SYNC_COMMAND, // // SyncCommand SYNC_COMMAND,
CLT_PARAMETERS, //CLTParameters clt_parameters,
true); //boolean combine_segments);
} else if (label.equals("Generate LWIR target")) {
VegetationSegment.generateSineTarget();
}
//
}
......
......@@ -871,8 +871,8 @@ min_str_neib_fpn 0.35
public double terr_rms_diff = 1e-8; // 0.0001; virtually forever
public int terr_last_series = -1; // Last LMA adjustment series (<0 - to the terr_num_iters.length -1)
public int [] terr_num_iters = {30}; //sequence on numbers of iterations
public boolean terr_only_special = true; // special sequences for terrain-only tiles
public boolean terr_only_pix = true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
/// public boolean terr_only_special = true; // special sequences for terrain-only tiles
/// public boolean terr_only_pix = true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
public int terr_only_series = -1; // similar to terr_last_series but for terrain-only mode (<0 - length of terr_only_num_iters)
public int [] terr_only_num_iters = {25}; // number of iterations
......@@ -2246,8 +2246,8 @@ min_str_neib_fpn 0.35
gd.addStringField ("Maximal iterations", intsToString(terr_num_iters), 40, "Maximal number of LMA iterations per series, 1 or several values.");
gd.addMessage ("Terrain-only LMA");
gd.addCheckbox ("Terrain-only mode", terr_only_special, "Treat terrain-only tiles differently (below).");
gd.addCheckbox ("Adjust pixel elevation",terr_only_pix, "Force per-pixel terrain elevation adjustment in terrain-only mode.");
/// gd.addCheckbox ("Terrain-only mode", terr_only_special, "Treat terrain-only tiles differently (below).");
/// gd.addCheckbox ("Adjust pixel elevation",terr_only_pix, "Force per-pixel terrain elevation adjustment in terrain-only mode.");
gd.addNumericField("Terrain-only iterations",terr_only_series, 0,3,"", "Last LMA series in terrain-only mode, -1 - to last available in the sequence below.");
gd.addStringField ("Maximal iterations", intsToString(terr_only_num_iters), 40, "Maximal number of LMA iterations per series, 1 or several values.");
......@@ -3041,8 +3041,8 @@ min_str_neib_fpn 0.35
terr_last_series = (int) gd.getNextNumber();// int
terr_num_iters = StringToInts(gd.getNextString());
terr_only_special = gd.getNextBoolean();// boolean
terr_only_pix = gd.getNextBoolean();// boolean
/// terr_only_special = gd.getNextBoolean();// boolean
/// terr_only_pix = gd.getNextBoolean();// boolean
terr_only_series = (int) gd.getNextNumber();// int
terr_only_num_iters = StringToInts(gd.getNextString());
......@@ -3811,8 +3811,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"terr_last_series", terr_last_series+""); // int
properties.setProperty(prefix+"terr_num_iters", intsToString(terr_num_iters)+""); // int []
properties.setProperty(prefix+"terr_only_special", terr_only_special+""); // boolean
properties.setProperty(prefix+"terr_only_pix", terr_only_pix+""); // boolean
/// properties.setProperty(prefix+"terr_only_special", terr_only_special+""); // boolean
/// properties.setProperty(prefix+"terr_only_pix", terr_only_pix+""); // boolean
properties.setProperty(prefix+"terr_only_series", terr_only_series+""); // int
properties.setProperty(prefix+"terr_only_num_iters", intsToString(terr_only_num_iters)+""); // int []
......@@ -4596,8 +4596,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"terr_num_iter")!= null) terr_num_iters=new int[] {Integer.parseInt(properties.getProperty(prefix+"terr_num_iter"))};
if (properties.getProperty(prefix+"terr_num_iters")!= null) terr_num_iters=StringToInts((String) properties.getProperty(prefix+"terr_num_iters"));
if (properties.getProperty(prefix+"terr_only_special")!= null) terr_only_special=Boolean.parseBoolean(properties.getProperty(prefix+"terr_only_special"));
if (properties.getProperty(prefix+"terr_only_pix")!= null) terr_only_pix=Boolean.parseBoolean(properties.getProperty(prefix+"terr_only_pix"));
/// if (properties.getProperty(prefix+"terr_only_special")!= null) terr_only_special=Boolean.parseBoolean(properties.getProperty(prefix+"terr_only_special"));
/// if (properties.getProperty(prefix+"terr_only_pix")!= null) terr_only_pix=Boolean.parseBoolean(properties.getProperty(prefix+"terr_only_pix"));
if (properties.getProperty(prefix+"terr_only_series")!= null) terr_only_series=Integer.parseInt(properties.getProperty(prefix+"terr_only_series"));
if (properties.getProperty(prefix+"terr_only_num_iters")!= null) terr_only_num_iters=StringToInts((String) properties.getProperty(prefix+"terr_only_num_iters"));
......@@ -5344,8 +5344,8 @@ min_str_neib_fpn 0.35
imp.terr_last_series = this.terr_last_series;
imp.terr_num_iters = this.terr_num_iters.clone();
imp.terr_only_special = this.terr_only_special;
imp.terr_only_pix = this.terr_only_pix;
/// imp.terr_only_special = this.terr_only_special;
/// imp.terr_only_pix = this.terr_only_pix;
imp.terr_only_series = this.terr_only_series;
imp.terr_only_num_iters = this.terr_only_num_iters.clone();
......
......@@ -1584,9 +1584,9 @@ public class VegetationModel {
fits_disable[i] = clt_parameters.imp.terr_fits_disable[i].clone();
}
boolean [][] terr_only_fits_disable = new boolean[clt_parameters.imp.terr_only_fits_disable.length][];
for (int i = 0; i < terr_only_fits_disable.length; i++) {
terr_only_fits_disable[i] = clt_parameters.imp.terr_only_fits_disable[i].clone();
boolean [][] fits_disable_terronly = new boolean[clt_parameters.imp.terr_only_fits_disable.length][];
for (int i = 0; i < fits_disable_terronly.length; i++) {
fits_disable_terronly[i] = clt_parameters.imp.terr_only_fits_disable[i].clone();
}
double reg_weights = clt_parameters.imp.terr_reg_weights; // 0.25; // fraction of the total weight used for regularization
......@@ -1599,8 +1599,8 @@ public class VegetationModel {
int last_series = clt_parameters.imp.terr_last_series; // -1; // 100;
if (last_series < 0) last_series = num_iters.length - 1;
boolean terr_only_special = clt_parameters.imp.terr_only_special; // true; // special sequences for terrain-only tiles
boolean terr_only_pix = clt_parameters.imp.terr_only_pix; // true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
/// boolean terr_only_special = clt_parameters.imp.terr_only_special; // true; // special sequences for terrain-only tiles
/// boolean terr_only_pix = clt_parameters.imp.terr_only_pix; // true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
int terr_only_series = clt_parameters.imp.terr_only_series; // -1; // similar to terr_last_series but for terrain-only mode (<0 - length of terr_only_num_iters)
int [] terr_only_num_iters=clt_parameters.imp.terr_only_num_iters; // {25}; // number of iterations
if (terr_only_series < 0) terr_only_series = terr_only_num_iters.length - 1;
......@@ -2143,7 +2143,8 @@ public class VegetationModel {
fit_elevations, // final boolean adjust_elevations,
fit_terr_elev, // final boolean fit_terr_elev,
fit_terr_elev_pix, // final boolean fit_terr_elev_pix,
thisOrLast(step_restore, fits_disable), // fits_disables[0], // final boolean [] fit_disable,
thisOrLast(step_restore, fits_disable), // fits_disables[0], // final boolean [] fit_disable,
thisOrLast(step_restore, fits_disable_terronly),// final boolean [] fits_disable_terronly,
reg_weights, // final double reg_weights, // fraction of the total weight used for regularization
alpha_loss, // final double alpha_loss, // alpha quadratic growing loss for when out of [0,1] range
alpha_loss_lin, // final double alpha_loss_lin, // alpha linear growing loss for when out of [0,1] range and below minimal vegetation alpha
......@@ -2190,8 +2191,8 @@ public class VegetationModel {
ttop_rel_rad, // final double ttop_rel_rad, // 0.25; // Relative (to the top height) sample ring radius
ttop_frac, // final double ttop_frac, // 0.5; // Minimal fraction of the ring pixels below sample level
ttop_rem_rad, // final double ttop_rem_rad, // 0.25; // Relative (to the top height) remove transparency radius
terr_only_special,// final boolean terr_only_special,//true; // special sequences for terrain-only tiles
terr_only_pix, // final boolean terr_only_pix, //true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
/// terr_only_special,// final boolean terr_only_special,//true; // special sequences for terrain-only tiles
/// terr_only_pix, // final boolean terr_only_pix, //true; // force per-pixel terrain elevation in terrain-only mode, overwrite fits_disable[TVAO_TERR_ELEV_PIX]
boost_parallax, // final double boost_parallax, // increase weight of scene with maximal parallax relative to the reference scene
max_parallax, //final double max_parallax, // do not consider maximal parallax above this (consider it a glitch)
debugLevel, // final int debugLevel);
......@@ -2204,7 +2205,7 @@ public class VegetationModel {
continue;
}
/// Handle terrain-only tiles
if ((vegetationLMA.getWoiVeg() == null) && terr_only_special) {
if (vegetationLMA.getWoiVeg() == null) {// && terr_only_special) {
last_series = terr_only_series;
num_iters = terr_only_num_iters;
}
......@@ -2329,9 +2330,13 @@ public class VegetationModel {
}
step_restore++;
for (; step_restore <= last_series; step_restore++) {
// vegetationLMA.fits_disable[VegetationLMA.TVAO_ELEVATION] = fits_disable[step_restore][VegetationLMA.TVAO_ELEVATION];
vegetationLMA.fits_disable[VegetationLMA.TVAO_ELEVATION] =thisOrLast(step_restore,fits_disable)[VegetationLMA.TVAO_ELEVATION];
vegetationLMA.fits_disable[VegetationLMA.TVAO_TERR_ELEV] =thisOrLast(step_restore,fits_disable)[VegetationLMA.TVAO_TERR_ELEV];
for (int i = 0; i < VegetationLMA.TVAO_TYPES; i++) {
vegetationLMA.fits_disable[i] = thisOrLast(step_restore,fits_disable)[i];
}
/// vegetationLMA.fits_disable[VegetationLMA.TVAO_ELEVATION] = thisOrLast(step_restore,fits_disable)[VegetationLMA.TVAO_ELEVATION];
/// vegetationLMA.fits_disable[VegetationLMA.TVAO_TERR_ELEV] = thisOrLast(step_restore,fits_disable)[VegetationLMA.TVAO_TERR_ELEV];
/// vegetationLMA.fits_disable[VegetationLMA.TVAO_TERR_ELEV_PIX] =thisOrLast(step_restore,fits_disable)[VegetationLMA.TVAO_TERR_ELEV_PIX];
vegetationLMA.fits_disable[VegetationLMA.TVAO_TERR_ELEV] |= !vegetationLMA.fits_disable[VegetationLMA.TVAO_TERR_ELEV_PIX];
if (thisOrLast(step_restore,recalc_weights)) {
System.out.println ("---- Recalculating weights from transparency");
String dbg_title= (!tile_woi && (debugLevel > -2)) ? ("transparency_"+step_restore) : null;
......
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