Commit e43d01e8 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Implemented new version of combining of segments

parent 7c77ddba
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -735,9 +735,13 @@ min_str_neib_fpn 0.35
	public boolean   terr_par_restore =       false;   // restore parameters from file
	public int       terr_step_restore =        2;     // If restore, start with step after restored 
	// terrain/vegetation parameters
	@Deprecated
	public boolean   terr_um_en =             true;
	public double    terr_um_sigma =           1.0; 
	public double    terr_um_weight =          0.8;
//	@Deprecated
	public double    terr_um_sigma =           1.0; // use for render 
//	@Deprecated
	public double    terr_um_weight =          0.8; // use for render
	@Deprecated
	public double    terr_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
	public int       terr_nan_grow =          20;      // grow undefined scenes terrain after detection 
    public int       terr_shrink_veget =      20;      // shrink accumulated vegetation for filling terrain
@@ -811,6 +815,7 @@ min_str_neib_fpn 0.35
	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 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_diff_hole  =   0.01; // Minimal alpha difference between min and max neighbor to be considered a hole
	public double    terr_terr_lpf =           0.1;  // pull terrain to average of 4 neighbors
	public double    terr_veget_lpf =         10.0;  // pull vegetation to average of 4 neighbors
	public double    terr_elev_lpf =          50.0;  // pull elevation to average of 4 neighbors
@@ -2137,6 +2142,7 @@ min_str_neib_fpn 0.35
		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.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 hole difference",terr_alpha_diff_hole, 5,7,"", "Minimal alpha difference between min and max neighbor to be considered a hole.");
		gd.addNumericField("Terrain diffusion",    terr_terr_lpf, 5,7,"",       "LPF for terrain pixels (diffusion to 4 neighbors).");
		gd.addNumericField("Vegetation diffusion", terr_veget_lpf, 5,7,"", 		"LPF for vegetation pixels (diffusion to 4 neighbors).");
		gd.addNumericField("Elevation diffusion",  terr_elev_lpf, 5,7,"", 		"LPF for elevation pixels (diffusion to 4 neighbors).");
@@ -2895,8 +2901,9 @@ min_str_neib_fpn 0.35
		terr_alpha_push_neutral =  gd.getNextNumber();// double 
		terr_alpha_weight_center = gd.getNextNumber();// double 
		terr_en_holes =            gd.getNextBoolean();// boolean
		
		terr_alpha_mm_hole =       gd.getNextNumber();// double
		terr_alpha_diff_hole =     gd.getNextNumber();// double
		
		terr_terr_lpf =            gd.getNextNumber();// double 
		terr_veget_lpf =           gd.getNextNumber();// double
		terr_elev_lpf =            gd.getNextNumber();// double
@@ -3617,6 +3624,9 @@ min_str_neib_fpn 0.35
		properties.setProperty(prefix+"terr_alpha_push_neutral",     terr_alpha_push_neutral+""); // 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_alpha_mm_hole",          terr_alpha_mm_hole+"");      // double 
		properties.setProperty(prefix+"terr_alpha_diff_hole",        terr_alpha_diff_hole+"");    // double 
		
		properties.setProperty(prefix+"terr_terr_lpf",               terr_terr_lpf+"");           // double 
		properties.setProperty(prefix+"terr_veget_lpf",              terr_veget_lpf+"");          // double 
		properties.setProperty(prefix+"terr_elev_lpf",               terr_elev_lpf+"");           // double 
@@ -4358,6 +4368,8 @@ min_str_neib_fpn 0.35
		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_alpha_mm_hole")!=      null) terr_alpha_mm_hole=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_mm_hole"));
		if (properties.getProperty(prefix+"terr_alpha_diff_hole")!=    null) terr_alpha_diff_hole=Double.parseDouble(properties.getProperty(prefix+"terr_alpha_diff_hole"));

		if (properties.getProperty(prefix+"terr_terr_lpf")!=           null) terr_terr_lpf=Double.parseDouble(properties.getProperty(prefix+"terr_terr_lpf"));
		if (properties.getProperty(prefix+"terr_veget_lpf")!=          null) terr_veget_lpf=Double.parseDouble(properties.getProperty(prefix+"terr_veget_lpf"));
		if (properties.getProperty(prefix+"terr_elev_lpf")!=           null) terr_elev_lpf=Double.parseDouble(properties.getProperty(prefix+"terr_elev_lpf"));
@@ -5069,6 +5081,7 @@ min_str_neib_fpn 0.35
		imp.terr_alpha_weight_center =           this.terr_alpha_weight_center;
		imp.terr_en_holes =                      this.terr_en_holes;
		imp.terr_alpha_mm_hole =                 this.terr_alpha_mm_hole; 
		imp.terr_alpha_diff_hole =               this.terr_alpha_diff_hole;
		imp.terr_terr_lpf =                      this.terr_terr_lpf;                           
		imp.terr_veget_lpf =                     this.terr_veget_lpf;
		imp.terr_elev_lpf =                      this.terr_elev_lpf;