publicdoubleterr_nan_tolerance=0.001;// set undefined terrain (out of capture area) to nan, it is almost zero after UM
publicdoubleterr_nan_tolerance=0.001;// set undefined terrain (out of capture area) to nan, it is almost zero after UM. if !terr_um_en will be forced ==0.0
publicintterr_nan_grow=20;// grow undefined terrain after detection
publicintterr_nan_grow=20;// grow undefined scenes terrain after detection
publicintterr_shrink_veget=20;// shrink accumulated vegetation for filling terrain
publicintterr_shrink_terrain=20;// shrink accumulated terrain after cutting shrunk vegetation (added to terr_shrink_veget)
publicdoubleterr_vegetation_over=35;// initial vegetation over (hotter) filled terrain
publicintterr_filter_veget=10;// shrink+grow shrunk vegetation to remove small clusters
publicbooleanterr_tile_woi=true;// if false - use woi50;
publicbooleanterr_tile_woi=true;// if false - use woi50;
publicRectangleterr_woi_enclos=newRectangle(80,210,210,230);// will be tiled, using width/height from woi_step;
publicRectangleterr_woi_enclos=newRectangle(80,210,210,230);// will be tiled, using width/height from woi_step;
gd.addNumericField("NaN tolerance",terr_nan_tolerance,5,7,"","Replace continuous almost zeros with NaN-s.");
gd.addNumericField("NaN grow",terr_nan_grow,0,3,"pix","Grow \"almost\" zero areas after detection (+2 - 8 directions, +1 - only ortho).");
gd.addMessage("Preparaion of the initial LMA approximation");
gd.addNumericField("NaN tolerance",terr_nan_tolerance,5,7,"","Replace continuous almost zeros with NaN-s (ignored and forced to 0 if no UM filter).");
gd.addNumericField("NaN grow",terr_nan_grow,0,3,"pix","Grow zero/\"almost\" zero rendered scene areas (+2 - 8 directions, +1 - only ortho), replace with NaNs.");
gd.addNumericField("Shrink vegetation",terr_shrink_veget,0,3,"pix","Shrink detected vegetation areas for terrain separation.");
gd.addNumericField("Shrink terrain",terr_shrink_terrain,0,3,"pix","Shrink remaining detected terrain areas before filling with laplacian (terr_shrink_veget is added to start from the original size).");
gd.addNumericField("Vegetation hotter",terr_vegetation_over,5,7,"","Initially consider to be vegetation if it is this hotter than filled in terrain holes.");
gd.addNumericField("Vegetation shrink+grow",terr_filter_veget,0,3,"pix","Shrink + grow hot enough vegetation to filter from small clusters - needed for initial alpha.");
gd.addMessage("Scan WOI parameters");
gd.addMessage("Scan WOI parameters");
gd.addCheckbox("Tiled WOI",terr_tile_woi,"Process tiled WOI (False - a single one).");
gd.addCheckbox("Tiled WOI",terr_tile_woi,"Process tiled WOI (False - a single one).");
...
@@ -1985,6 +2003,13 @@ min_str_neib_fpn 0.35
...
@@ -1985,6 +2003,13 @@ min_str_neib_fpn 0.35
gd.addCheckbox("Skip existing WOI",terr_skip_exist,"Skip already esisting WOIs during scanning.");
gd.addCheckbox("Skip existing WOI",terr_skip_exist,"Skip already esisting WOIs during scanning.");
gd.addMessage("LMA losses and goals for alpha, terrain and vegetation pixels");
gd.addMessage("LMA losses and goals for alpha, terrain and vegetation pixels");
publicstaticfinalintDATA_SOURCE_CORN_VEGET=1;// [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
publicstaticfinalintDATA_SOURCE_CORN_VEGET=1;// [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
// 1: [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
// 1: [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
...
@@ -95,28 +107,37 @@ public class VegetationLMA {
...
@@ -95,28 +107,37 @@ public class VegetationLMA {
privatedoubleweight_pure=0;
privatedoubleweight_pure=0;
privatedouble[]weights;// normalized so sum is 1.0 for all - samples and extra regularization
privatedouble[]weights;// normalized so sum is 1.0 for all - samples and extra regularization
publicbooleanstart_warm_veget=true;// start with vegetation warmer than terrain
publicbooleanstart_warm_veget=true;// start with vegetation warmer than terrain
publicdoubleterrain_warmest=90;// pull vegetations to warm, terrain to cold
publicdoubleterrain_warmest=90;// pull vegetations to warm, terrain to cold
publicdoubleinitial_split=0.1;// pull vegetations to warm, terrain to cold
publicdoubleinitial_split=0.1;// pull vegetations to warm, terrain to cold
publicdoublemin_split_frac=0.15;// minimal modality fraction to use split by temperature
publicdoublemin_split_frac=0.15;// minimal modality fraction to use split by temperature
publicdoubleterr_difference=100;// pull vegetation to be this warmer
publicdoubleterr_difference=100;// pull vegetation to be this warmer
publicdoubleterr_pull_cold=0;// pull vegetations to warm, terrain to cold
publicdoubleterr_pull_cold=0;// pull vegetations to warm, terrain to cold
// next two just for saving?
// next two just for saving?
publicdoublehifreq_weight;// 22.5 0 - do not use high-freq. Relative weight of laplacian components
publicdoublehifreq_weight;// 22.5 0 - do not use high-freq. Relative weight of laplacian components
publicdoublereg_weights;// fraction of the total weight used for regularization
publicdoublereg_weights;// fraction of the total weight used for regularization
publicdoublealpha_loss=0;// not used with cosine alpha
publicboolean[]fits;
publicdoublealpha_offset=0;// if >0, start losses above 0.0 and below 1.0;
/*
publicdoublealpha_lpf=0;
public boolean fit_terr = true;
public boolean fit_veget = true;
public boolean fit_alpha = true;
public boolean fit_scenes = true;
public boolean fit_elevations = false;
*/
publicdoublealpha_loss=0;// not used with cosine alpha
publicdoublealpha_offset=0;// if >0, start losses above 0.0 and below 1.0;
publicdoublealpha_lpf=0;
publicbooleanalpha_piece_linear=true;
publicbooleanalpha_piece_linear=true;
publicdoublealpha_scale_avg=1.0;// 1.1; // scale average alpha (around 0.5) when pulling to it
publicdoublealpha_scale_avg=1.0;// 1.1; // scale average alpha (around 0.5) when pulling to it
publicdoublealpha_push=12.0;// push from alpha==0.5
publicdoublealpha_push=12.0;// push from alpha==0.5
publicdoublealpha_push_neutral=0.8;// alpha point from which push (closer to opaque)
publicdoublealpha_push_neutral=0.8;// alpha point from which push (closer to opaque)
publicdoublealpha_push_center=1.5;// weight of center alpha pixel relative to each of the 4 ortho ones
publicdoublealpha_push_center=1.5;// weight of center alpha pixel relative to each of the 4 ortho ones
publicdoublealpha_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
publicdoublealpha_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
publicbooleanalpha_en_holes=true;// Search for small semi-transparent holes, disable diffusion of local alpha minimums
publicbooleanalpha_en_holes=true;// Search for small semi-transparent holes, disable diffusion of local alpha minimums
publicdoublealpha_diff_hole=0.01;// minimal alpha difference between min and max neighbor to be considered a hole
publicdoublealpha_diff_hole=0.01;// minimal alpha difference between min and max neighbor to be considered a hole
publicbooleanfrom_file=false;
publicbooleanfrom_file=false;
...
@@ -126,8 +147,8 @@ public class VegetationLMA {
...
@@ -126,8 +147,8 @@ public class VegetationLMA {
publicdoubleveget_lpf=0;
publicdoubleveget_lpf=0;
// when unsharp mask is applied , pulling to 0 (when alpha is 0 (for vegetation) or 1.0 (for terrain) makes sense
// when unsharp mask is applied , pulling to 0 (when alpha is 0 (for vegetation) or 1.0 (for terrain) makes sense
publicdoubleterr_pull0=0;
publicdoubleterr_pull0=0;// now - pull to filled terrain - terrain_average
publicdoubleveget_pull0=0;
publicdoubleveget_pull0=0;// now - pull to vegetation_pull (extended vegetation)
publicdoubleboost_parallax=1;
publicdoubleboost_parallax=1;
...
@@ -174,14 +195,16 @@ public class VegetationLMA {
...
@@ -174,14 +195,16 @@ public class VegetationLMA {
dsrc[DATA_SOURCE_HEAD][DATA_SOURCE_HEAD_SINDEX]=ind_pars_scenes+used_scene_indices[dsrc[DATA_SOURCE_HEAD][DATA_SOURCE_HEAD_SINDEX]];// replace scene number with the corresponding parameter index
if(used_index>=0){
used_index+=ind_pars_scenes;
}
dsrc[DATA_SOURCE_HEAD][DATA_SOURCE_HEAD_SINDEX]=used_index;// ind_pars_scenes + used_scene_indices[dsrc[DATA_SOURCE_HEAD][DATA_SOURCE_HEAD_SINDEX]]; // replace scene number with the corresponding parameter index
doublehifreq_weight=clt_parameters.imp.terr_hifreq_weight;// 22.5; // 0 - do not use high-freq. Relative weight of laplacian components double reg_weights = 0.25; // fraction of the total weight used for regularization
doublehifreq_weight=clt_parameters.imp.terr_hifreq_weight;// 22.5; // 0 - do not use high-freq. Relative weight of laplacian components double reg_weights = 0.25; // fraction of the total weight used for regularization