Commit 9b8a5082 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

before some refactoring

parent d1be5d00
Loading
Loading
Loading
Loading
+13 −7
Original line number Original line Diff line number Diff line
@@ -2192,13 +2192,15 @@ public class EyesisCorrectionParameters {
  		public double     plNeOwn              =   5.0;  // When calculating non-exclusive planes, use center plane relative weight
  		public double     plNeOwn              =   5.0;  // When calculating non-exclusive planes, use center plane relative weight


  		public double     plExNeibCost         =   5.0;  // When calculating exclusive planes links, do not use neighbors with high cost
  		public double     plExNeibCost         =   5.0;  // When calculating exclusive planes links, do not use neighbors with high cost
  	    public double     plExNeibCostSngl     =  10.0;  // When calculating exclusive planes links, do not use no-link neighbors with high cost
//  	    public double     plExNeibCostSngl     =  10.0;  // When calculating exclusive planes links, do not use no-link neighbors with high cost
  	    public double     plExNeibSmooth       =   0.5;  // Scale down maximal costs for smoothed planes (tighter requirements) 
  	    public double     plExNeibSmooth       =   0.5;  // Scale down maximal costs for smoothed planes (tighter requirements) 
  	    public double     plMergeCostStar      =   5.0;  // Cost threshold for merging same tile planes if the plane has connected neighbors
  	    public double     plMergeCost          =  10.0;  // Cost threshold for merging same tile planes if not connected


  	    public boolean    plConflMerge         =  true;  // Try to merge conflicting planes
  	    public boolean    plConflMerge         =  true;  // Try to merge conflicting planes
  	    public double     plConflRelax         =   1.5;  // Scale parameters to relax planes fit for merging conflicting planes
  	    public double     plConflRelax         =   1.5;  // Scale parameters to relax planes fit for merging conflicting planes
  	    public boolean    plConflSngl          =  true;  // Only merge conflicting planes if this is the only conflicting pair in the supertile
  	    public boolean    plConflSngl          =  true;  // Only merge conflicting planes if this is the only conflicting pair in the supertile
  	    public boolean    plConflSnglPair      =  true;  // Only merge conflicting planes only if there are only two planes in the supertile 
  	    public boolean    plConflSnglPair      =  true;  // Only merge conflicting planes only if there are just two planes in the supertile 
  	    
  	    
  		public double     plMaxZRatio          =   2.0;  // Maximal ratio of Z to allow plane merging
  		public double     plMaxZRatio          =   2.0;  // Maximal ratio of Z to allow plane merging
  		public double     plMaxDisp            =   0.6;  // Maximal disparity of one of the planes to apply  maximal ratio
  		public double     plMaxDisp            =   0.6;  // Maximal disparity of one of the planes to apply  maximal ratio
@@ -2616,8 +2618,9 @@ public class EyesisCorrectionParameters {
			properties.setProperty(prefix+"plNeOwn",          this.plNeOwn +"");
			properties.setProperty(prefix+"plNeOwn",          this.plNeOwn +"");


			properties.setProperty(prefix+"plExNeibCost",     this.plExNeibCost +"");
			properties.setProperty(prefix+"plExNeibCost",     this.plExNeibCost +"");
			properties.setProperty(prefix+"plExNeibCostSngl", this.plExNeibCostSngl +"");
			properties.setProperty(prefix+"plExNeibSmooth",   this.plExNeibSmooth +"");
			properties.setProperty(prefix+"plExNeibSmooth",   this.plExNeibSmooth +"");
			properties.setProperty(prefix+"plMergeCostStar",  this.plMergeCostStar +"");
			properties.setProperty(prefix+"plMergeCost",      this.plMergeCost +"");
			
			
			properties.setProperty(prefix+"plConflMerge",     this.plConflMerge+"");
			properties.setProperty(prefix+"plConflMerge",     this.plConflMerge+"");
			properties.setProperty(prefix+"plConflRelax",     this.plConflRelax +"");
			properties.setProperty(prefix+"plConflRelax",     this.plConflRelax +"");
@@ -3015,8 +3018,9 @@ public class EyesisCorrectionParameters {
  			if (properties.getProperty(prefix+"plNeOwn")!=null)           this.plNeOwn=Double.parseDouble(properties.getProperty(prefix+"plNeOwn"));
  			if (properties.getProperty(prefix+"plNeOwn")!=null)           this.plNeOwn=Double.parseDouble(properties.getProperty(prefix+"plNeOwn"));


  			if (properties.getProperty(prefix+"plExNeibCost")!=null)      this.plExNeibCost=Double.parseDouble(properties.getProperty(prefix+"plExNeibCost"));
  			if (properties.getProperty(prefix+"plExNeibCost")!=null)      this.plExNeibCost=Double.parseDouble(properties.getProperty(prefix+"plExNeibCost"));
  			if (properties.getProperty(prefix+"plExNeibCostSngl")!=null)  this.plExNeibCostSngl=Double.parseDouble(properties.getProperty(prefix+"plExNeibCostSngl"));
  			if (properties.getProperty(prefix+"plExNeibSmooth")!=null)    this.plExNeibSmooth=Double.parseDouble(properties.getProperty(prefix+"plExNeibSmooth"));
  			if (properties.getProperty(prefix+"plExNeibSmooth")!=null)    this.plExNeibSmooth=Double.parseDouble(properties.getProperty(prefix+"plExNeibSmooth"));
  			if (properties.getProperty(prefix+"plMergeCostStar")!=null)   this.plMergeCostStar=Double.parseDouble(properties.getProperty(prefix+"plMergeCostStar"));
  			if (properties.getProperty(prefix+"plMergeCost")!=null)       this.plMergeCost=Double.parseDouble(properties.getProperty(prefix+"plMergeCost"));


  			if (properties.getProperty(prefix+"plConflMerge")!=null)      this.plConflMerge=Boolean.parseBoolean(properties.getProperty(prefix+"plConflMerge"));
  			if (properties.getProperty(prefix+"plConflMerge")!=null)      this.plConflMerge=Boolean.parseBoolean(properties.getProperty(prefix+"plConflMerge"));
  			if (properties.getProperty(prefix+"plConflRelax")!=null)      this.plConflRelax=Double.parseDouble(properties.getProperty(prefix+"plConflRelax"));
  			if (properties.getProperty(prefix+"plConflRelax")!=null)      this.plConflRelax=Double.parseDouble(properties.getProperty(prefix+"plConflRelax"));
@@ -3442,14 +3446,15 @@ public class EyesisCorrectionParameters {
  			gd.addNumericField("When calculating non-exclusive planes, do not use neighbors with high cost",   this.plNeNeibCost,  6);
  			gd.addNumericField("When calculating non-exclusive planes, do not use neighbors with high cost",   this.plNeNeibCost,  6);
  			gd.addNumericField("When calculating non-exclusive planes, use cenrter plane relative weight",     this.plNeOwn,  6);
  			gd.addNumericField("When calculating non-exclusive planes, use cenrter plane relative weight",     this.plNeOwn,  6);
  			gd.addNumericField("When calculating exclusive planes links, do not use neighbors with high cost", this.plExNeibCost,  6);
  			gd.addNumericField("When calculating exclusive planes links, do not use neighbors with high cost", this.plExNeibCost,  6);
  			gd.addNumericField("When calculating exclusive planes links, do not use no-link neighbors with high cost", this.plExNeibCostSngl,  6);
  			gd.addNumericField("Scale down maximal costs for smoothed planes links (tighter requirements)",    this.plExNeibSmooth,  6);
  			gd.addNumericField("Scale down maximal costs for smoothed planes links (tighter requirements)",    this.plExNeibSmooth,  6);
  			gd.addNumericField("Cost threshold for merging same tile planes if the plane has connected neighbors", this.plMergeCostStar,  6);
  			gd.addNumericField("Cost threshold for merging same tile planes if not connected",                 this.plMergeCost,  6);


  			gd.addMessage     ("--- Merging planes with topological conflicts ---");
  			gd.addMessage     ("--- Merging planes with topological conflicts ---");
  			gd.addCheckbox    ("Try to merge conflicting planes",                                                    this.plConflMerge);
  			gd.addCheckbox    ("Try to merge conflicting planes",                                                    this.plConflMerge);
  			gd.addNumericField("Scale parameters to relax planes fit for merging conflicting planes",                this.plConflRelax,  6);
  			gd.addNumericField("Scale parameters to relax planes fit for merging conflicting planes",                this.plConflRelax,  6);
  			gd.addCheckbox    ("Only merge conflicting planes if this is the only conflicting pair in the supertile",this.plConflSngl);
  			gd.addCheckbox    ("Only merge conflicting planes if this is the only conflicting pair in the supertile",this.plConflSngl);
  			gd.addCheckbox    ("Only merge conflicting planes only if there are only two planes in the supertile",   this.plConflSnglPair);
  			gd.addCheckbox    ("Only merge conflicting planes only if there are just two planes in the supertile",   this.plConflSnglPair);
  			
  			
  			gd.addMessage     ("---  ---");
  			gd.addMessage     ("---  ---");
  			gd.addNumericField("Maximal ratio of Z to allow plane merging",                                    this.plMaxZRatio,  6);
  			gd.addNumericField("Maximal ratio of Z to allow plane merging",                                    this.plMaxZRatio,  6);
@@ -3858,8 +3863,9 @@ public class EyesisCorrectionParameters {
  			this.plNeOwn=               gd.getNextNumber();
  			this.plNeOwn=               gd.getNextNumber();


  			this.plExNeibCost=          gd.getNextNumber();
  			this.plExNeibCost=          gd.getNextNumber();
  			this.plExNeibCostSngl=      gd.getNextNumber();
  			this.plExNeibSmooth=        gd.getNextNumber();
  			this.plExNeibSmooth=        gd.getNextNumber();
  			this.plMergeCostStar=       gd.getNextNumber();
  			this.plMergeCost=           gd.getNextNumber();


  			this.plConflMerge=          gd.getNextBoolean();
  			this.plConflMerge=          gd.getNextBoolean();
  			this.plConflRelax=          gd.getNextNumber();
  			this.plConflRelax=          gd.getNextNumber();
+49 −9
Original line number Original line Diff line number Diff line
@@ -58,9 +58,14 @@ public class LinkPlanes {
    public double     plNeNeibCost; //         =   5.0;  // When calculating non-exclusive planes, do not use neighbors with high cost
    public double     plNeNeibCost; //         =   5.0;  // When calculating non-exclusive planes, do not use neighbors with high cost
    public double     plNeOwn; //              =   5.0;  // When calculating non-exclusive planes, use center plane relative weight
    public double     plNeOwn; //              =   5.0;  // When calculating non-exclusive planes, use center plane relative weight
    public double     plExNeibCost; //         =   5.0;  // When calculating non-exclusive planes, do not use neighbors with high cost
    public double     plExNeibCost; //         =   5.0;  // When calculating non-exclusive planes, do not use neighbors with high cost
    public double     plExNeibCostSngl; //     =  10.0;  // When calculating exclusive planes links, do not use no-link neighbors with high cost
    public double     plExNeibSmooth; //       =   0.5;  // Scale down maximal costs for smoothed planes (tighter requirements) 
    public double     plExNeibSmooth; //       =   0.5;  // Scale down maximal costs for smoothed planes (tighter requirements) 
    public double     plMergeCostStar; //      =   5.0;  // Cost threshold for merging same tile planes if the plane has connected neighbors
    public double     plMergeCost; //          =  10.0;  // Cost threshold for merging same tile planes if not connected
    
    
    public boolean    plConflMerge; //         =  true;  // Try to merge conflicting planes
    public double     plConflRelax; //         =   1.5;  // Scale parameters to relax planes fit for merging conflicting planes
    public boolean    plConflSngl; //          =  true;  // Only merge conflicting planes if this is the only conflicting pair in the supertile
    public boolean    plConflSnglPair; //      =  true;  // Only merge conflicting planes only if there are only two planes in the supertile 


		// comparing merge quality for plane pairs
		// comparing merge quality for plane pairs
	public double     plCostDist; //           =   4.0;  // Disparity (pix) - closer cost will use more of the real world, farther - disparity
	public double     plCostDist; //           =   4.0;  // Disparity (pix) - closer cost will use more of the real world, farther - disparity
@@ -111,8 +116,14 @@ public class LinkPlanes {
		plNeNeibCost =      clt_parameters.plNeNeibCost;
		plNeNeibCost =      clt_parameters.plNeNeibCost;
		plNeOwn =           clt_parameters.plNeOwn;
		plNeOwn =           clt_parameters.plNeOwn;
		plExNeibCost =      clt_parameters.plExNeibCost;
		plExNeibCost =      clt_parameters.plExNeibCost;
		plExNeibCostSngl =  clt_parameters.plExNeibCostSngl;
		plExNeibSmooth =    clt_parameters.plExNeibSmooth;
		plExNeibSmooth =    clt_parameters.plExNeibSmooth;
		plMergeCostStar =   clt_parameters.plMergeCostStar;
		plMergeCost =       clt_parameters.plMergeCost;
		
		plConflMerge =      clt_parameters.plConflMerge;
		plConflRelax =      clt_parameters.plConflRelax;
		plConflSngl =       clt_parameters.plConflSngl;
		plConflSnglPair =   clt_parameters.plConflSnglPair;


		plCostDist =        clt_parameters.plCostDist;
		plCostDist =        clt_parameters.plCostDist;
		plCostKrq =         clt_parameters.plCostKrq;
		plCostKrq =         clt_parameters.plCostKrq;
@@ -135,13 +146,24 @@ public class LinkPlanes {
	public double getExNeibCost(){
	public double getExNeibCost(){
		return plExNeibCost;
		return plExNeibCost;
	}
	}
	public double ExNeibCostSngl(){
	public double getMergeCostStar(){
		return plExNeibCostSngl;
		return plMergeCostStar;
	}
	public double getMergeCostNoStar(){
		return plMergeCost;
	}
	}
	public double getExNeibSmooth(){
	public double getExNeibSmooth(){
		return plExNeibSmooth;
		return plExNeibSmooth;
	}
	}


	public double getConflRelax(){
		return plConflRelax;
	}
	
	public boolean getConflMerge(){
		return plConflMerge;
	}

	public boolean areWeakSimilar(
	public boolean areWeakSimilar(
			TilePlanes.PlaneData plane1, // should belong to the same supertile (or be converted for one)
			TilePlanes.PlaneData plane1, // should belong to the same supertile (or be converted for one)
			TilePlanes.PlaneData plane2,
			TilePlanes.PlaneData plane2,
@@ -634,9 +656,11 @@ public class LinkPlanes {
		// reduce cost contribution for disparity space parameters for near objects, increase - for far 
		// reduce cost contribution for disparity space parameters for near objects, increase - for far 
		
		
		double average_disp = 0.5 * (plane1.getZxy()[0] + plane2.getZxy()[0]);
		double average_disp = 0.5 * (plane1.getZxy()[0] + plane2.getZxy()[0]);
		double cost_near = average_disp * average_disp / (average_disp * average_disp + this.plCostDist * this.plCostDist); 
		double cost_near = (this.plCostDist > 0.0) ?
		double plCostKrq =   this.plCostKrq    * (1.0 - cost_near);
				(2.0 * average_disp * average_disp / (average_disp * average_disp + this.plCostDist * this.plCostDist)) :
		double plCostKrqEq = this.plCostKrqEq  * (1.0 - cost_near);
					1.0; 
		double plCostKrq =   this.plCostKrq    * (2.0 - cost_near);
		double plCostKrqEq = this.plCostKrqEq  * (2.0 - cost_near);
		double plCostWrq =   this.plCostWrq    *  cost_near;
		double plCostWrq =   this.plCostWrq    *  cost_near;
		double plCostWrqEq = this.plCostWrqEq  *  cost_near;
		double plCostWrqEq = this.plCostWrqEq  *  cost_near;
		
		
@@ -968,7 +992,7 @@ public class LinkPlanes {
		}		      
		}		      
		ImageDtt.startAndJoin(threads);
		ImageDtt.startAndJoin(threads);
	}
	}

/*
	public void setExclusiveLinks(
	public void setExclusiveLinks(
			final TilePlanes.PlaneData [][] planes,
			final TilePlanes.PlaneData [][] planes,
			final int                       debugLevel,
			final int                       debugLevel,
@@ -982,6 +1006,7 @@ public class LinkPlanes {
				dbg_X,
				dbg_X,
				dbg_Y);
				dbg_Y);
	}
	}
*/
	public void setExclusiveLinks(
	public void setExclusiveLinks(
			final TilePlanes.PlaneData [][] planes,
			final TilePlanes.PlaneData [][] planes,
			final double                    max_cost,
			final double                    max_cost,
@@ -2668,6 +2693,7 @@ public class LinkPlanes {
	}
	}
	
	
	public int [][][] filterPairsByConflicts(
	public int [][][] filterPairsByConflicts(
			final TilePlanes.PlaneData [][] planes,
			final int [][][]                merge_candidates,
			final int [][][]                merge_candidates,
			final int [][][]                conflicts)
			final int [][][]                conflicts)
	{
	{
@@ -2685,6 +2711,20 @@ public class LinkPlanes {
				public void run() {
				public void run() {
					for (int nsTile = ai.getAndIncrement(); nsTile < nStiles; nsTile = ai.getAndIncrement()) {
					for (int nsTile = ai.getAndIncrement(); nsTile < nStiles; nsTile = ai.getAndIncrement()) {
						if ((merge_candidates[nsTile] != null) && (conflicts[nsTile] != null)) {
						if ((merge_candidates[nsTile] != null) && (conflicts[nsTile] != null)) {
							if (plConflSnglPair){
								int num_planes = 0;
								for (int i = 0; i < planes[nsTile].length; i++){
									if (planes[nsTile][i] != null) num_planes++;
								}
								if (num_planes > 2) {
									continue;
								}
							}
							if (plConflSngl && (conflicts[nsTile].length > 1)){
								continue;
							}

// TODO: maybe additionally check link costs correlation							
							HashSet<Point> pairs_set = new HashSet<Point>();
							HashSet<Point> pairs_set = new HashSet<Point>();
							for (int i = 0; i < merge_candidates[nsTile].length; i++ ){
							for (int i = 0; i < merge_candidates[nsTile].length; i++ ){
								if (merge_candidates[nsTile][i] != null){
								if (merge_candidates[nsTile][i] != null){
+53 −41
Original line number Original line Diff line number Diff line
@@ -3310,6 +3310,7 @@ public class TileProcessor {
// Just overwrite results of the previous method			
// Just overwrite results of the previous method			
			lp.setExclusiveLinks(
			lp.setExclusiveLinks(
					st.planes, // final TilePlanes.PlaneData [][] planes,
					st.planes, // final TilePlanes.PlaneData [][] planes,
					lp.getExNeibCost(), // final double                    max_cost,
					2, // -1, // debugLevel,                  // final int        debugLevel)
					2, // -1, // debugLevel,                  // final int        debugLevel)
					clt_parameters.tileX,
					clt_parameters.tileX,
					clt_parameters.tileY);
					clt_parameters.tileY);
@@ -3380,8 +3381,10 @@ public class TileProcessor {
//			System.out.println("merge_cost_data.length = " + merge_cost_data.length);
//			System.out.println("merge_cost_data.length = " + merge_cost_data.length);
					
					
					lp.costSameTileConnectionsAlt(
					lp.costSameTileConnectionsAlt(
					5.0,  // final double         threshold,
					//5.0,  // final double         threshold,
					10.0, // final double         threshold_nostar,
					//10.0, // final double         threshold_nostar,
					lp.getMergeCostStar(),   // relax_for_conflicts * 5.0,  // final double         threshold, // 
					lp.getMergeCostNoStar(), //relax_for_conflicts * 10.0, // final double         threshold_nostar,


					st.planes, // final TilePlanes.PlaneData [][] planes,
					st.planes, // final TilePlanes.PlaneData [][] planes,
					merge_candidates,       // final int [][][] merge_candidates,
					merge_candidates,       // final int [][][] merge_candidates,
@@ -3650,6 +3653,7 @@ public class TileProcessor {
//Just overwrite results of the previous method			
//Just overwrite results of the previous method			
		lp.setExclusiveLinks(
		lp.setExclusiveLinks(
				st.planes, // final TilePlanes.PlaneData [][] planes,
				st.planes, // final TilePlanes.PlaneData [][] planes,
				lp.getExNeibCost(), // final double                    max_cost,
				2, // -1, // debugLevel,                  // final int        debugLevel)
				2, // -1, // debugLevel,                  // final int        debugLevel)
				clt_parameters.tileX,
				clt_parameters.tileX,
				clt_parameters.tileY);
				clt_parameters.tileY);
@@ -3806,6 +3810,7 @@ public class TileProcessor {
// Just overwrite results of the previous method			
// Just overwrite results of the previous method			
			lp.setExclusiveLinks(
			lp.setExclusiveLinks(
					st.planes, // final TilePlanes.PlaneData [][] planes,	
					st.planes, // final TilePlanes.PlaneData [][] planes,	
					lp.getExNeibCost(), // final double                    max_cost,
					2, // -1, // debugLevel,                  // final int        debugLevel)
					2, // -1, // debugLevel,                  // final int        debugLevel)
					clt_parameters.tileX,
					clt_parameters.tileX,
					clt_parameters.tileY);
					clt_parameters.tileY);
@@ -3854,7 +3859,7 @@ public class TileProcessor {
		TilePlanes.PlaneData [][] planes_mod = null;
		TilePlanes.PlaneData [][] planes_mod = null;


		// smooth planes (by averaging with neighbors and the "measured" one with variable "pull")
		// smooth planes (by averaging with neighbors and the "measured" one with variable "pull")
		double relax_for_conflicts = 1.5;
//		double relax_for_conflicts = lp.getConflRelax(); // 1.5;


		if (clt_parameters.plIterations > 0) {
		if (clt_parameters.plIterations > 0) {
			for (int num_merge_try = 0; num_merge_try < 10; num_merge_try ++ ) { // smooth and merge
			for (int num_merge_try = 0; num_merge_try < 10; num_merge_try ++ ) { // smooth and merge
@@ -3880,7 +3885,8 @@ public class TileProcessor {
						clt_parameters.tileY);
						clt_parameters.tileY);
				lp.setExclusiveLinks(
				lp.setExclusiveLinks(
						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						2.5, //final double                    max_cost
//						2.5, //final double                      max_cost
						lp.getExNeibCost()*lp.getExNeibSmooth(), // final double                    max_cost,
						2, // -1, // debugLevel,                  // final int        debugLevel)
						2, // -1, // debugLevel,                  // final int        debugLevel)
						clt_parameters.tileX,
						clt_parameters.tileX,
						clt_parameters.tileY);
						clt_parameters.tileY);
@@ -3906,7 +3912,8 @@ public class TileProcessor {
				// recalculate links? more smooth?
				// recalculate links? more smooth?
				lp.setExclusiveLinks(
				lp.setExclusiveLinks(
						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						2.5, //final double                    max_cost
//						2.5, //final double                      max_cost
						lp.getExNeibCost()*lp.getExNeibSmooth(), // final double                    max_cost,
						2, // -1, // debugLevel,                  // final int        debugLevel)
						2, // -1, // debugLevel,                  // final int        debugLevel)
						clt_parameters.tileX,
						clt_parameters.tileX,
						clt_parameters.tileY);
						clt_parameters.tileY);
@@ -3953,6 +3960,7 @@ public class TileProcessor {
						1); // final int debugLevel)
						1); // final int debugLevel)


				int [][][] conflicting_candidates = lp.filterPairsByConflicts(
				int [][][] conflicting_candidates = lp.filterPairsByConflicts(
						st.planes_mod,    // final TilePlanes.PlaneData [][] planes,			
						merge_candidates, // final int [][][]                merge_candidates,
						merge_candidates, // final int [][][]                merge_candidates,
						conflicts0);      // final int [][][]                conflicts)
						conflicts0);      // final int [][][]                conflicts)


@@ -3972,8 +3980,11 @@ public class TileProcessor {
				//				System.out.println("merge_cost_data.length = " + merge_cost_data.length);
				//				System.out.println("merge_cost_data.length = " + merge_cost_data.length);


				lp.costSameTileConnectionsAlt(
				lp.costSameTileConnectionsAlt(
						5.0,  // final double         threshold,
						//5.0,  // final double         threshold,
						10.0, // final double         threshold_nostar,
						//10.0, // final double         threshold_nostar,
						lp.getMergeCostStar(),   // relax_for_conflicts * 5.0,  // final double         threshold, // 
						lp.getMergeCostNoStar(), //relax_for_conflicts * 10.0, // final double         threshold_nostar,



						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						st.planes_mod, // final TilePlanes.PlaneData [][] planes,
						merge_candidates,       // final int [][][] merge_candidates,
						merge_candidates,       // final int [][][] merge_candidates,
@@ -4049,7 +4060,7 @@ public class TileProcessor {
							st.planes,               // final TilePlanes.PlaneData [][] planes,
							st.planes,               // final TilePlanes.PlaneData [][] planes,
							conflicting_candidates,  // final int [][][] merge_candidates,
							conflicting_candidates,  // final int [][][] merge_candidates,
							plane_nooverlaps,        // final boolean [][][]   valid_candidates, // will be updated
							plane_nooverlaps,        // final boolean [][][]   valid_candidates, // will be updated
							relax_for_conflicts,         // final double                    relax,
							lp.getConflRelax(),      //relax_for_conflicts,         // final double                    relax,
							2,                       // -1, // debugLevel,                  // final int        debugLevel)
							2,                       // -1, // debugLevel,                  // final int        debugLevel)
							clt_parameters.tileX,
							clt_parameters.tileX,
							clt_parameters.tileY);
							clt_parameters.tileY);
@@ -4058,8 +4069,8 @@ public class TileProcessor {
					lp.costSameTileConnectionsAlt(
					lp.costSameTileConnectionsAlt(
							//							relax_for_conflicts,         // final double                    relax,
							//							relax_for_conflicts,         // final double                    relax,


							relax_for_conflicts * 5.0,  // final double         threshold, // 
							lp.getConflRelax() * lp.getMergeCostStar(),   // relax_for_conflicts * 5.0,  // final double         threshold, // 
							relax_for_conflicts * 10.0, // final double         threshold_nostar,
							lp.getConflRelax() * lp.getMergeCostNoStar(), //relax_for_conflicts * 10.0, // final double         threshold_nostar,


							//							st.planes_mod, // final TilePlanes.PlaneData [][] planes,
							//							st.planes_mod, // final TilePlanes.PlaneData [][] planes,
							st.planes, // final TilePlanes.PlaneData [][] planes,
							st.planes, // final TilePlanes.PlaneData [][] planes,
@@ -4072,9 +4083,9 @@ public class TileProcessor {
					merge_groups = lp.extractMergeSameTileGroups(
					merge_groups = lp.extractMergeSameTileGroups(
							//							st.planes_mod,              // final TilePlanes.PlaneData [][] planes,
							//							st.planes_mod,              // final TilePlanes.PlaneData [][] planes,
							st.planes,                 // final TilePlanes.PlaneData [][] planes,
							st.planes,                 // final TilePlanes.PlaneData [][] planes,
							merge_candidates,       // final int [][][] merge_candidates,
							conflicting_candidates,    // final int [][][] merge_candidates,
							plane_nooverlaps,          // boolean [][][] plane_overlaps,
							plane_nooverlaps,          // boolean [][][] plane_overlaps,
							relax_for_conflicts,         // final double                    relax,
							lp.getConflRelax(),        // relax_for_conflicts,         // final double                    relax,
							2,                         // -1, // debugLevel,                  // final int        debugLevel)
							2,                         // -1, // debugLevel,                  // final int        debugLevel)
							clt_parameters.tileX,
							clt_parameters.tileX,
							clt_parameters.tileY);
							clt_parameters.tileY);
@@ -4143,7 +4154,8 @@ public class TileProcessor {
	// Just overwrite results of the previous method			
	// Just overwrite results of the previous method			
				lp.setExclusiveLinks(
				lp.setExclusiveLinks(
						st.planes, // final TilePlanes.PlaneData [][] planes,
						st.planes, // final TilePlanes.PlaneData [][] planes,
						2.5, //final double                    max_cost
//						2.5, //final double                      max_cost
						lp.getExNeibCost()*lp.getExNeibSmooth(), // final double                    max_cost,
						2, // -1, // debugLevel,                  // final int        debugLevel)
						2, // -1, // debugLevel,                  // final int        debugLevel)
						clt_parameters.tileX,
						clt_parameters.tileX,
						clt_parameters.tileY);
						clt_parameters.tileY);