Commit 4bbac7dc authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Testing LMA with multi-scene LY

parent 816eae59
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ public class CLTParameters {
	public double     lyms_inf_range_offs = 0.05; // Add to the disparity distribution mode for infinity center
	public double     lyms_inf_range =      0.15; // Consider infinity tiles that are within +/- half of this range from infinity center
	//non-infinity parameters		
	public int        lyms_margin =           6;  // discard tiles from each side
	public double     lyms_min_inf_str =    0.2;  // Minimal strength of infinity tiles
	public double     lyms_min_fg_str =     0.4;  // Minimal strength of non-infinity tiles
	public int        lyms_clust_size =     4;    // cluster size (same in both directions) for measuring LY data
@@ -1263,6 +1264,7 @@ public class CLTParameters {
		properties.setProperty(prefix+"lyms_far_fract",             this.lyms_far_fract +"");
		properties.setProperty(prefix+"lyms_inf_range_offs",        this.lyms_inf_range_offs +"");
		properties.setProperty(prefix+"lyms_inf_range",             this.lyms_inf_range +"");
		properties.setProperty(prefix+"lyms_margin",                this.lyms_margin +"");
		properties.setProperty(prefix+"lyms_min_inf_str",           this.lyms_min_inf_str +"");
		properties.setProperty(prefix+"lyms_min_fg_str",            this.lyms_min_fg_str +"");
		properties.setProperty(prefix+"lyms_clust_size",            this.lyms_clust_size +"");
@@ -2104,6 +2106,7 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"lyms_far_fract")!=null)                this.lyms_far_fract=Double.parseDouble(properties.getProperty(prefix+"lyms_far_fract"));
		if (properties.getProperty(prefix+"lyms_inf_range_offs")!=null)           this.lyms_inf_range_offs=Double.parseDouble(properties.getProperty(prefix+"lyms_inf_range_offs"));
		if (properties.getProperty(prefix+"lyms_inf_range")!=null)                this.lyms_inf_range=Double.parseDouble(properties.getProperty(prefix+"lyms_inf_range"));
		if (properties.getProperty(prefix+"lyms_margin")!=null)                   this.lyms_margin=Integer.parseInt(properties.getProperty(prefix+"lyms_margin"));
		if (properties.getProperty(prefix+"lyms_min_inf_str")!=null)              this.lyms_min_inf_str=Double.parseDouble(properties.getProperty(prefix+"lyms_min_inf_str"));
		if (properties.getProperty(prefix+"lyms_min_fg_str")!=null)               this.lyms_min_fg_str=Double.parseDouble(properties.getProperty(prefix+"lyms_min_fg_str"));
		if (properties.getProperty(prefix+"lyms_clust_size")!=null)               this.lyms_clust_size=Integer.parseInt(properties.getProperty(prefix+"lyms_clust_size"));
