Commit 883c0212 authored by Andrey Filippov's avatar Andrey Filippov

intermediate, before changing alpha pull

parent 1893ac24
...@@ -5802,11 +5802,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -5802,11 +5802,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
} else if (label.equals("Process Merged")) { } else if (label.equals("Process Merged")) {
OrangeTest.processMerged(); OrangeTest.processMerged();
} else if (label.equals("Vegetation LMA")) { } else if (label.equals("Vegetation LMA")) {
VegetationModel.processVegetationLMA( VegetationModel.processVegetation(
CLT_PARAMETERS, //CLTParameters clt_parameters, CLT_PARAMETERS, //CLTParameters clt_parameters,
false); //boolean combine_segments); false); //boolean combine_segments);
} else if (label.equals("Combine LMA Segments")) { } else if (label.equals("Combine LMA Segments")) {
VegetationModel.processVegetationLMA( VegetationModel.processVegetation(
CLT_PARAMETERS, //CLTParameters clt_parameters, CLT_PARAMETERS, //CLTParameters clt_parameters,
true); //boolean combine_segments); true); //boolean combine_segments);
} }
......
...@@ -1277,7 +1277,7 @@ public class VegetationModel { ...@@ -1277,7 +1277,7 @@ public class VegetationModel {
public static void processVegetationLMA( public static void processVegetation(
CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean combine_segments) boolean combine_segments)
{ {
...@@ -1296,7 +1296,7 @@ public class VegetationModel { ...@@ -1296,7 +1296,7 @@ public class VegetationModel {
VegetationModel vegetationModel = new VegetationModel( VegetationModel vegetationModel = new VegetationModel(
model_directory, // String dir, model_directory, // String dir,
model_state_file); // String title) model_state_file); // String title)
vegetationModel.testVegetationLMA( vegetationModel.processVegetationLMA(
combine_segments, // boolean combine_segments, combine_segments, // boolean combine_segments,
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
-1); // int debugLevel) { -1); // int debugLevel) {
...@@ -1369,7 +1369,7 @@ public class VegetationModel { ...@@ -1369,7 +1369,7 @@ public class VegetationModel {
} }
} }
public void testVegetationLMA( public void processVegetationLMA(
boolean combine_segments, boolean combine_segments,
CLTParameters clt_parameters, CLTParameters clt_parameters,
int debugLevel) { int debugLevel) {
...@@ -1418,7 +1418,13 @@ public class VegetationModel { ...@@ -1418,7 +1418,13 @@ public class VegetationModel {
// double terr_difference = clt_parameters.imp.terr_difference; // Pull vegetation to be this warmer // double terr_difference = clt_parameters.imp.terr_difference; // Pull vegetation to be this warmer
// double terr_pull_cold = clt_parameters.imp.terr_pull_cold; // pull vegetations to warm, terrain to cold // double terr_pull_cold = clt_parameters.imp.terr_pull_cold; // pull vegetations to warm, terrain to cold
double elevation_radius = clt_parameters.imp.terr_elevation_radius; // Radius of elevation/vegetation influence double elevation_radius = clt_parameters.imp.terr_elevation_radius; // Radius of elevation/vegetation influence
double alpha_initial_contrast = clt_parameters.imp.terr_alpha_contrast; // initial alpha contrast (>=1.0) // double alpha_initial_contrast = clt_parameters.imp.terr_alpha_contrast; // initial alpha contrast (>=1.0)
double alpha_sigma = clt_parameters.imp.terr_alpha_sigma; // 8.0; // Initial alpha: Gaussian blur sigma to find local average for vegetation temperature.
double alpha_init_min= clt_parameters.imp.terr_alpha_init_min; // 0.7; // Initial alpha: fraction for transparent
double alpha_init_max= clt_parameters.imp.terr_alpha_init_max; // 0.9; // Initial alpha: fraction for opaque
double alpha_init_offs= clt_parameters.imp.terr_alpha_init_offs; // 0.01; // Initial alpha: opaque/transparent offset from 1.0/0.0
double default_alpha = clt_parameters.imp.terr_alpha_dflt; // 0.5; // 0.8; double default_alpha = clt_parameters.imp.terr_alpha_dflt; // 0.5; // 0.8;
double alpha_loss = clt_parameters.imp.terr_alpha_loss; //100.0; // 10.0; /// 100.0; // 10.0; // 10000.0; // 1000.0; // 100.; // 10.0; // quadratic loss when alpha reaches -1.0 or 2.0 double alpha_loss = clt_parameters.imp.terr_alpha_loss; //100.0; // 10.0; /// 100.0; // 10.0; // 10000.0; // 1000.0; // 100.; // 10.0; // quadratic loss when alpha reaches -1.0 or 2.0
double alpha_offset = clt_parameters.imp.terr_alpha_offset; // 0.0; // 0.02; // 0.03; // if >0, start losses above 0.0 and below 1.0; double alpha_offset = clt_parameters.imp.terr_alpha_offset; // 0.0; // 0.02; // 0.03; // if >0, start losses above 0.0 and below 1.0;
...@@ -1436,6 +1442,10 @@ public class VegetationModel { ...@@ -1436,6 +1442,10 @@ public class VegetationModel {
double terr_pull0 = clt_parameters.imp.terr_terr_pull0; // 0.05; //0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.2; /// 0.1; //pull terrain to zero (makes sense with UM double terr_pull0 = clt_parameters.imp.terr_terr_pull0; // 0.05; //0.03; ////// 0.05; ///// 0.1; //// 0.01; /// 0.2; /// 0.1; //pull terrain to zero (makes sense with UM
double veget_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 double veget_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
double elev_pull0 = clt_parameters.imp.terr_elev_pull0; double elev_pull0 = clt_parameters.imp.terr_elev_pull0;
boolean elev_alpha_en= clt_parameters.imp.terr_elev_alpha_en; // false;// Enable loss for low vegetation with high opacity
double elev_alpha = clt_parameters.imp.terr_elev_alpha; // 1.0; // multiply alpha by under-low elevation for loss
double elev_alpha_pwr = clt_parameters.imp.terr_elev_alpha_pwr; // 1.0; // multiply alpha by under-low elevation for loss
double low_veget = clt_parameters.imp.terr_low_veget; // 2.0; // (pix) Elevation considered low (lower loss for high alpha)
double scenes_pull0 = clt_parameters.imp.terr_scenes_pull0; // 1.0 double scenes_pull0 = clt_parameters.imp.terr_scenes_pull0; // 1.0
// LMA parameters // LMA parameters
...@@ -1488,29 +1498,11 @@ public class VegetationModel { ...@@ -1488,29 +1498,11 @@ public class VegetationModel {
double transparency_frac = clt_parameters.imp.terr_recalc_frac ; // 1.0; // increase weight for far pixels (double if scale differece == this) double transparency_frac = clt_parameters.imp.terr_recalc_frac ; // 1.0; // increase weight for far pixels (double if scale differece == this)
double transparency_dist = clt_parameters.imp.terr_recalc_dist ; // 0.05; // weight of opaque tiles double transparency_dist = clt_parameters.imp.terr_recalc_dist ; // 0.05; // weight of opaque tiles
boolean recalc_average = clt_parameters.imp.terr_recalc_average ; //false; // apply transparency to average mismatch boolean recalc_average = clt_parameters.imp.terr_recalc_average ; //false; // apply transparency to average mismatch
//clt_parameters.imp.; //
boolean restore_mode = false; boolean restore_mode = false;
boolean save_par_files = true; // false; boolean save_par_files = true; // false;
// boolean diff_mode = true;
// String segments_dir = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/segments_new/";
String segments_dir = getSegmentsDir(segments_sub); String segments_dir = getSegmentsDir(segments_sub);
// boolean next_run = false;
boolean read_pars = false; // true; /// false; /// true; // false; // true; boolean read_pars = false; // true; /// false; /// true; // false; // true;
// combine parameters
// debug feature to read to continue - needs to be cleaned up/replaced // debug feature to read to continue - needs to be cleaned up/replaced
String parameters_path = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/essential/parameters_vector_data_x143-y317-w35-h35-al100.0-alo0.0-alp10.0-alin-tl0.2-vl0.01-tp0.01-vp0.01-bp5.0-um1.0_0.8.tiff"; String parameters_path = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/essential/parameters_vector_data_x143-y317-w35-h35-al100.0-alo0.0-alp10.0-alin-tl0.2-vl0.01-tp0.01-vp0.01-bp5.0-um1.0_0.8.tiff";
...@@ -1552,7 +1544,6 @@ public class VegetationModel { ...@@ -1552,7 +1544,6 @@ public class VegetationModel {
titles_laplacian, // String [] titles, // all slices*frames titles or just slice titles or null titles_laplacian, // String [] titles, // all slices*frames titles or just slice titles or null
new String[] {"source","laplacian"}, // String [] frame_titles, // frame titles or null new String[] {"source","laplacian"}, // String [] frame_titles, // frame titles or null
true); // boolean show) true); // boolean show)
} }
} }
...@@ -1933,21 +1924,21 @@ public class VegetationModel { ...@@ -1933,21 +1924,21 @@ public class VegetationModel {
} // if ((elevations == null) || (scale_dirs == null)){ } // if ((elevations == null) || (scale_dirs == null)){
/*
VegetationLMA vegetationLMA = new VegetationLMA (
// directions should not be averaged over scenes as the flight direction may change this,
alpha_initial_contrast, // double alpha_initial_contrast)
// if (debugLevel < 1000) { debugLevel); // int debugLevel)
// return; // */
// }
// initial_transparent = initial_split;
// initial_opaque = 1.0 - initial_split;
VegetationLMA vegetationLMA = new VegetationLMA ( VegetationLMA vegetationLMA = new VegetationLMA (
this, this,
alpha_initial_contrast); // double alpha_initial_contrast) alpha_init_offs, // 0.01; // double alpha_offs,
alpha_init_min, // 0.7; // double alpha_min,
alpha_init_max, // 0.9; // double alpha_max,
alpha_sigma, // 8.0; // double alpha_sigma,
debugLevel); // int debugLevel)
if (debugLevel > -2) { if (debugLevel > -2) {
double [][] dbg_img = { double [][] dbg_img = {
vegetationLMA.tvao[VegetationLMA.TVAO_TERRAIN], vegetationLMA.tvao[VegetationLMA.TVAO_TERRAIN],
...@@ -2030,6 +2021,10 @@ public class VegetationModel { ...@@ -2030,6 +2021,10 @@ public class VegetationModel {
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
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, // final double elev_alpha, // 1.0; // multiply alpha by under-low elevation for loss
elev_alpha_pwr, // final double elev_alpha_pwr, // 2.0; // raise alpha to this power (when alpha > 0)
low_veget, // final double low_veget, // 2.0; // (pix) Elevation considered low (lower loss for high alpha)
scenes_pull0, // final double scenes_pull0, scenes_pull0, // final double scenes_pull0,
boost_parallax,// final double boost_parallax, // increase weight of scene with maximal parallax relative to the reference scene 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) max_parallax, //final double max_parallax, // do not consider maximal parallax above this (consider it a glitch)
......
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