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

correcting wrongly reported exposure

parent 8d207d39
Loading
Loading
Loading
Loading
+150 −39
Original line number Diff line number Diff line
@@ -315,13 +315,13 @@ public class AlignmentCorrection {
				magic_coeff, // still not understood coefficient that reduces reported disparity value.  Seems to be around 8.5  
				debugLevel);

		double [][][] mismatch_corr_coefficiants = null;
		double [][][] mismatch_corr_coefficients = null;
		ArrayList<Mismatch> mismatch_list = use_poly? null : (new ArrayList<Mismatch>());

		mismatch_corr_coefficiants = infinityMismatchCorrection(
		mismatch_corr_coefficients = infinityMismatchCorrection(
				clt_parameters.disp_scan_start, // final double  disp_scan_start,
				clt_parameters.disp_scan_step,  // final double  disp_scan_step,
				use_poly,                        // clt_parameters.ly_poly,        // final boolean use_poly,
				use_poly,                       // final boolean use_poly,
				clt_parameters.fcorr_inf_quad,  // final boolean use_quadratic,
				clt_parameters.fcorr_inf_vert,  // final boolean use_vertical,
				clt_parameters.ly_inf_en,       // final boolean use_disparity, // for infinity 
@@ -335,10 +335,10 @@ public class AlignmentCorrection {
		if (debugLevel > -1){
			System.out.println("infinityCorrection(): coefficient increments from infinityMismatchCorrection");
			show_fine_corr(
					mismatch_corr_coefficiants, // double [][][] corr,
					mismatch_corr_coefficients, // double [][][] corr,
					"");// String prefix)
		}
		return mismatch_corr_coefficiants;
		return mismatch_corr_coefficients;
	}

	/**
@@ -789,7 +789,7 @@ public class AlignmentCorrection {
		Matrix AINV = A.inverse();
		double scale = 0.5/magic_coeff;
		double [][] dbg_xy = null;
		if (debugLevel > 0) {
		if (clt_parameters.show_extrinsic && (debugLevel > -2)) { // TODO: Add clt_parameters
			dbg_xy = new double [9][num_tiles];
		}
		for (Sample s: samples_list){
@@ -1586,11 +1586,45 @@ B = |+dy0 -dy1 -2*dy3 |
		return scans;
	}

	public double [][][] lazyEyeCorrectionStep(
			final boolean    use_poly, // Use polynomial correction, false - correct tilt/azimuth/roll of each sensor
			final double     fcorr_radius,
			final double     min_strength_in,
			final double     max_diff,
			//				final double comp_strength_var,
			final int        max_iterations,
			final double     max_coeff_diff,
			final double     far_pull, //  = 0.2; // 1; //  0.5;
			final double     strength_pow,
			final double     lazyEyeCompDiff, // clt_parameters.fcorr_disp_diff
			final int        lazyEyeSmplSide, //        = 2;      // Sample size (side of a square)
			final int        lazyEyeSmplNum, //         = 3;      // Number after removing worst (should be >1)
			final double     lazyEyeSmplRms, //         = 0.1;    // Maximal RMS of the remaining tiles in a sample
			final double     lazyEyeDispVariation, // maximal full disparity difference between tgh tile and 8 neighborxs
			final int        smplSide, //        = 2;      // Sample size (side of a square)
			final int        smplNum, //         = 3;      // Number after removing worst (should be >1)
			final double     smplRms, //         = 0.1;    // Maximal RMS of the remaining tiles in a sample
			// histogram parameters
			final int        hist_smpl_side, // 8 x8 masked, 16x16 sampled
			final double     hist_disp_min,
			final double     hist_disp_step,
			final int        hist_num_bins,
			final double     hist_sigma,
			final double     hist_max_diff,
			final int        hist_min_samples,
			final boolean    hist_norm_center, // if there are more tiles that fit than min_samples, replace with 
			final double     inf_fraction,    // fraction of the weight for the infinity tiles
			EyesisCorrectionParameters.CLTParameters           clt_parameters,
			double [][]      scans_14,
			int              tilesX,
			double           magic_coeff, // still not understood coefficient that reduces reported disparity value.  Seems to be around 8.5  
			int debugLevel)
		{
			return null;
		}


	public double [][][] lazyEyeCorrection(
//			final double     disp_scan_start,
//			final double     disp_scan_step,
			final boolean    use_poly, // Use polynomial correction, false - correct tilt/azimuth/roll of each sensor
			final double     fcorr_radius,
			final double     min_strength_in,
@@ -1604,7 +1638,9 @@ B = |+dy0 -dy1 -2*dy3 |
			final int        lazyEyeSmplSide, //        = 2;      // Sample size (side of a square)
			final int        lazyEyeSmplNum, //         = 3;      // Number after removing worst (should be >1)
			final double     lazyEyeSmplRms, //         = 0.1;    // Maximal RMS of the remaining tiles in a sample
			final double     lazyEyeDispVariation, // maximal full disparity difference between tgh tile and 8 neighborxs
			final double     lazyEyeDispVariation, // maximal full disparity difference between the tile and 8 neighborxs
			final double     lazyEyeDispRelVariation,
			final double     ly_norm_disp, //  =    5.0;     // Reduce weight of higher disparity tiles
			final int        smplSide, //        = 2;      // Sample size (side of a square)
			final int        smplNum, //         = 3;      // Number after removing worst (should be >1)
			final double     smplRms, //         = 0.1;    // Maximal RMS of the remaining tiles in a sample
@@ -1620,9 +1656,14 @@ B = |+dy0 -dy1 -2*dy3 |
			final double     inf_fraction,    // fraction of the weight for the infinity tiles
			EyesisCorrectionParameters.CLTParameters           clt_parameters,
			double [][]      scans_14,
			double [][]      target_disparity, // null or programmed disparity (1 per each 14 entries of scans_14) 
			int              tilesX,
			double           magic_coeff, // still not understood coefficient that reduces reported disparity value.  Seems to be around 8.5  
			int              debugLevel){
		
//		final double lazyEyeDispRelVariation = 0.02;
		
		final int dbg_nTile = -59038;
		final int num_scans = scans_14.length/NUM_ALL_SLICES;
		final int num_tiles = scans_14[0].length;
		final int tilesY = num_tiles/tilesX; 
@@ -1671,7 +1712,15 @@ B = |+dy0 -dy1 -2*dy3 |
				lazyEyeSmplRms, // final double     smplRms, //         = 0.1;    // Maximal RMS of the remaining tiles in a sample
				tilesX);// final int        tilesX);

		if (debugLevel > -1) {
		if (debugLevel > -2) { // -2) { //  100) {
			(new showDoubleFloatArrays()).showArrays(filtered_scans, tilesX, tilesY, true, "filtered_scans");
			if (debugLevel > -1) { // -2) { //  100) {
				(new showDoubleFloatArrays()).showArrays(scans, tilesX, tilesY, true, "scans");
				(new showDoubleFloatArrays()).showArrays(target_disparity, tilesX, tilesY, true, "target_disparity");
			}
		}

		if (debugLevel > -2) {
			System.out.println("lazyEyeCorrection() 1: removing tiles with residual disparity absoulte value > "+lazyEyeCompDiff);
		}

@@ -1679,6 +1728,9 @@ B = |+dy0 -dy1 -2*dy3 |
		double [] combo_comp_rms = new double [num_tiles];
		for (int ns = 0; ns < num_scans; ns++){
			for (int nTile = 0; nTile < num_tiles; nTile++) {
				if (nTile == dbg_nTile){
					System.out.println("lazyEyeCorrection().1: nTile="+nTile);
				}
				double w = filtered_scans[ns * NUM_SLICES + 1][nTile];
				if (w > 0.0){
					double disp = filtered_scans[ns * NUM_SLICES + 0][nTile];
@@ -1686,9 +1738,15 @@ B = |+dy0 -dy1 -2*dy3 |
						for (int i = 2; i < NUM_SLICES; i++) if (i != 1){
							combo_mismatch[i][nTile] += filtered_scans[ns * NUM_SLICES + i][nTile] * w;
						}
						if (target_disparity != null){
							combo_mismatch[0][nTile] += (
									filtered_scans[ns * NUM_SLICES + 0][nTile]/clt_parameters.corr_magic_scale +
								clt_parameters.disp_scan_start + clt_parameters.disp_scan_step * ns)* w;
									target_disparity[ns][nTile])* w;
						} else {
							combo_mismatch[0][nTile] += (
									filtered_scans[ns * NUM_SLICES + 0][nTile]/clt_parameters.corr_magic_scale +
									(clt_parameters.disp_scan_start + clt_parameters.disp_scan_step * ns ) )* w;
						}
						combo_mismatch[1][nTile] += w;
						combo_comp_rms[nTile] += w * comp_strength_rms[ns][nTile];
					}
@@ -1697,6 +1755,10 @@ B = |+dy0 -dy1 -2*dy3 |
		}

		for (int nTile = 0; nTile < num_tiles; nTile++) {
			if (nTile == dbg_nTile){
				System.out.println("lazyEyeCorrection().2: nTile="+nTile);
			}
			
			double w = combo_mismatch[1][nTile];
			if (w > 0.0){
				for (int i = 0; i < NUM_SLICES; i++) if (i != 1){
@@ -1711,19 +1773,35 @@ B = |+dy0 -dy1 -2*dy3 |
			}
		}

		if (debugLevel > 0) { //  100) {
		// reduce influence of high disparity
//		double norm_ly_disparity = 100.0; // disabling
		for (int nTile = 0; nTile < num_tiles; nTile++) {
			if (combo_mismatch[0][nTile] > ly_norm_disp) {
				combo_mismatch[1][nTile] *= ly_norm_disp/combo_mismatch[0][nTile];
			}
		}
		
		
		
		
		if (debugLevel > 0) { // -2) { //  100) {
			(new showDoubleFloatArrays()).showArrays(combo_comp_rms, tilesX, tilesY, "combo_comp_rms");
		}

		final TileNeibs tnImage = new TileNeibs(tilesX, tilesY); // num_tiles/tilesX);
		for (int nTile = 0; nTile < num_tiles; nTile++) if (combo_mismatch[1][nTile] > 0.0){
			if (nTile == dbg_nTile){
				System.out.println("lazyEyeCorrection().3: nTile="+nTile);
			}
			double d = combo_mismatch[0][nTile];
			double lev = lazyEyeDispVariation + lazyEyeDispRelVariation * d;
			for (int dir = 0; dir <8; dir++){
				int nTile1 = tnImage.getNeibIndex(nTile, dir);
				if ((nTile1 >= 0) && (combo_mismatch[1][nTile1] > 0.0)){
					if (Math.abs(combo_mismatch[0][nTile1] - d) > lazyEyeDispVariation){
					if (Math.abs(combo_mismatch[0][nTile1] - d) > lev) { // azyEyeDispVariation){
						combo_mismatch[1][nTile] = 0.0;
						for (int i = 0; i < NUM_SLICES; i++) if (i != 1){
//						for (int i = 0; i < NUM_SLICES; i++) if (i != 1){
						for (int i = 2; i < NUM_SLICES; i++) if (i != 1){
							combo_mismatch[i][nTile] = Double.NaN;
						}
						break;
@@ -1732,7 +1810,7 @@ B = |+dy0 -dy1 -2*dy3 |
			}
		}			

		if (debugLevel > 0) {
		if (debugLevel > 0) { // 0) {
			String [] prefixes = {"disparity", "strength", "dx0", "dy0", "dx1", "dy1", "dx2", "dy2", "dx3", "dy3"};
			(new showDoubleFloatArrays()).showArrays(combo_mismatch, tilesX, combo_mismatch[0].length/tilesX, true, "combo_mismatch" , prefixes);
		}
@@ -1939,7 +2017,7 @@ B = |+dy0 -dy1 -2*dy3 |
			}
		}

		if (debugLevel > -1) {
		if (debugLevel > 0) {
			double inf_weight = 0.0;
			for (Sample s: inf_samples_list) {
				inf_weight += s.weight;
@@ -1956,7 +2034,7 @@ B = |+dy0 -dy1 -2*dy3 |
					titles[ns * NUM_SLICES + i] = prefixes[i]+"_"+ns;
				}
			}
			(new showDoubleFloatArrays()).showArrays(filtered_scans, tilesX, tilesY, true, "filtered_scans" , titles);
			(new showDoubleFloatArrays()).showArrays(filtered_scans, tilesX, tilesY, true, "filtered_scans_a" , titles);
		}


@@ -1965,10 +2043,10 @@ B = |+dy0 -dy1 -2*dy3 |
			(new showDoubleFloatArrays()).showArrays(combo_mismatch, tilesX, combo_mismatch[0].length/tilesX, true, "combo_mismatch" , prefixes);
		}
		ArrayList<Mismatch> mismatch_list = use_poly? null : (new ArrayList<Mismatch>());
		double [][][] mismatch_corr_coefficiants = infinityMismatchCorrection(
		double [][][] mismatch_corr_coefficients = infinityMismatchCorrection(
				clt_parameters.disp_scan_start, // final double  disp_scan_start,
				clt_parameters.disp_scan_step, // final double  disp_scan_step,
				use_poly,                        // clt_parameters.ly_poly,        // final boolean use_poly, 
				use_poly,                       // final boolean use_poly, 
				clt_parameters.fcorr_quadratic, // final boolean use_quadratic,
				true, // clt_parameters.fcorr_inf_vert,  // final boolean use_vertical,
				false,                          // final boolean use_disparity, // for infinity 
@@ -1979,23 +2057,27 @@ B = |+dy0 -dy1 -2*dy3 |
				magic_coeff,                    // double      , // still not understood coefficient that reduces reported disparity value.  Seems to be around 8.5
				mismatch_list,                  // ArrayList<Mismatch> mismatch_list,
				debugLevel);                    // int debugLevel)
		if (debugLevel > -1) {
		if (debugLevel > -2) {
			System.out.println("===== lazyEyeCorrection(): correction coefficients =====");
			if (mismatch_corr_coefficiants != null) {
			if (mismatch_corr_coefficients != null) {
				show_fine_corr(
						mismatch_corr_coefficiants,
						"mismatch_corr_coefficiants");
						mismatch_corr_coefficients,
						"mismatch_corr_coefficients");
			}
		}
		if (!use_poly && (mismatch_list != null)){
			double [] old_new_rms = new double[1];
			boolean apply_extrinsic = true;
			GeometryCorrection.CorrVector corr_vector = solveCorr (
					clt_parameters.ly_inf_en,    // boolean use_disparity,     // if true will ignore disparity data even if available (was false)
					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_com_roll,  // boolean    common_roll,    // Enable common roll (valid for high disparity range only) 

					mismatch_list,                          // ArrayList<Mismatch> mismatch_list,
					qc.geometryCorrection,                  // GeometryCorrection geometryCorrection,
					qc.geometryCorrection.getCorrVector(),  // GeometryCorrection.CorrVector corr_vector,
					2); // 1); // int debugLevel)
					old_new_rms,                            // double [] old_new_rms, // should be double[2]
					debugLevel); // 2); // 1); // int debugLevel)
			if (debugLevel > -1){
				System.out.println("Old extrinsic corrections:");
				System.out.println(qc.geometryCorrection.getCorrVector().toString());
@@ -2009,14 +2091,20 @@ B = |+dy0 -dy1 -2*dy3 |
					System.out.println(qc.geometryCorrection.getCorrVector().toString());
				}
			}
			mismatch_corr_coefficients = new double [1][2][];
			mismatch_corr_coefficients[0][0] = corr_vector.toSymArray(null);
//			mismatch_corr_coefficients[0][1] = new double[1];
//			old_new_rms[1] = getRMS(getYminusFx(mismatch_list), getWeights(mismatch_list));
			mismatch_corr_coefficients[0][1] = old_new_rms;
		} else {
			if (debugLevel > -1){
				System.out.println("Extrinsic parameters (tilt, azimuth, roll) of subcameras is disabled, clt_parameters.ly_poly="+
						clt_parameters.ly_poly+" (should be false for extrinsics)");
			if (debugLevel > -2){
				System.out.println("Extrinsic parameters (tilt, azimuth, roll) of subcameras is disabled, use_poly="+
						use_poly+" (should be false for extrinsics)");
				System.out.println(qc.geometryCorrection.getCorrVector().toString());
			}
			return mismatch_corr_coefficients;			
		}
		return mismatch_corr_coefficiants;			
		return mismatch_corr_coefficients;			
	}

	public double [][] combineCltMismatches(
@@ -2458,9 +2546,12 @@ B = |+dy0 -dy1 -2*dy3 |
			boolean use_disparity,     // if true will ignore disparity data even if available
			boolean force_convergence, // if true try to adjust convergence (disparity, symmetrical parameter 0) even with no disparity
			                           // data, using just radial distortions 
	  		boolean    common_roll,    // Enable common roll (valid for high disparity range only) 
			
			ArrayList<Mismatch> mismatch_list,
			GeometryCorrection geometryCorrection,
			GeometryCorrection.CorrVector corr_vector,
			double [] old_new_rms, // should be double[2]
			int debugLevel)
	{
		boolean has_disparity = force_convergence; // force false;
@@ -2471,10 +2562,26 @@ B = |+dy0 -dy1 -2*dy3 |
				break;
			}
		}
		boolean [] par_mask = new boolean[10];
		for (int i = (has_disparity ? 0 : 1); i < par_mask.length; i++){
			par_mask[i] = true;
		}
//		boolean [] par_mask = new boolean[10];
//		for (int i = (has_disparity ? 0 : 1); i < par_mask.length; i++){
//			par_mask[i] = true;
//		}
		boolean [] par_mask = geometryCorrection.getParMask(
				has_disparity, // boolean use_disparity,
				common_roll); // boolean common_roll);
/*			{ // TODO: move to GeometryCorrection
				has_disparity, //sym0
				true,          //sym1
				true,          //sym2
				true,          //sym3
				true,          //sym4
				true,          //sym5
				common_roll,   //sym6 // common roll
				true,          //sym7
				true,          //sym8
				true           //sym9
		};
		*/
		
		double [][] jta = getJacobianTransposed(
				par_mask,           // boolean [] par_mask,
@@ -2502,6 +2609,10 @@ B = |+dy0 -dy1 -2*dy3 |
		if (debugLevel > -1){
			System.out.println("--- solveCorr(): initial RMS = " + rms0);
		}
		
		if (old_new_rms != null){
			old_new_rms[0] =rms0;
		}
		Matrix y_minus_fx_weighted = new Matrix(y_minus_fx_a_weighted, y_minus_fx_a_weighted.length);
//		double [][] jtja = getJTJ(jta, weights);
		double [][] jtja = getJTJ(jta_mv, weights);
+55 −14
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import java.awt.Rectangle;
import java.util.concurrent.atomic.AtomicInteger;

public class CLTPass3d{
//	static double  max_overexposed = 0.8; // TODO: make parameter
		public   double [][]    disparity; // per-tile disparity set for the pass[tileY][tileX] 
		public   int    [][]    tile_op;   // what was done in the current pass
		private  double [][]    disparity_sav; // saved disaprity 
@@ -192,8 +193,7 @@ public class CLTPass3d{
		 */
		public void resetProcessed(){ 
			
			fixNaNDisparity();
			
			if (disparity_map != null) fixNaNDisparity();
			calc_disparity =       null; // composite disparity, calculated from "disparity", and "disparity_map" fields
			calc_disparity_hor =   null; // composite disparity, calculated from "disparity", and "disparity_map" fields
			calc_disparity_vert =  null; // composite disparity, calculated from "disparity", and "disparity_map" fields
@@ -357,6 +357,11 @@ public class CLTPass3d{
			return disparity;
		}

		public double [] getOverexposedFraction(){
			return (disparity_map != null)? disparity_map[ImageDtt.OVEREXPOSED] : null;
		}
		
		
		/**
		 * Returns per-tile correlation "strength". Initially - copy of the FPGA-generated data, but later may be replaced by a combination
		 * of the combined data from 4-sensor (4-pair) correlation and horizontal/vertical pairs only to improve detection of vertical/
@@ -365,6 +370,7 @@ public class CLTPass3d{
		 */
		public double [] getStrength(){
			double trustedCorrelation = tileProcessor.getTrustedCorrelation();
			double max_overexposure = tileProcessor.getMaxOverexposure();
			if (strength == null){
				strength =  disparity_map[ImageDtt.DISPARITY_STRENGTH_INDEX].clone();
				if (trustedCorrelation > 0.0){
@@ -372,6 +378,12 @@ public class CLTPass3d{
						if (Math.abs(disparity_map[disparity_index][i]) > trustedCorrelation) strength[i] = 0.0; // too far 
					}
				}
				double [] overexposed = disparity_map[ImageDtt.OVEREXPOSED];
				if ((max_overexposure > 0.0) && (overexposed != null)){
					for (int i = 0; i < strength.length; i++){
						if (overexposed[i] > max_overexposure) strength[i] = 0.0; // too overexposed 
					}
				}
			}
			return strength;
		}
@@ -388,6 +400,7 @@ public class CLTPass3d{
		 */
		public double [] getHorStrength(){
			double trustedCorrelation = tileProcessor.getTrustedCorrelation();
			double max_overexposure = tileProcessor.getMaxOverexposure();
			if (strength_hor == null) {
				strength_hor = disparity_map[ImageDtt.DISPARITY_INDEX_HOR_STRENGTH].clone();
				if (trustedCorrelation > 0.0){
@@ -395,15 +408,23 @@ public class CLTPass3d{
						if (Math.abs(disparity_map[ImageDtt.DISPARITY_INDEX_HOR][i]) > trustedCorrelation) strength_hor[i] = 0.0; // too far 
					}
				}
				double [] overexposed = disparity_map[ImageDtt.OVEREXPOSED];
				if ((max_overexposure > 0.0) && (overexposed != null)){
					for (int i = 0; i < strength_hor.length; i++){
						if (overexposed[i] > max_overexposure) strength_hor[i] = 0.0; // too overexposed 
					}
				}
				
			}
			return strength_hor;
		}
		/**
		 * Get veriical pairs correlation strength for horizontal features. Not a copy
		 * Get vertical pairs correlation strength for horizontal features. Not a copy
		 * @return line-scan array of per-tile horizontal pairs correlation strength by reference (not a copy)
		 */
		public double [] getVertStrength(){
			double trustedCorrelation = tileProcessor.getTrustedCorrelation();
			double max_overexposure = tileProcessor.getMaxOverexposure();
			if (strength_vert == null) {
				strength_vert = disparity_map[ImageDtt.DISPARITY_INDEX_VERT_STRENGTH].clone();
				if (trustedCorrelation > 0.0){
@@ -411,6 +432,12 @@ public class CLTPass3d{
						if (Math.abs(disparity_map[ImageDtt.DISPARITY_INDEX_VERT][i]) > trustedCorrelation) strength_vert[i] = 0.0; // too far 
					}
				}
				double [] overexposed = disparity_map[ImageDtt.OVEREXPOSED];
				if ((max_overexposure > 0.0) && (overexposed != null)){
					for (int i = 0; i < strength_hor.length; i++){
						if (overexposed[i] > max_overexposure) strength_vert[i] = 0.0; // too overexposed 
					}
				}
				
			}
			return strength_vert;
@@ -704,6 +731,7 @@ public class CLTPass3d{
					selection,  // boolean [] selection,
					disparity); // double []  disparity)
		}
		
		public int setTileOpDisparity(
				int        tile_op,
				boolean [] selection,
@@ -712,13 +740,21 @@ public class CLTPass3d{
			final int tilesX = tileProcessor.getTilesX();
			final int tilesY = tileProcessor.getTilesY();
			this.disparity =   new double [tilesY][tilesX];
			if (selection != null) {
				this.tile_op =     new int [tilesY][tilesX];
			}
			int num_op_tiles = 0;

			for (int ty = 0; ty < tilesY; ty++) for (int tx = 0; tx <tilesX; tx++){
				int indx =  tilesX * ty + tx;
				if (this.selected[indx]) {
					this.disparity[ty][tx] = disparity[indx];
				if (selection == null) {
					this.disparity[ty][tx] = (disparity == null)? 0.0: disparity[indx];
					if (this.tile_op[ty][tx] != 0){
						num_op_tiles ++;
					}
				} else {
					if (selection[indx]) {
						this.disparity[ty][tx] = (disparity == null)? 0.0: disparity[indx];
						this.tile_op[ty][tx] = tile_op;
						num_op_tiles ++;
					} else {
@@ -726,12 +762,17 @@ public class CLTPass3d{
						this.tile_op[ty][tx] = 0;
					}
				}
			}
			return num_op_tiles;
		}
		
		
		
		
		/**
		 * Set next measurement disparity from last calculated
		 */
		public void updateDisparity()
		{
			setTileOpDisparity(null, getDisparity(0));
		}
		
		
		public double [] getSecondMaxDiff (
+135 −17

File changed.

Preview size limit exceeded, changes collapsed.

+24 −13
Original line number Diff line number Diff line
@@ -78,7 +78,8 @@ private Panel panel1,
         panelPostProcessing3,
         panelDct1,
         panelClt1,
         panelClt2
         panelClt2,
         panelClt3
         ;
   JP46_Reader_camera JP4_INSTANCE=null;

@@ -370,7 +371,7 @@ private Panel panel1,

		instance = this;
		addKeyListener(IJ.getInstance());
		int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?3:0);
		int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?4:0);
		setLayout(new GridLayout(menuRows, 1));

		panel6 = new Panel();
@@ -518,16 +519,6 @@ private Panel panel1,
			panelClt2 = new Panel();
			panelClt2.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
			addButton("Setup CLT parameters",      panelClt2, color_configure);
//			addButton("Select CLT image",          panelClt2, color_configure);
//			addButton("CLT stack",                 panelClt2, color_process);
//			addButton("Select second CLT image",   panelClt2, color_configure);
//			addButton("CLT correlate",             panelClt2, color_process);
//			addButton("Create CLT kernels",        panelClt2, color_process);
//			addButton("Read CLT kernels",          panelClt2, color_process);
//			addButton("Reset CLT kernels",         panelClt2, color_stop);
//			addButton("CLT process files",         panelClt2, color_process);
//			addButton("CLT process sets",          panelClt2, color_process);
//			addButton("CLT process quads",         panelClt2, color_process);
			addButton("CLT 4 images",          panelClt2, color_conf_process);
			addButton("CLT disparity scan",        panelClt2, color_conf_process);
			addButton("CLT reset fine corr",       panelClt2, color_stop);
@@ -539,6 +530,8 @@ private Panel panel1,
			addButton("CLT infinity corr",         panelClt2, color_conf_process);
			addButton("CLT ext infinity corr",     panelClt2, color_conf_process);
			addButton("CLT reset 3D",              panelClt2, color_stop);
			addButton("CLT Extrinsics",            panelClt2, color_process);
			addButton("CLT Poly corr",             panelClt2, color_process);
			addButton("CLT 3D",                    panelClt2, color_process);
			addButton("CLT planes",                panelClt2, color_conf_process);
			addButton("CLT ASSIGN",                panelClt2, color_process);
@@ -546,6 +539,14 @@ private Panel panel1,
						
			add(panelClt2);
		}
		if (DCT_MODE) {
			panelClt3 = new Panel();
			panelClt3.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
			addButton("Setup CLT Batch parameters", panelClt3, color_configure);
			addButton("Setup CLT parameters",       panelClt3, color_configure);
			addButton("CLT Batch process",          panelClt3, color_process);
			add(panelClt3);
		}
		pack();

		GUI.center(this);
@@ -3667,6 +3668,12 @@ private Panel panel1,
//		EyesisCorrectionParameters.DCTParameters dCTParameters,
//		int srcKernelSize,
        EYESIS_DCT.showKernels(); // show restored kernels
/* ======================================================================== */
    } else if (label.equals("Setup CLT Batch parameters")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	CORRECTION_PARAMETERS.showCLTDialog("CLT Batch parameters");
    	return;
        
/* ======================================================================== */
    } else if (label.equals("Setup CLT parameters")) {
    	CLT_PARAMETERS.showDialog();
@@ -4762,7 +4769,9 @@ private Panel panel1,
        
/// ============================================
        
    } else if (label.equals("CLT 3D")) {
    } else if (label.equals("CLT 3D") || label.equals("CLT Extrinsics") || label.equals("CLT Poly corr")) {
    	boolean adjust_extrinsics = label.equals("CLT Extrinsics") || label.equals("CLT Poly corr");
    	boolean adjust_poly = label.equals("CLT Poly corr");
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
        if (QUAD_CLT == null){
@@ -4834,6 +4843,8 @@ private Panel panel1,
        }
        
        QUAD_CLT.processCLTQuads3d(
        		adjust_extrinsics, // boolean adjust_extrinsics,
        		adjust_poly,       // boolean adjust_poly,
        		CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
        		DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
        		NONLIN_PARAMETERS, //EyesisCorrectionParameters.NonlinParameters       nonlinParameters,
+89 −22

File changed.

Preview size limit exceeded, changes collapsed.

Loading