Commit 1893ac24 authored by Andrey Filippov's avatar Andrey Filippov

Working, before adding low-elevation*alpha losses

parent 9a499c0a
...@@ -1450,6 +1450,8 @@ public class VegetationModel { ...@@ -1450,6 +1450,8 @@ public class VegetationModel {
boolean fit_scenes = clt_parameters.imp.terr_fit_scenes; // true; // adjust scene offsets (start from 0 always?) boolean fit_scenes = clt_parameters.imp.terr_fit_scenes; // true; // adjust scene offsets (start from 0 always?)
boolean fit_elevations = clt_parameters.imp.terr_fit_elevations; // false; // adjust elevation pixels (not yet implemented) boolean fit_elevations = clt_parameters.imp.terr_fit_elevations; // false; // adjust elevation pixels (not yet implemented)
boolean [] fit_disable = clt_parameters.imp.terr_fit_disable.clone();
double reg_weights = clt_parameters.imp.terr_reg_weights; // 0.25; // fraction of the total weight used for regularization double reg_weights = clt_parameters.imp.terr_reg_weights; // 0.25; // fraction of the total weight used for regularization
double lambda = clt_parameters.imp.terr_lambda; // 5.0; // 0.1; double lambda = clt_parameters.imp.terr_lambda; // 5.0; // 0.1;
double lambda_scale_good = clt_parameters.imp.terr_lambda_scale_good; // 0.5; double lambda_scale_good = clt_parameters.imp.terr_lambda_scale_good; // 0.5;
...@@ -1480,7 +1482,12 @@ public class VegetationModel { ...@@ -1480,7 +1482,12 @@ public class VegetationModel {
boolean show_final_result = !tile_woi; // true; (maybe make saving results in tiled mode? boolean show_final_result = !tile_woi; // true; (maybe make saving results in tiled mode?
boolean recalc_weights = clt_parameters.imp.terr_recalc_weights ; //false; // recalculate weight depending on terrain visibility
double transparency_opaque = 1.0 - clt_parameters.imp.terr_recalc_opaque ; // 0.9; // above is opaque
double transparency_pedestal = clt_parameters.imp.terr_recalc_pedestal ; // 0.05; // weight of opaque tiles
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
boolean recalc_average = clt_parameters.imp.terr_recalc_average ; //false; // apply transparency to average mismatch
//clt_parameters.imp.; // //clt_parameters.imp.; //
...@@ -2005,6 +2012,7 @@ public class VegetationModel { ...@@ -2005,6 +2012,7 @@ public class VegetationModel {
fit_alpha, // final boolean adjust_alpha, fit_alpha, // final boolean adjust_alpha,
fit_scenes, // final boolean adjust_scenes, fit_scenes, // final boolean adjust_scenes,
fit_elevations, // final boolean adjust_elevations, fit_elevations, // final boolean adjust_elevations,
fit_disable, // final boolean [] fit_disable,
reg_weights, // final double reg_weights, // fraction of the total weight used for regularization reg_weights, // final double reg_weights, // fraction of the total weight used for regularization
alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0 alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0 alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0
...@@ -2059,6 +2067,15 @@ public class VegetationModel { ...@@ -2059,6 +2067,15 @@ public class VegetationModel {
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
if (recalc_weights) {
vegetationLMA.applyTransparency(
null, // final double [] vector,
transparency_opaque, // final double transparency_opaque,
transparency_pedestal, // final double transparency_pedestal,
transparency_frac, // final double transparency_frac,
transparency_dist, // final double transparency_dist,
recalc_average); // final boolean recalc_average);
}
} }
// old // old
if ("RESTORE".equals(par_path)) { if ("RESTORE".equals(par_path)) {
...@@ -2074,7 +2091,7 @@ public class VegetationModel { ...@@ -2074,7 +2091,7 @@ public class VegetationModel {
} }
} }
if ((show_final_result) && (debugLevel > 0)) { if ((show_final_result) && (debugLevel > -2)) { // 0)) {
String reconstructed_title = reference_scene+"-reconstructed-initial"; String reconstructed_title = reference_scene+"-reconstructed-initial";
vegetationLMA.showYfX( vegetationLMA.showYfX(
null, // double [] vector, null, // double [] vector,
...@@ -2127,6 +2144,16 @@ public class VegetationModel { ...@@ -2127,6 +2144,16 @@ public class VegetationModel {
elev_pull0 *= 0.01; elev_pull0 *= 0.01;
vegetationLMA.elevation_pull0 = elev_pull0; vegetationLMA.elevation_pull0 = elev_pull0;
if (recalc_weights) {
vegetationLMA.applyTransparency(
null, // final double [] vector,
transparency_opaque, // final double transparency_opaque,
transparency_pedestal, // final double transparency_pedestal,
transparency_frac, // final double transparency_frac,
transparency_dist, // final double transparency_dist,
recalc_average); // final boolean recalc_average); }
}
if (debugLevel > -3) { if (debugLevel > -3) {
lma_rslt= vegetationLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately) lma_rslt= vegetationLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately)
lambda, // double lambda, // 0.1 lambda, // double lambda, // 0.1
......
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