@@ -3057,6 +3060,8 @@ public class CLTParameters {
		gd.addNumericField("Infinity full range",                                              this.lyms_inf_range,      4,6,"pix",
				"Consider infinity tiles that are within +/- half of this range from infinity center");
		gd.addMessage     ("--- LY data measurement ---");
		gd.addNumericField("LY Margin",                                                        this.lyms_margin,         0,3,"tiles",
				"Discard tiles from border");
		gd.addNumericField("Minimal strength (infinity)",                                      this.lyms_min_inf_str,    4,6,"",
				"Minimal strength of infinity tiles");
		gd.addNumericField("Minimal strength (non-infinity)",                                  this.lyms_min_fg_str,     4,6,"",
@@ -4036,6 +4041,7 @@ public class CLTParameters {
		this.lyms_far_fract=        gd.getNextNumber();
		this.lyms_inf_range_offs=   gd.getNextNumber();
		this.lyms_inf_range=        gd.getNextNumber();
		this.lyms_margin=     (int) gd.getNextNumber();
		this.lyms_min_inf_str=      gd.getNextNumber();
		this.lyms_min_fg_str=       gd.getNextNumber();
		this.lyms_clust_size= (int) gd.getNextNumber();
+6 −3
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ import com.elphel.imagej.tileprocessor.DttRad2;
import com.elphel.imagej.tileprocessor.ErsCorrection;
import com.elphel.imagej.tileprocessor.ImageDtt;
import com.elphel.imagej.tileprocessor.MLStats;
import com.elphel.imagej.tileprocessor.MultisceneLY;
import com.elphel.imagej.tileprocessor.QuadCLT;
import com.elphel.imagej.tileprocessor.SymmVector;
import com.elphel.imagej.tileprocessor.TwoQuadCLT;
@@ -7379,6 +7380,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
	 * @return
	 */
	public boolean adjustLYSeries(boolean use_aux) {
		MultisceneLY.MSLY_MODE adjust_mode = MultisceneLY.MSLY_MODE.INF_NOINF;
		long startTime = System.nanoTime();
		// load needed sensor and kernels files
		if (!prepareRigImages())
@@ -7437,6 +7439,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
			TWO_QUAD_CLT.adjustLYSeries(
					quadCLT, // QUAD_CLT, // QuadCLT quadCLT_main,
					CLT_PARAMETERS,       // EyesisCorrectionParameters.DCTParameters dct_parameters,
					adjust_mode,          // MultisceneLY.MSLY_MODE                               adjust_mode,
					DEBAYER_PARAMETERS,   // EyesisCorrectionParameters.DebayerParameters debayerParameters,
					colorProcParameters,  // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
											// colorProcParameters,
+10 −32
Original line number Diff line number Diff line
@@ -118,6 +118,10 @@ public class ExtrinsicAdjustment {
	
	public double dbg_delta = 0; // 1.0E-5; // if not 0 - use delta instead of the derivatives in getJacobianTransposed
	
	public void setForceDisparity(boolean [] force_disparity) {
		this.force_disparity = force_disparity;
	}

	public double [] getOldNewRMS() {
		double [] on_rms = new double[2];
		if (initial_rms != null) {
@@ -291,13 +295,13 @@ public class ExtrinsicAdjustment {
		s += "Port"+suffix+": [";
		for (int p = 0; p < num_sensors; p++) s += String.format(hfmt, p, "");s+="]\n";
		s += "DD"+suffix+"=   [";
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[indx_dd0 + p]);s+="]" + String.format(" # avg = "+dfmta+"\n", avg_dd);
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[indx_dd0 + p]);s+="]" + String.format(" # avg = "+dfmta+" (should be 0)\n", avg_dd);
		s += "ND"+suffix+"=   [";
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[indx_nd0 + p]);s+="]" + String.format(" # avg = "+dfmta+"\n", avg_nd);
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[indx_nd0 + p]);s+="]" + String.format(" # avg = "+dfmta+" (May be non-0, especially large S1)\n", avg_nd);
		s += "DX"+suffix+"=   [";
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[INDX_X0 + 2 * p + 0]);s+="]" + String.format(" # avg = "+dfmta+"\n", avg_x);
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[INDX_X0 + 2 * p + 0]);s+="]" + String.format(" # avg = "+dfmta+" (should be 0)\n", avg_x);
		s += "DY"+suffix+"=   [";
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[INDX_X0 + 2 * p + 1]);s+="]" + String.format(" # avg = "+dfmta+"\n", avg_y);
		for (int p = 0; p < num_sensors; p++) s += String.format(dfmt, avg[INDX_X0 + 2 * p + 1]);s+="]" + String.format(" # avg = "+dfmta+" (should be 0)\n", avg_y);
		return s;
	}
	/*
@@ -457,19 +461,6 @@ public class ExtrinsicAdjustment {
					x0y0, // double[][] data,
					"nondistorted X0Y0");// String title);
		}
/*
		this.par_mask = geometryCorrection.getParMask(
				use_disparity, // has_disparity, // boolean use_disparity,
				use_aztilts,       // Adjust azimuths and tilts excluding disparity
				use_diff_rolls,    // Adjust differential rolls (3 of 4 angles)
				common_roll,// boolean common_roll,
				corr_focalLength,  // boolean corr_focalLength);
				ers_rot,           // boolean ers_rot,           // Enable ERS correction of the camera rotation
				ers_forw,          // Enable ERS correction of the camera linear movement in z direction
				ers_side,          // Enable ERS correction of the camera linear movement in x direction
				ers_vert,          // Enable ERS correction of the camera linear movement in y direction
		  		manual_par_sel);   // Manually select the parameter mask bit 0 - sym0, bit1 - sym1, ... (0 - use boolean flags, != 0 - ignore boolean flags)
*/		  		
		boolean [] filtered_infinity = null;
		
		double [] dfe = null;
@@ -496,20 +487,7 @@ public class ExtrinsicAdjustment {
					inf_min_disparity,  // double min_infinity,
					inf_max_disparity); // double max_infinity
		 }
