Commit 6c7e3422 authored by Andrey Filippov's avatar Andrey Filippov

working snapshot for VegetationLMA, some debug tools

parent 8aa4bef7
...@@ -697,41 +697,61 @@ public class VegetationModel { ...@@ -697,41 +697,61 @@ public class VegetationModel {
Rectangle woi50 = new Rectangle(143,317,35,35); Rectangle woi50 = new Rectangle(143,317,35,35);
int min_scenes = 10; int min_scenes = 10;
double default_alpha = 0.8; double default_alpha = 0.8;
double [] scene_weights = null;
double reg_weights = 0.25; // fraction of the total weight used for regularization double reg_weights = 0.25; // fraction of the total weight used for regularization
double alpha_loss = 1.0; // quadratic loss when alpha reaches -1.0 or 2.0 double alpha_loss = 1000.0; // 100.; // 10.0; // quadratic loss when alpha reaches -1.0 or 2.0
double alpha_offset = 0.0; // if >0, start losses above 0.0 and below 1.0; double alpha_offset = 0.0; // if >0, start losses above 0.0 and below 1.0;
double alpha_lpf = 2.0; // 1.5; // 5.0; // 0.5; // pull to average of 4 neighbors
int num_samples = vegetationLMA.prepareLMA( double boost_parallax = 5;
woi50, // final Rectangle woi, boolean exit_loop = debugLevel < 1000;
min_scenes, // final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence boolean next_run = false;
default_alpha, // final double default_alpha, boolean read_pars = true;
scene_weights, // final double [] scene_weights, // null or per-scene weights (higher for larger offsets)? String parameters_path = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/lma/parameters_vector_data.tiff";
reg_weights, // final double reg_weights, // fraction of the total weight used for regularization do {
alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0 String par_path = (read_pars && !next_run)? parameters_path : null;
alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0 int num_samples = vegetationLMA.prepareLMA(
debugLevel); // final int debugLevel); next_run, // final boolean keep_parameters,
woi50, // final Rectangle woi,
double lambda = 0.1; min_scenes, // final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence
double lambda_scale_good = 0.5; default_alpha, // final double default_alpha,
double lambda_scale_bad = 8.0; reg_weights, // final double reg_weights, // fraction of the total weight used for regularization
double lambda_max = 1000; alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0
boolean last_run = false; alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0
double rms_diff = 0.0001; alpha_lpf, // final double alpha_lpf, // pull to average of 4 neighbors
int num_iter = 100; boost_parallax, // final double boost_parallax, // increase weight of scene with maximal parallax relative to the reference scene
vegetationLMA.debug_index = 0; par_path, // final String parameters_read_path,
vegetationLMA.debug_image = new double [num_iter][]; debugLevel); // final int debugLevel);
if (debugLevel >-2) {
int lma_rslt= vegetationLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately) vegetationLMA.showYfX(
lambda, // double lambda, // 0.1 null, // double [] vector,
lambda_scale_good,// double lambda_scale_good,// 0.5 "reconstructed_model"); // String title)
lambda_scale_bad, // double lambda_scale_bad, // 8.0 }
lambda_max, // double lambda_max, // 100 next_run = true;
rms_diff, // double rms_diff, // 0.001 double lambda = 5.0; // 0.1;
num_iter, //int num_iter, // 20 double lambda_scale_good = 0.5;
last_run, // boolean last_run, double lambda_scale_bad = 8.0;
null, // String dbg_prefix, double lambda_max = 1000;
debugLevel); // int debug_level) boolean last_run = false;
double rms_diff = 1e-8; // 0.0001; virtually forever
int num_iter = 100;
vegetationLMA.debug_index = 0;
vegetationLMA.debug_image = new double [num_iter][];
int lma_rslt= vegetationLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately)
lambda, // double lambda, // 0.1
lambda_scale_good,// double lambda_scale_good,// 0.5
lambda_scale_bad, // double lambda_scale_bad, // 8.0
lambda_max, // double lambda_max, // 100
rms_diff, // double rms_diff, // 0.001
num_iter, //int num_iter, // 20
last_run, // boolean last_run,
null, // String dbg_prefix,
debugLevel); // int debug_level)
} while (!exit_loop);
if (debugLevel >-2) {
vegetationLMA.showYfX(
null, // double [] vector,
"reconstructed_model_adjusted"); // String title)
}
return; // return; //
} }
......
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