publicdoubleterr_elev_pull0=1.0;// pull elevation to initial (pre-adjustment) values
publicdoubleterr_elev_pull0=1.0;// pull elevation to initial (pre-adjustment) values
publicbooleanterr_elev_alpha_en=false;// Enable loss for low vegetation with high opacity
publicbooleanterr_elev_alpha_en=false;// Enable loss for low vegetation with high opacity
...
@@ -2054,6 +2056,7 @@ min_str_neib_fpn 0.35
...
@@ -2054,6 +2056,7 @@ min_str_neib_fpn 0.35
gd.addStringField("Model path",terr_model_path,120,"Model directory path with version.");
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("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("Segments subdir",terr_segments_dir,50,"Model vegetation source data (w/o extension).");
gd.addStringField("Segments suffix",terr_segments_suffix,50,"suffix to select from multiple versions (w/o \".par-tiff\".");
gd.addStringField("Restore directory",terr_par_dir,120,"Directory to resore initial parameters from.");
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.addStringField("Restore file",terr_par_file,120,"Filename to resore initial parameters from.");
...
@@ -2138,7 +2141,8 @@ min_str_neib_fpn 0.35
...
@@ -2138,7 +2141,8 @@ 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("Elevation diffusion",terr_elev_lpf,5,7,"","LPF for elevation pixels (diffusion to 4 neighbors).");
gd.addNumericField("Elevation diffusion",terr_elev_lpf,5,7,"","LPF for elevation pixels (diffusion to 4 neighbors).");
gd.addNumericField("Terrain pull",terr_terr_pull0,5,7,"","Terrain pixels pull to initial (pre-adjustment) values.");
gd.addNumericField("Terrain pull",terr_terr_pull0,5,7,"","Terrain pixels pull to initial (pre-adjustment) values.");
gd.addNumericField("Terrain pull up",terr_terr_pull_up,5,7,"","Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial.");
gd.addNumericField("Terrain pull up",terr_terr_pull_up,5,7,"","Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial (<0 - sqme as above).");
gd.addNumericField("Terrain pull to average",terr_terr_pull_avg,5,7,"","Pull terrain to the initial offset by the average offset of all terrain pixels.");
@@ -1454,7 +1456,8 @@ public class VegetationModel {
...
@@ -1454,7 +1456,8 @@ public class VegetationModel {
booleantile_woi=clt_parameters.imp.terr_tile_woi;// scan woi_enclosing, false - run a single woi_last
// boolean
tile_woi=clt_parameters.imp.terr_tile_woi;// scan woi_enclosing, false - run a single woi_last
Rectanglewoi_enclosing=clt_parameters.imp.terr_woi_enclos;// new Rectangle(0, 0, 200, 160); // will be tiled, using width/height from woi_step;
Rectanglewoi_enclosing=clt_parameters.imp.terr_woi_enclos;// new Rectangle(0, 0, 200, 160); // will be tiled, using width/height from woi_step;
Rectanglewoi_step=clt_parameters.imp.terr_woi_step;// new Rectangle(10,10,20,20);
Rectanglewoi_step=clt_parameters.imp.terr_woi_step;// new Rectangle(10,10,20,20);
Rectanglewoi_last=clt_parameters.imp.terr_woi_last;// new Rectangle(160,310,20,20); // 170
Rectanglewoi_last=clt_parameters.imp.terr_woi_last;// new Rectangle(160,310,20,20); // 170
...
@@ -1500,7 +1503,8 @@ public class VegetationModel {
...
@@ -1500,7 +1503,8 @@ public class VegetationModel {
doubleveget_lpf=clt_parameters.imp.terr_veget_lpf;// 0.2; //0.15; /// 0.2; //// 0.01; /// 0.1; // pull vegetation to average of 4 neighbors (very small - maybe not needed)
doubleveget_lpf=clt_parameters.imp.terr_veget_lpf;// 0.2; //0.15; /// 0.2; //// 0.01; /// 0.1; // pull vegetation to average of 4 neighbors (very small - maybe not needed)
doubleterr_pull0=clt_parameters.imp.terr_terr_pull0;// 0.1; //0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.2; /// 0.1; //pull terrain to zero (makes sense with UM
doubleterr_pull0=clt_parameters.imp.terr_terr_pull0;// 0.1; //0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.2; /// 0.1; //pull terrain to zero (makes sense with UM
doubleterr_pull_up=clt_parameters.imp.terr_terr_pull_up;// 0.2; //Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial.
doubleterr_pull_up=clt_parameters.imp.terr_terr_pull_up;// 0.2; // Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial.
doubleterr_pull_avg=clt_parameters.imp.terr_terr_pull_avg;// 0.1; // Pull terrain to the initial offset by the average offset of all terrain pixels
doubleveget_pull0=clt_parameters.imp.terr_veget_pull0;// 0.05; //0.1; // 0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.1; // pull vegetation to zero (makes sense with UM
doubleveget_pull0=clt_parameters.imp.terr_veget_pull0;// 0.05; //0.1; // 0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.1; // pull vegetation to zero (makes sense with UM
@@ -2060,15 +2066,7 @@ public class VegetationModel {
...
@@ -2060,15 +2066,7 @@ public class VegetationModel {
}else{
}else{
System.out.println("===== Will process a single WOI ("+woi.x+", "+woi.y+", "+woi.width+", "+woi.height+").");
System.out.println("===== Will process a single WOI ("+woi.x+", "+woi.y+", "+woi.width+", "+woi.height+").");
}
}
/*
boolean [][] fits_disables = new boolean [num_iters.length][];
for (int i = 0; i <fits_disables.length; i++) {
fits_disables[i] = fit_disable.clone();
}
if (!par_restore && (fits_disables.length > 1)) {
fits_disables[0][VegetationLMA.TVAO_ELEVATION] = true; // disable elevation adjustment for the first run
}
*/
intnum_samples=vegetationLMA.prepareLMA(
intnum_samples=vegetationLMA.prepareLMA(
false,// final boolean keep_parameters,
false,// final boolean keep_parameters,
woi,// final Rectangle woi,
woi,// final Rectangle woi,
...
@@ -2094,7 +2092,7 @@ public class VegetationModel {
...
@@ -2094,7 +2092,7 @@ public class VegetationModel {
alpha_scale_avg,// final double alpha_scale_avg, // = 1.2; // scale average alpha (around 0.5) when pulling to it
alpha_scale_avg,// final double alpha_scale_avg, // = 1.2; // scale average alpha (around 0.5) when pulling to it
alpha_push,// final double alpha_push, // 5.0; // push from alpha==0.5
alpha_push,// final double alpha_push, // 5.0; // push from alpha==0.5
alpha_push_neutral,// double alpha_push_neutral = 0.8; // alpha point from which push (closer to opaque)
alpha_push_neutral,// double alpha_push_neutral = 0.8; // alpha point from which push (closer to opaque)
alpha_push_center,// final double alpha_push_center,// 1.5; // weight of center alpha pixel relative to each of the 4 ortho ones
alpha_push_center,// final double alpha_push_center,// 1.5; // weight of center alpha pixel relative to each of the 4 ortho ones
alpha_en_holes,// final boolean alpha_en_holes, // Search for small semi-transparent holes, disable diffusion of local alpha minimums
alpha_en_holes,// final boolean alpha_en_holes, // Search for small semi-transparent holes, disable diffusion of local alpha minimums
alpha_mm_hole,// double alpha_mm_hole = 0.1; // NaN to disable. Local "almost minimum" (lower than this fraction between min and max neighbor) is not subject to alpha_lpf
alpha_mm_hole,// double alpha_mm_hole = 0.1; // NaN to disable. Local "almost minimum" (lower than this fraction between min and max neighbor) is not subject to alpha_lpf
terr_lpf,// final double terr_lpf, // pull terrain to average of 4 neighbors (very small)
terr_lpf,// final double terr_lpf, // pull terrain to average of 4 neighbors (very small)
...
@@ -2102,6 +2100,7 @@ public class VegetationModel {
...
@@ -2102,6 +2100,7 @@ public class VegetationModel {
elevation_lpf,// final double elevation_lpf,
elevation_lpf,// final double elevation_lpf,
terr_pull0,// final double terr_pull0, // pull terrain to initial (pre-adjustment) values
terr_pull0,// final double terr_pull0, // pull terrain to initial (pre-adjustment) values
terr_pull_up,// final double terr_pull_up, // Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial.
terr_pull_up,// final double terr_pull_up, // Terrain pixels pull to initial (pre-adjustment) values when it is colder than initial.
terr_pull_avg,// final double terr_pull_avg, // pull terrain to the initial offset by the average offset of all terrain pixels
veget_pull0,// final double veget_pull0, // pull vegetation to initial (pre-adjustment) values
veget_pull0,// final double veget_pull0, // pull vegetation to initial (pre-adjustment) values
elev_pull0,// final double elev_pull0, // pull elevation to initial (pre-adjustment) values
elev_pull0,// final double elev_pull0, // pull elevation to initial (pre-adjustment) values
elev_alpha_en,// final boolean elev_alpha_en, // false; // Enable loss for low vegetation with high opacity
elev_alpha_en,// final boolean elev_alpha_en, // false; // Enable loss for low vegetation with high opacity
...
@@ -2136,7 +2135,7 @@ public class VegetationModel {
...
@@ -2136,7 +2135,7 @@ public class VegetationModel {
continue;
continue;
}
}
}
}
intnum_iter=num_iters[step_restore];
intnum_iter=num_iters[step_restore];//
if(par_restore){// always use last number of iterations - not anymore
if(par_restore){// always use last number of iterations - not anymore
par_path=parameters_dir;
par_path=parameters_dir;
if(!par_path.endsWith(Prefs.getFileSeparator())){
if(!par_path.endsWith(Prefs.getFileSeparator())){
...
@@ -2147,10 +2146,11 @@ public class VegetationModel {
...
@@ -2147,10 +2146,11 @@ public class VegetationModel {
vegetationLMA.restoreParametersFile(//FIXME: Not finished for real import !
vegetationLMA.restoreParametersFile(//FIXME: Not finished for real import !
par_path,// String path,
par_path,// String path,
true,// boolean keep_settings,
true,// boolean keep_settings,
null);// Rectangle [] file_wois); // if not null, should be Rectangle[2] {woi_veg,woi} - will return woi data and not input parameters to this instance
null,// Rectangle [] file_wois); // if not null, should be Rectangle[2] {woi_veg,woi} - will return woi data and not input parameters to this instance
null);// double [] other_pars)
if(thisOrLast(step_restore,recalc_weights)){
if(thisOrLast(step_restore,recalc_weights)){
System.out.println("---- Recalculating weights from transparency after loading parameters");
System.out.println("---- Recalculating weights from transparency after loading parameters");