/*
		this.weights = getWeights( // will ignore window for infinity (already used for selection)
				 measured_dsxy,        // double  [][] measured_dsxy,
				 (use_disparity? force_disparity: null),   // boolean [] force_disparity, // same dimension as dsdn, true if disparity should be controlled
				 filtered_infinity,    // boolean [] filtered_infinity,
				 dfe, // 	double  []  distance_from_edge,// to reduce weight of the mountain ridge, increase clouds (or null)
				 min_num_forced,       //				int min_num_forced,
				 infinity_right_left, //	boolean infinity_right_left,  // each halve should have > min_num_forced, will calculate separate average
				 weight_infinity,      // double weight_infinity,       // total weight of infinity tiles fraction (0.0 - 1.0) 
				 weight_disparity,     // double weight_disparity,      // disparity weight relative to the sum of 8 lazy eye values of the same tile 
				 weight_disparity_inf, // double weight_disparity_inf,  // disparity weight relative to the sum of 8 lazy eye values of the same tile for infinity 
				 max_disparity_far,   // 					double max_disparity_far)     // reduce weights of near tiles proportional to sqrt(max_disparity_far/disparity)
				 max_disparity_use);
*/		

		int [] inf_stat = setWeights( // number right, number left
				 measured_dsxy,        // double  [][] measured_dsxy,
				 (use_disparity? force_disparity: null),   // boolean [] force_disparity, // same dimension as dsdn, true if disparity should be controlled
@@ -2366,7 +2344,7 @@ public class ExtrinsicAdjustment {
			if (rslt == null) {
				return false; // need to check
			}
			if (debug_level > 1) {
			if (debug_level > -3) { //  > 0) {
				System.out.println("LMA step "+iter+": {"+rslt[0]+","+rslt[1]+"} full RMS= "+good_or_bad_rms[0]+
						" ("+initial_rms[0]+"), pure RMS="+good_or_bad_rms[1]+" ("+initial_rms[1]+") + lambda="+lambda);
			}
+235 −73

File changed.

Preview size limit exceeded, changes collapsed.

+225 −99
Original line number Diff line number Diff line
@@ -11104,6 +11104,7 @@ if (debugLevel > -100) return true; // temporarily !
	public void adjustLYSeries(
			QuadCLT                                              quadCLT_main, // tiles should be set
			CLTParameters                                        clt_parameters,
			MultisceneLY.MSLY_MODE                               adjust_mode,
			EyesisCorrectionParameters.DebayerParameters         debayerParameters,
			ColorProcParameters                                  colorProcParameters,
			CorrectionColorProc.ColorGainsParameters             channelGainParameters,
@@ -11148,9 +11149,10 @@ if (debugLevel > -100) return true; // temporarily !
					updateStatus,   // boolean        updateStatus,
					debugLevel);    // int            debugLevel)
		}
		boolean proc_infinity = true; 
		boolean proc_infinity = (adjust_mode == MultisceneLY.MSLY_MODE.INF_ONLY) || (adjust_mode == MultisceneLY.MSLY_MODE.INF_NOINF); //  true; 
		boolean lma_only = true; // use clt_parameters
		double        dbg_disparity_offset = 0.0; // 0.1
		
		double        inf_disp_ref =   0.0;
		int last_scene_index = quadCLTs.length-1;
@@ -11248,13 +11250,51 @@ if (debugLevel > -100) return true; // temporarily !
		for (int nscene = 0; nscene < numCorrMax.length; nscene++) {
			for (int nTile = 0; nTile < numCorrMax[nscene].length; nTile++) {
				valid_tile[nscene][nTile] = numCorrMax[nscene][nTile] == 1; // only single-maximum
				if (clt_parameters.lyms_margin > 0) {
					int tileX = nTile % tilesX;
					int tileY = nTile / tilesX;
					if (    (tileY < clt_parameters.lyms_margin) ||
							(tileX < clt_parameters.lyms_margin) ||
							(tileY >= (tilesY - clt_parameters.lyms_margin)) ||
							(tileX >= (tilesX - clt_parameters.lyms_margin))) {
						valid_tile[nscene][nTile] = false;	
					}
				}
			}
		}
		int [][] num_tiles2 = new int[2][];
		double [][][] target_disparities = new double [2][][]; 
		double [][][] lazy_eye_data = 	MultisceneLY.getLYDataInfNoinf(
		boolean                 use_tarz = false; // true; //false;
		double                  delta = 0.001; // 0.01;
		boolean debug_derivs = false;
		ExtrinsicAdjustment ea = new ExtrinsicAdjustment (
				last_scene.getErsCorrection(),  // GeometryCorrection gc,
				clt_parameters.lyms_clust_size, // int         clusterSize,
				clustersX,                      // int         clustersX,
				clustersY);                     // int         clustersY)
		boolean [] force_disparity = new boolean[clusters];
		boolean apply_extrinsic = (clt_parameters.ly_corr_scale != 0.0);
//		int max_tries = 5; // organize cycle with comparing results
		int max_tries =                   clt_parameters.lym_iter; // 25;
		double inf_min = -1.0;
		double inf_max =  1.0;
		double [] old_new_rms = new double [2];
		double min_sym_update =           clt_parameters.getLymChange(last_scene.isAux()); //  4e-6; // stop iterations if no angle changes more than this
		double comp_diff = min_sym_update + 1; // (> min_sym_update)
		
		double []     disparity_offset = new double [clusters]; // 0.1
		if (dbg_disparity_offset != 0.0) {
			Arrays.fill(disparity_offset, dbg_disparity_offset);
		}
		int            nrefine = 4;
		
		for (int num_iter = 0; num_iter < max_tries; num_iter++){
			// (re-)measure LY here, update all scenes? or just accumulater difference?
			double [][][] lazy_eye_data2 = 	MultisceneLY.getLYDataInfNoinf(
					clt_parameters,       // final CLTParameters  clt_parameters,
					quadCLTs,             // final QuadCLT []     scenes,            // ordered by increasing timestamps
					valid_tile,           // final boolean [][]   valid_tile,        // tile with lma and single correlation maximum
@@ -11264,16 +11304,14 @@ if (debugLevel > -100) return true; // temporarily !
					dbg_disparity_offset, // final double         dbg_disparity_offset,
					num_tiles2,           // final int [][]       in_num_tiles,     // null or number of tiles per cluster to multiply strength
					null,                 // final CorrVector     corr_vector_delta, // null or extrinsic vector offset, applied to all scenes
					nrefine,              // final int            nrefine,           // number of disparity refines for non-inf
					threadsMax,           // final int            threadsMax,
					debugLevel);          // final int            debug_level);
		
	    boolean                 use_tarz = false; // true; //false;
	    double                  delta = 0.001; // 0.01;
	    
			if (debug_derivs && (num_iter == 0)) { // only once if any
				MultisceneLY.debugLYDerivatives(
						clt_parameters, // final CLTParameters     clt_parameters,
						quadCLTs,             // final QuadCLT []        scenes,            // ordered by increasing timestamps
				lazy_eye_data,        // double [][][]           lazy_eye_data2, // inf, no_inf
						lazy_eye_data2,        // double [][][]           lazy_eye_data2, // inf, no_inf
						valid_tile,           // final boolean [][]      valid_tile,        // tile with lma and single correlation maximum
						inf_disp_ref,         // final double            inf_disp_ref,      // average disparity at infinity for ref scene // is_scene_infinity
						is_scene_infinity,    //final boolean [][]      is_scene_infinity, // may be null, if not - may be infinity from the composite depth map
@@ -11283,6 +11321,121 @@ if (debugLevel > -100) return true; // temporarily !
						delta,                // double                  delta,
						use_tarz,             // boolean                 use_tarz,  // derivatives by tarz, not symmetrical vectors
						debugLevel); // final int               debugLevel);
			}
			for (int nly = 0; nly < lazy_eye_data2.length; nly++) if (lazy_eye_data2[nly] != null ) {
				ea.showInput(
						lazy_eye_data2[nly], // double[][] data,
						"drv_reference-"+MultisceneLY.SINF_NOINF[nly]);// String title);
			}
			double [][]  lazy_eye_data = MultisceneLY.mergeLY(
					adjust_mode,         // MSLY_MODE      adjust_mode,	
					lazy_eye_data2,      // double [][][]  lazy_eye_data2,
					force_disparity);    // boolean []     force_disparity // null or [clusters]
			ea.setForceDisparity(force_disparity);
			ea.showInput(
					lazy_eye_data, // double[][] data,
					"ly_combo-"+lazy_eye_data.toString());// String title);
			CorrVector corr_vector =   ea.solveCorr (
					clt_parameters.ly_marg_fract, 	  // double      marg_fract,        // part of half-width, and half-height to reduce weights
					clt_parameters.ly_inf_en,           // boolean     use_disparity,     // adjust disparity-related extrinsics
					// 1.0 - to skip filtering infinity
					inf_min, //double      inf_min_disparity, // minimal disparity for infinity 
					inf_max, // double      inf_max_disparity, // minimal disparity for infinity
					clt_parameters.ly_inf_min_broad, // inf_min_disp_abs,  // minimal disparity for infinity (absolute) 
					clt_parameters.ly_inf_max_broad, // maximal disparity for infinity (absolute)
					clt_parameters.ly_inf_tilt,      //   boolean     en_infinity_tilt,  // select infinity tiles form right/left tilted (false - from average)  
					clt_parameters.ly_right_left,    //   boolean     infinity_right_left, // balance weights between right and left halves of infinity
					clt_parameters.ly_aztilt_en,        // boolean     use_aztilts,       // Adjust azimuths and tilts excluding disparity
					clt_parameters.ly_diff_roll_en,     // boolean     use_diff_rolls,    // Adjust differential rolls (3 of 4 angles)
					//					  clt_parameters.ly_inf_force,        // boolean     force_convergence, // if true try to adjust convergence (disparity, symmetrical parameter 0) even with no disparity
					clt_parameters.ly_min_forced,       // int         min_num_forced,    // minimal number of clusters with forced disparity to use it
					// data, using just radial distortions
					clt_parameters.ly_com_roll,         // boolean     common_roll,       // Enable common roll (valid for high disparity range only)
					clt_parameters.ly_focalLength ,     // boolean     corr_focalLength,  // Correct scales (focal length temperature? variations)
					clt_parameters.ly_ers_rot,          // boolean     ers_rot,           // Enable ERS correction of the camera rotation
					clt_parameters.ly_ers_forw,         // boolean     ers_forw,          // Enable ERS correction of the camera linear movement in z direction
					clt_parameters.ly_ers_side,         // boolean     ers_side,          // Enable ERS correction of the camera linear movement in x direction
					clt_parameters.ly_ers_vert,         // boolean     ers_vert,          // Enable ERS correction of the camera linear movement in y direction
					// add balancing-related here?
					clt_parameters.ly_par_sel,          // 	int         manual_par_sel,    // Manually select the parameter mask bit 0 - sym0, bit1 - sym1, ... (0 - use boolean flags, != 0 - ignore boolean flags)
					clt_parameters.ly_weight_infinity,     //0.3, // double      weight_infinity,     // 0.3, total weight of infinity tiles fraction (0.0 - 1.0) 
					clt_parameters.ly_weight_disparity,    //0.0, // double      weight_disparity,    // 0.0 disparity weight relative to the sum of 8 lazy eye values of the same tile 
					clt_parameters.ly_weight_disparity_inf,//0.5, // double      weight_disparity_inf,// 0.5 disparity weight relative to the sum of 8 lazy eye values of the same tile for infinity 
					clt_parameters.ly_max_disparity_far,   //5.0, // double      max_disparity_far,   // 5.0 reduce weights of near tiles proportional to sqrt(max_disparity_far/disparity) 
					clt_parameters.ly_max_disparity_use,   //5.0, // double      max_disparity_use,   // 5.0 (default 1000)disable near objects completely - use to avoid ERS
					0.0, // clt_parameters.ly_inf_min_dfe,         //1.75,// double      min_dfe, // = 1.75;
					0.0, // clt_parameters.ly_inf_max_dfe,         //5.0, // double      max_dfe, // = 5.0; // <=0 - disable feature
					// moving objects filtering
					false, // clt_parameters.ly_moving_en,  // 	boolean     moving_en,         // enable filtering areas with potentially moving objects 
					clt_parameters.ly_moving_apply,  // 	boolean     moving_apply,      // apply filtering areas with potentially moving objects 
					clt_parameters.ly_moving_sigma,   // 	double      moving_sigma,      // blurring sigma for moving objects = 1.0;
					clt_parameters.ly_max_mov_disparity,  //		double      max_mov_disparity, // disparity limit for moving objects detection = 75.0;
					clt_parameters.ly_rad_to_hdiag_mov,   // 	double      rad_to_hdiag_mov,  // radius to half-diagonal ratio to remove high-distortion corners = 0.7 ; // 0.8
					clt_parameters.ly_max_mov_average,   //		double      max_mov_average,   // do not attempt to detect moving objects if ERS is not accurate for terrain = .25;
					clt_parameters.ly_mov_min_L2,  // 	double      mov_min_L2,        // threshold for moving objects = 0.75;
					lazy_eye_data, // scan.getLazyEyeData(),              // dsxy, // double [][] measured_dsxy,
					force_disparity, // scan.getLazyEyeForceDisparity(),    // null, //	boolean [] force_disparity,    // boolean [] force_disparity,
					false, // 	boolean     use_main, // corr_rots_aux != null;
					last_scene.getGeometryCorrection().getCorrVector(), // CorrVector corr_vector,
					old_new_rms, // double [] old_new_rms, // should be double[2]
					debugLevel); //  + 5);// int debugLevel) >=2 to show images
			if (debugLevel > -2){
				System.out.println("Old extrinsic corrections:");
				System.out.println(last_scene.getGeometryCorrection().getCorrVector().toString());
			}
			if (corr_vector != null) {
				CorrVector diff_corr = corr_vector.diffFromVector(last_scene.getGeometryCorrection().getCorrVector());
				comp_diff = diff_corr.getNorm(); // apply this to all scenes
				if (debugLevel > -2){
					System.out.println("New extrinsic corrections:");
					System.out.println(corr_vector.toString());
				}
				if (debugLevel > -3){
					System.out.println("Increment extrinsic corrections:");
					System.out.println(diff_corr.toString());
				}
				last_scene.gpuResetCorrVector(); // next time GPU will need to set correction vector (and re-calculate offsets?)
				if (apply_extrinsic){
					// Apply correction to all scenes (adding, as ERS can be different)
					// will need to update all scenes GC (write back to disk), but only after all are done
					for (int i = 0; i < quadCLTs.length; i++) {
						QuadCLT scene = quadCLTs[i];
						CorrVector scene_vector = scene.getGeometryCorrection().getCorrVector();
						scene_vector.incrementVector(diff_corr, 1.0); // no scale here
						scene.getGeometryCorrection().setCorrVector(scene_vector);
					}					
					System.out.println("Extrinsic correction updated (can be disabled by setting clt_parameters.ly_corr_scale = 0.0) ");
				} else {
					System.out.println("Correction is not applied according clt_parameters.ly_corr_scale == 0.0) ");
				}
			} else {
				if (debugLevel > -3){
					System.out.println("LMA failed"); // What now?
				}
			}
			boolean done = (comp_diff < min_sym_update) || (num_iter == (max_tries - 1));
			//				  System.out.println("done="+done);
			if (debugLevel > -10) { // should work even in batch mode
				System.out.println("#### extrinsicsCLT(): iteration step = "+(num_iter + 1) + " ( of "+max_tries+") change = "+
						comp_diff + " ("+min_sym_update+"), previous RMS = " + old_new_rms[0]+
						" final RMS = " + old_new_rms[1]+ " (debugLevel = "+debugLevel+")");
			}
			if (debugLevel > -10) {
				if ((debugLevel > -3) || done) {
					System.out.println("New extrinsic corrections:");
					System.out.println(last_scene.getGeometryCorrection().getCorrVector().toString());
				}
			}
			if (comp_diff < min_sym_update) {
				break;
			}
			inf_disp_ref = 0.0; // after first adjustment set infinity to 0.0
		}
// Now update correction vector for all scenes to disk - how was it read?
// update 		
		
		if (debugLevel > -200) {
			return;
		}
@@ -11319,49 +11472,22 @@ if (debugLevel > -100) return true; // temporarily !
					new String[] {"inf tiles", "noinf tiles"});
		}
		/* TODO: move all adjustments there?
		if (lazy_eye_data != null) {
				multisceneLY.processLYdata(
			multisceneLY.processLYdata( // TODO: move all adjustments there?
					clt_parameters,     // final CLTParameters  clt_parameters,
					adjust_mode,        // MSLY_MODE            adjust_mode,	
					quadCLTs,           // final QuadCLT []     scenes,        // ordered by increasing timestamps
						lazy_eye_data,      // final double [][][]  lazy_eye_data,
						debugLevel);        // final int            debugLevel 
				/*
				ExtrinsicAdjustment ea = new ExtrinsicAdjustment (
						last_scene.getErsCorrection(),  // GeometryCorrection gc,
						clt_parameters.lyms_clust_size, // int         clusterSize,
						clustersX,                      // int         clustersX,
						clustersY);                     // int         clustersY)
				double [][][] dbg_cluster = new double [lazy_eye_data.length][ExtrinsicAdjustment.get_INDX_LENGTH(last_scene.getNumSensors())][clustersY * clustersX];
				for (int m = 0; m < lazy_eye_data.length; m++) {
					for (int i = 0; i < dbg_cluster.length; i++) {
						Arrays.fill(dbg_cluster[m][i], Double.NaN);
					}
					for (int n = 0; n < lazy_eye_data[m].length; n++) {
						if (lazy_eye_data[m][n] != null) {
							for (int i = 0; i < ExtrinsicAdjustment.get_INDX_LENGTH(last_scene.getNumSensors()); i++ ) {
								dbg_cluster[m][i][n] = lazy_eye_data[m][n][i];
							}
						}
					}
				}
				for (int m = 0; m < lazy_eye_data.length; m++) {
					(new ShowDoubleFloatArrays()).showArrays(
							dbg_cluster[m],
							clustersX,
							clustersY,
							true,
							last_scene.getImageName()+"-lazy_eye_data-"+m,
							ea.data_titles); //  ExtrinsicAdjustment.DATA_TITLES);
					lazy_eye_data2,      // final double [][][]  lazy_eye_data,
					valid_tile,         // final boolean [][]   valid_tile,        // tile with lma and single correlation maximum
					inf_disp_ref,       // final double         inf_disp_ref,      // average disparity at infinity for ref scene // is_scene_infinity
					is_scene_infinity,  // final boolean [][]   is_scene_infinity, // may be null, if not - may be infinity from the composite depth map
					false,              // boolean              update_disparity, // re-measure disparity before measuring LY
					threadsMax,         // final int            threadsMax,  // maximal number of threads to launch
					updateStatus,       // final boolean        updateStatus,
					debugLevel);        // final int            debugLevel)
		}
		*/
// Testing next step				
				
				
				
				
				
			
		}
		if (debugLevel > -2) {
			System.out.println("adjustLYSeries() Done");
		}