Commit 515cc7fc authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Changing to clean pixels that do not depend on any fixed values

parent 9ba553bb
Loading
Loading
Loading
Loading
+17 −4
Original line number Original line Diff line number Diff line
@@ -770,6 +770,7 @@ min_str_neib_fpn 0.35
	public double    terr_alpha_scale_avg =    1.0;  // scale average alpha (around 0.5) when pulling to it
	public double    terr_alpha_scale_avg =    1.0;  // scale average alpha (around 0.5) when pulling to it
	public double    terr_alpha_push =        12;    // push from alpha==0.5
	public double    terr_alpha_push =        12;    // push from alpha==0.5
	public double    terr_alpha_push_neutral = 0.5;  // alpha point from which push (closer to opaque)
	public double    terr_alpha_push_neutral = 0.5;  // alpha point from which push (closer to opaque)
	public double    terr_alpha_push_play =    0.0;  // no push for alpha this below 1.0
	public double    terr_alpha_weight_center =1.5;  // weight of center alpha pixel relative to each of the 4 ortho ones
	public double    terr_alpha_weight_center =1.5;  // weight of center alpha pixel relative to each of the 4 ortho ones
	public boolean   terr_en_holes =           true; // enable small holes // maybe second pass after good fit with vegetation and search for correct offset?
	public boolean   terr_en_holes =           true; // enable small holes // maybe second pass after good fit with vegetation and search for correct offset?
	public double    terr_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
	public double    terr_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
@@ -783,6 +784,7 @@ min_str_neib_fpn 0.35
	public double    terr_boost_parallax =     3.0;  //
	public double    terr_boost_parallax =     3.0;  //
	public double    terr_max_parallax =      10.0;  // parallax limit when evaluating boost parallax
	public double    terr_max_parallax =      10.0;  // parallax limit when evaluating boost parallax
	public double    terr_hifreq_weight =     10.0; // 22.5; //  0 - do not use high-freq. Relative weight of laplacian components differfences to the DC ones
	public double    terr_hifreq_weight =     10.0; // 22.5; //  0 - do not use high-freq. Relative weight of laplacian components differfences to the DC ones
	public double    terr_hiterr_weight =      1.0; // integrated difference for combined hi-freq over all scenes
	public double    terr_reg_weights =        0.25; // fraction of the total weight used for regularization
	public double    terr_reg_weights =        0.25; // fraction of the total weight used for regularization
	public double    terr_lambda =             5.0;  // 
	public double    terr_lambda =             5.0;  // 
	public double    terr_lambda_scale_good =  0.5;
	public double    terr_lambda_scale_good =  0.5;
