publicbooleanterr_continue=false;// start from last/single
publicintterr_min_scenes=1;// minimal number of scenes (inside woi) vegetation pixel must influence
publicdoubleterr_alpha_dflt=0.5;
publicdoubleterr_alpha_loss=100.0;
publicdoubleterr_alpha_offset=0.0;
publicdoubleterr_alpha_lpf=2.5;// pull to average of 4 neighbors
publicbooleanterr_alpha_piece_linear=true;
publicdoubleterr_alpha_scale_avg=1.0;// scale average alpha (around 0.5) when pulling to it
publicdoubleterr_alpha_push=12;// push from alpha==0.5
publicdoubleterr_alpha_push_neutral=0.5;// alpha point from which push (closer to opaque)
publicdoubleterr_alpha_weight_center=1.5;// weight of center alpha pixel relative to each of the 4 ortho ones
publicdoubleterr_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
publicdoubleterr_terr_lpf=0.1;// pull terrain to average of 4 neighbors (very small)
publicdoubleterr_veget_lpf=0.2;// pull vegetation to average of 4 neighbors (very small - maybe not needed)
publicdoubleterr_terr_pull0=0.05;// pull terrain to zero (makes sense with UM
publicdoubleterr_veget_pull0=0.05;// pull vegetation to zero (makes sense with UM
// LMA parameters
publicdoubleterr_boost_parallax=3.0;//
publicdoubleterr_reg_weights=0.25;// fraction of the total weight used for regularization
gd.addNumericField("Scale alpha",terr_alpha_scale_avg,5,7,"","Scale target (average of neighbors) alpha before pulling to it (not used now).");
gd.addNumericField("Push alpha",terr_alpha_push,5,7,"","Quadratic loss for middle alpha (push to 0.0 or 1.0.");
gd.addNumericField("Neutral alpha",terr_alpha_push_neutral,5,7,"","Alpha point from which to push (default 0.5).");
gd.addNumericField("Alpha center weight",terr_alpha_weight_center,5,7,"","Weight of center alpha pixel relative to each of the 4 ortho ones.");
gd.addNumericField("Alpha MM fraction",terr_alpha_mm_hole,5,7,"","Disable diffusion for local \"almost minimum\" (lower than this fraction between min and max neighbors).");
gd.addNumericField("Terrain diffusion",terr_terr_lpf,5,7,"","LPF for terrain 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("Vegetation pull zero",terr_veget_pull0,5,7,"","Vegetation pixels pull to 0 (makes sense with UM).");
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("Losses weight",terr_reg_weights,5,7,"","Fraction of other losses compared to the RMSE.");
// Testing vegetation, for debugging supposing that terrain layer is already set in *-INTER-INTRA-LMA.tiff - normally it is only set during 3d model generation
// Testing vegetation, for debugging supposing that terrain layer is already set in *-INTER-INTRA-LMA.tiff - normally it is only set during 3d model generation
// Moved to the very end, after 3D
booleantest_vegetation=true;
booleantest_vegetation=true;
/*
if (test_vegetation) { // limit start of the quadCLTs by reading start/end from the reference scene
if (test_vegetation) { // limit start of the quadCLTs by reading start/end from the reference scene
int [] first_last = quadCLTs[ref_index].getFirstLastIndex(quadCLTs);
QuadCLT [] quadCLT_tail = new QuadCLT [quadCLTs.length - earliest_scene];
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_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_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)
veget_lpf,// final double veget_lpf, // pull vegetation to average of 4 neighbors (very small - maybe not needed)
terr_pull0,// final double terr_pull0, // pull terrain to zero (makes sense with UM
veget_pull0,// final double veget_pull0, // pull vegetation to zero (makes sense with UM
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)
um_sigma,// final double um_sigma, // just use in debug image names
(um_en?um_weight:0.0),// final double um_weight,
par_path,// final String parameters_read_path,
debugLevel);// final int debugLevel);
if(num_samples<=0){
System.out.println("Insufficient data in this segment, skipping it.");
continue;
}
}
publicstaticvoidunsharpMaskMulti(
if(save_par_files&&skip_existing_woi){// check that segment already exists