@@ -2035,6 +2037,7 @@ min_str_neib_fpn 0.35
		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("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("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("Neutral alpha",        terr_alpha_push_neutral, 5,7,"", "Alpha point from which to push (default 0.5).");
		gd.addNumericField("Alpha play",           terr_alpha_push_play, 5,7,"", "Do not push alpha this below 1.0 (allow play).");
		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 center weight",  terr_alpha_weight_center, 5,7,"","Weight of center alpha pixel relative to each of the 4 ortho ones.");
		gd.addCheckbox    ("Hole search enable",   terr_en_holes,               "Search for small semi-transparent holes, disable diffusion of local alpha minimums.");
		gd.addCheckbox    ("Hole search enable",   terr_en_holes,               "Search for small semi-transparent holes, disable diffusion of local alpha minimums.");
		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("Alpha MM fraction",    terr_alpha_mm_hole, 5,7,"",	"Disable diffusion for local \"almost minimum\" (lower than this fraction between min and max neighbors).");
@@ -2048,6 +2051,7 @@ min_str_neib_fpn 0.35
		gd.addNumericField("Boost parallax",       terr_boost_parallax, 5,7,"",	"Increase weight of scenes that have high parallax to the reference one.");
		gd.addNumericField("Boost parallax",       terr_boost_parallax, 5,7,"",	"Increase weight of scenes that have high parallax to the reference one.");
		gd.addNumericField("Limit parallax",       terr_max_parallax, 5,7,"",	"Parallax limit when evaluating boost parallax.");
		gd.addNumericField("Limit parallax",       terr_max_parallax, 5,7,"",	"Parallax limit when evaluating boost parallax.");
		gd.addNumericField("High freq. weight",    terr_hifreq_weight, 5,7,"", 	"Relative weight of laplacian components differfences to the DC ones (0 - do not use).");
		gd.addNumericField("High freq. weight",    terr_hifreq_weight, 5,7,"", 	"Relative weight of laplacian components differfences to the DC ones (0 - do not use).");
		gd.addNumericField("Terrain weight",       terr_hiterr_weight, 5,7,"", 	"Amplifiy terrain mismatch - integrated over all scenes weight of laplacian components differfences to the DC ones (0 - do not use).");
		
		
		gd.addNumericField("Losses weight",        terr_reg_weights, 5,7,"", 	"Fraction of other losses compared to the RMSE.");
		gd.addNumericField("Losses weight",        terr_reg_weights, 5,7,"", 	"Fraction of other losses compared to the RMSE.");
		gd.addNumericField("Initial lambda",       terr_lambda, 5,7,"", 		"Initial LMA lambda.");
		gd.addNumericField("Initial lambda",       terr_lambda, 5,7,"", 		"Initial LMA lambda.");
@@ -2738,6 +2742,7 @@ min_str_neib_fpn 0.35
		terr_alpha_scale_avg =     gd.getNextNumber();// double 
		terr_alpha_scale_avg =     gd.getNextNumber();// double 
		terr_alpha_push =          gd.getNextNumber();// double 
		terr_alpha_push =          gd.getNextNumber();// double 
		terr_alpha_push_neutral =  gd.getNextNumber();// double 
		terr_alpha_push_neutral =  gd.getNextNumber();// double 
		terr_alpha_push_play =     gd.getNextNumber();// double
		terr_alpha_weight_center = gd.getNextNumber();// double 
		terr_alpha_weight_center = gd.getNextNumber();// double 
		terr_en_holes =            gd.getNextBoolean();// boolean
		terr_en_holes =            gd.getNextBoolean();// boolean
		
		
@@ -2750,6 +2755,7 @@ min_str_neib_fpn 0.35
		terr_boost_parallax =      gd.getNextNumber();// double 
		terr_boost_parallax =      gd.getNextNumber();// double 
		terr_max_parallax =        gd.getNextNumber();// double 
		terr_max_parallax =        gd.getNextNumber();// double 
		terr_hifreq_weight =       gd.getNextNumber();// double
		terr_hifreq_weight =       gd.getNextNumber();// double
		terr_hiterr_weight =       gd.getNextNumber();// double
		terr_reg_weights =         gd.getNextNumber();// double 
		terr_reg_weights =         gd.getNextNumber();// double 
		terr_lambda =              gd.getNextNumber();// double 
		terr_lambda =              gd.getNextNumber();// double 
		terr_lambda_scale_good =   gd.getNextNumber();// double 
		terr_lambda_scale_good =   gd.getNextNumber();// double 
@@ -3411,6 +3417,7 @@ min_str_neib_fpn 0.35
		properties.setProperty(prefix+"terr_alpha_scale_avg",        terr_alpha_scale_avg+"");    // double 
		properties.setProperty(prefix+"terr_alpha_scale_avg",        terr_alpha_scale_avg+"");    // double 
		properties.setProperty(prefix+"terr_alpha_push",             terr_alpha_push+"");         // double 
		properties.setProperty(prefix+"terr_alpha_push",             terr_alpha_push+"");         // double 
		properties.setProperty(prefix+"terr_alpha_push_neutral",     terr_alpha_push_neutral+""); // double
		properties.setProperty(prefix+"terr_alpha_push_neutral",     terr_alpha_push_neutral+""); // double
		properties.setProperty(prefix+"terr_alpha_push_play",        terr_alpha_push_play+"");    // double
		properties.setProperty(prefix+"terr_alpha_weight_center",    terr_alpha_weight_center+"");// double 
		properties.setProperty(prefix+"terr_alpha_weight_center",    terr_alpha_weight_center+"");// double 
		properties.setProperty(prefix+"terr_en_holes",               terr_en_holes+"");           // boolean
		properties.setProperty(prefix+"terr_en_holes",               terr_en_holes+"");           // boolean
		properties.setProperty(prefix+"terr_terr_lpf",               terr_terr_lpf+"");           // double 
		properties.setProperty(prefix+"terr_terr_lpf",               terr_terr_lpf+"");           // double 
@@ -3422,6 +3429,7 @@ min_str_neib_fpn 0.35
		properties.setProperty(prefix+"terr_boost_parallax",         terr_boost_parallax+"");     // double 
		properties.setProperty(prefix+"terr_boost_parallax",         terr_boost_parallax+"");     // double 
		properties.setProperty(prefix+"terr_max_parallax",           terr_max_parallax+"");       // double 
		properties.setProperty(prefix+"terr_max_parallax",           terr_max_parallax+"");       // double 
		properties.setProperty(prefix+"terr_hifreq_weight",          terr_hifreq_weight+"");      // double 
		properties.setProperty(prefix+"terr_hifreq_weight",          terr_hifreq_weight+"");      // double 
		properties.setProperty(prefix+"terr_hiterr_weight",          terr_hiterr_weight+"");      // double 
		properties.setProperty(prefix+"terr_reg_weights",            terr_reg_weights+"");        // double 
		properties.setProperty(prefix+"terr_reg_weights",            terr_reg_weights+"");        // double 
		properties.setProperty(prefix+"terr_lambda",                 terr_lambda+"");             // double 
		properties.setProperty(prefix+"terr_lambda",                 terr_lambda+"");             // double 
		properties.setProperty(prefix+"terr_lambda_scale_good",      terr_lambda_scale_good+"");  // double 
		properties.setProperty(prefix+"terr_lambda_scale_good",      terr_lambda_scale_good+"");  // double 
@@ -4104,6 +4112,7 @@ min_str_neib_fpn 0.35
		if (properties.getProperty(prefix+"terr_alpha_scale_avg")!=    null) terr_alpha_scale_avg=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_scale_avg"));
		if (properties.getProperty(prefix+"terr_alpha_scale_avg")!=    null) terr_alpha_scale_avg=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_scale_avg"));
		if (properties.getProperty(prefix+"terr_alpha_push")!=         null) terr_alpha_push=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_push"));
		if (properties.getProperty(prefix+"terr_alpha_push")!=         null) terr_alpha_push=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_push"));
		if (properties.getProperty(prefix+"terr_alpha_push_neutral")!= null) terr_alpha_push_neutral=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_push_neutral"));
		if (properties.getProperty(prefix+"terr_alpha_push_neutral")!= null) terr_alpha_push_neutral=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_push_neutral"));
		if (properties.getProperty(prefix+"terr_alpha_push_play")!=    null) terr_alpha_push_play=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_push_play"));
		if (properties.getProperty(prefix+"terr_alpha_weight_center")!=null) terr_alpha_weight_center=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_weight_center"));
		if (properties.getProperty(prefix+"terr_alpha_weight_center")!=null) terr_alpha_weight_center=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_weight_center"));
		if (properties.getProperty(prefix+"terr_en_holes")!= null)     terr_en_holes=Boolean.parseBoolean(properties.getProperty(prefix+"terr_en_holes"));
		if (properties.getProperty(prefix+"terr_en_holes")!= null)     terr_en_holes=Boolean.parseBoolean(properties.getProperty(prefix+"terr_en_holes"));
		if (properties.getProperty(prefix+"terr_alpha_mm_hole")!=      null) terr_alpha_mm_hole=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_mm_hole"));
		if (properties.getProperty(prefix+"terr_alpha_mm_hole")!=      null) terr_alpha_mm_hole=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_mm_hole"));
@@ -4115,8 +4124,9 @@ min_str_neib_fpn 0.35


		if (properties.getProperty(prefix+"terr_boost_parallax")!=     null) terr_boost_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_boost_parallax"));
		if (properties.getProperty(prefix+"terr_boost_parallax")!=     null) terr_boost_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_boost_parallax"));
		if (properties.getProperty(prefix+"terr_max_parallax")!=       null) terr_max_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_max_parallax"));
		if (properties.getProperty(prefix+"terr_max_parallax")!=       null) terr_max_parallax=Double.parseDouble(properties.getProperty(prefix+"terr_max_parallax"));
		//

		if (properties.getProperty(prefix+"terr_hifreq_weight")!=      null) terr_hifreq_weight=Double.parseDouble(properties.getProperty(prefix+"terr_hifreq_weight"));
		if (properties.getProperty(prefix+"terr_hifreq_weight")!=      null) terr_hifreq_weight=Double.parseDouble(properties.getProperty(prefix+"terr_hifreq_weight"));
		if (properties.getProperty(prefix+"terr_hiterr_weight")!=      null) terr_hiterr_weight=Double.parseDouble(properties.getProperty(prefix+"terr_hiterr_weight"));
		if (properties.getProperty(prefix+"terr_reg_weights")!=        null) terr_reg_weights=Double.parseDouble(properties.getProperty(prefix+"terr_reg_weights"));
		if (properties.getProperty(prefix+"terr_reg_weights")!=        null) terr_reg_weights=Double.parseDouble(properties.getProperty(prefix+"terr_reg_weights"));
		if (properties.getProperty(prefix+"terr_lambda")!=             null) terr_lambda=Double.parseDouble(properties.getProperty(prefix+"terr_lambda"));
		if (properties.getProperty(prefix+"terr_lambda")!=             null) terr_lambda=Double.parseDouble(properties.getProperty(prefix+"terr_lambda"));
		if (properties.getProperty(prefix+"terr_lambda_scale_good")!=  null) terr_lambda_scale_good=Double.parseDouble(properties.getProperty(prefix+"terr_lambda_scale_good"));
		if (properties.getProperty(prefix+"terr_lambda_scale_good")!=  null) terr_lambda_scale_good=Double.parseDouble(properties.getProperty(prefix+"terr_lambda_scale_good"));
@@ -4765,6 +4775,7 @@ min_str_neib_fpn 0.35
		imp.terr_alpha_scale_avg =               this.terr_alpha_scale_avg;                           
		imp.terr_alpha_scale_avg =               this.terr_alpha_scale_avg;                           
		imp.terr_alpha_push =                    this.terr_alpha_push;                           
		imp.terr_alpha_push =                    this.terr_alpha_push;                           
		imp.terr_alpha_push_neutral =            this.terr_alpha_push_neutral;
		imp.terr_alpha_push_neutral =            this.terr_alpha_push_neutral;
		imp.terr_alpha_push_play =               this.terr_alpha_push_play;
		imp.terr_alpha_weight_center =           this.terr_alpha_weight_center;
		imp.terr_alpha_weight_center =           this.terr_alpha_weight_center;
		imp.terr_en_holes =                      this.terr_en_holes;
		imp.terr_en_holes =                      this.terr_en_holes;
		imp.terr_alpha_mm_hole =                 this.terr_alpha_mm_hole;                           
		imp.terr_alpha_mm_hole =                 this.terr_alpha_mm_hole;                           
@@ -4777,6 +4788,8 @@ min_str_neib_fpn 0.35
		imp.terr_boost_parallax =                this.terr_boost_parallax;                           
		imp.terr_boost_parallax =                this.terr_boost_parallax;                           
		imp.terr_max_parallax =                  this.terr_max_parallax;   
		imp.terr_max_parallax =                  this.terr_max_parallax;   
		imp.terr_hifreq_weight =                 this.terr_hifreq_weight;
		imp.terr_hifreq_weight =                 this.terr_hifreq_weight;
		imp.terr_hiterr_weight =                 this.terr_hiterr_weight;

		imp.terr_reg_weights =                   this.terr_reg_weights;                           
		imp.terr_reg_weights =                   this.terr_reg_weights;                           
		imp.terr_lambda =                        this.terr_lambda;                           
		imp.terr_lambda =                        this.terr_lambda;                           
		imp.terr_lambda_scale_good =             this.terr_lambda_scale_good;                           
		imp.terr_lambda_scale_good =             this.terr_lambda_scale_good;