Commit 26cdc535 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Implementing batch mode for EO/LWIR images

parent be9da419
Loading
Loading
Loading
Loading
+74 −11
Original line number Original line Diff line number Diff line
@@ -181,7 +181,15 @@ public class CLTParameters {
	public int        ly_par_sel   =    0;       // Manually select the parameter mask bit 0 - sym0, bit1 - sym1, ... (0 - use checkbox selections above)
	public int        ly_par_sel   =    0;       // Manually select the parameter mask bit 0 - sym0, bit1 - sym1, ... (0 - use checkbox selections above)


	public boolean    ly_right_left=    false;   // equalize weights of right/left FoV (use with horizon in both halves and gross infinity correction)
	public boolean    ly_right_left=    false;   // equalize weights of right/left FoV (use with horizon in both halves and gross infinity correction)
	public double     ly_inf_frac =     0.5;     // Relative weight of infinity calibration data

	public int        ly_per_quad =     10;      // minimal tiles per quadrant (not counting the worst) tp proceed
	public double     ly_per_quad_r =   0.01;    // minimal relative tiles per quadrant (not counting the worst) tp proceed
	public int        ly_inf =          10;      // minimal number of tiles at infinity to proceed
	public double     ly_inf_r =        0.01;    // minimal relative number of tiles at infinity to proceed
	public int        ly_inf_scale =    20;      // minimal number of tiles at infinity to apply weight scaling
	public double     ly_inf_scale_r =  0.02;    // minimal relative number of tiles at infinity to apply weight scaling

	public double     ly_inf_frac =     0.7;     // Relative weight of infinity calibration data
	public double     ly_inf_max_disparity = 0.2;   // Maximal disparity to be treated as infinity when adjusting with rig data
	public double     ly_inf_max_disparity = 0.2;   // Maximal disparity to be treated as infinity when adjusting with rig data
	public boolean    ly_inf_disp=      false;   // Correct disparity for infinity tiles
	public boolean    ly_inf_disp=      false;   // Correct disparity for infinity tiles
	public boolean    ly_inf_force=     false;   // Force convergence correction during extrinsic, even with no infinity data
	public boolean    ly_inf_force=     false;   // Force convergence correction during extrinsic, even with no infinity data
@@ -191,8 +199,14 @@ public class CLTParameters {
	public int        ly_smpl_num =     5;       // Number after removing worst (should be >1)
	public int        ly_smpl_num =     5;       // Number after removing worst (should be >1)
	// 		public double     ly_meas_disp =    1.5;     // Maximal measured relative disparity - using  (0.8*disp_scan_step)
	// 		public double     ly_meas_disp =    1.5;     // Maximal measured relative disparity - using  (0.8*disp_scan_step)
	public double     ly_smpl_rms =     0.2;     // 1;     // Maximal RMS of the remaining tiles in a sample
	public double     ly_smpl_rms =     0.2;     // 1;     // Maximal RMS of the remaining tiles in a sample
	public double     ly_disp_var =     0.5;     // 2;     // Maximal full disparity difference to 8 neighbors

	public double     ly_disp_rvar =    0.02;    // Maximal relative full disparity difference to 8 neighbors
	public double     ly_disp_var =     0.1;     // Maximal full disparity difference to 8 neighbors
	public double     ly_disp_rvar =    0.01;    // Maximal relative full disparity difference to 8 neighbors

	public double     ly_disp_var_gt =  0.5;     // Maximal full disparity difference to 8 neighbors when  GT is available
	public double     ly_disp_rvar_gt = 0.05;    // Maximal relative full disparity difference to 8 neighbors when  GT is available


	public double     ly_norm_disp =    5.0;     // Reduce weight of higher disparity tiles
	public double     ly_norm_disp =    5.0;     // Reduce weight of higher disparity tiles


	// Lazy eye multi-step fitting
	// Lazy eye multi-step fitting
@@ -796,6 +810,15 @@ public class CLTParameters {
		return aux ? lym_change_aux : lym_change;
		return aux ? lym_change_aux : lym_change;
	}
	}


	public int getLyPerQuad (int num_tiles) {
		return (int) Math.max(ly_per_quad_r * num_tiles , ly_per_quad );
	}
	public int getLyInf (int num_tiles) {
		return (int) Math.max(ly_inf_r * num_tiles , ly_inf );
	}
	public int getLyInfScale (int num_tiles) {
		return (int) Math.max(ly_inf_scale_r * num_tiles , ly_inf_scale );
	}


	public CLTParameters(){}
	public CLTParameters(){}
	public void setProperties(String prefix,Properties properties){
	public void setProperties(String prefix,Properties properties){
@@ -945,6 +968,13 @@ public class CLTParameters {
		properties.setProperty(prefix+"ly_par_sel",                 this.ly_par_sel+"");
		properties.setProperty(prefix+"ly_par_sel",                 this.ly_par_sel+"");
		properties.setProperty(prefix+"ly_right_left",              this.ly_right_left+"");
		properties.setProperty(prefix+"ly_right_left",              this.ly_right_left+"");


		properties.setProperty(prefix+"ly_per_quad",                this.ly_per_quad +"");
		properties.setProperty(prefix+"ly_per_quad_r",              this.ly_per_quad_r +"");
		properties.setProperty(prefix+"ly_inf",                     this.ly_inf +"");
		properties.setProperty(prefix+"ly_inf_r",                   this.ly_inf_r +"");
		properties.setProperty(prefix+"ly_inf_scale",               this.ly_inf_scale +"");
		properties.setProperty(prefix+"ly_inf_scale_r",             this.ly_inf_scale_r +"");

		properties.setProperty(prefix+"ly_inf_frac",                this.ly_inf_frac +"");
		properties.setProperty(prefix+"ly_inf_frac",                this.ly_inf_frac +"");


		properties.setProperty(prefix+"ly_inf_max_disparity",       this.ly_inf_max_disparity +"");
		properties.setProperty(prefix+"ly_inf_max_disparity",       this.ly_inf_max_disparity +"");
@@ -957,6 +987,8 @@ public class CLTParameters {
		properties.setProperty(prefix+"ly_smpl_rms",                this.ly_smpl_rms +"");
		properties.setProperty(prefix+"ly_smpl_rms",                this.ly_smpl_rms +"");
		properties.setProperty(prefix+"ly_disp_var",                this.ly_disp_var +"");
		properties.setProperty(prefix+"ly_disp_var",                this.ly_disp_var +"");
		properties.setProperty(prefix+"ly_disp_rvar",               this.ly_disp_rvar +"");
		properties.setProperty(prefix+"ly_disp_rvar",               this.ly_disp_rvar +"");
		properties.setProperty(prefix+"ly_disp_var_gt",             this.ly_disp_var_gt +"");
		properties.setProperty(prefix+"ly_disp_rvar_gt",            this.ly_disp_rvar_gt +"");
		properties.setProperty(prefix+"ly_norm_disp",               this.ly_norm_disp +"");
		properties.setProperty(prefix+"ly_norm_disp",               this.ly_norm_disp +"");
		properties.setProperty(prefix+"lym_overexp",                this.lym_overexp +"");
		properties.setProperty(prefix+"lym_overexp",                this.lym_overexp +"");
		properties.setProperty(prefix+"lym_update_disp",            this.lym_update_disp+"");
		properties.setProperty(prefix+"lym_update_disp",            this.lym_update_disp+"");
@@ -1653,6 +1685,13 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"ly_par_sel")!=null)                    this.ly_par_sel=Integer.parseInt(properties.getProperty(prefix+"ly_par_sel"));
		if (properties.getProperty(prefix+"ly_par_sel")!=null)                    this.ly_par_sel=Integer.parseInt(properties.getProperty(prefix+"ly_par_sel"));
		if (properties.getProperty(prefix+"ly_right_left")!=null)                 this.ly_right_left=Boolean.parseBoolean(properties.getProperty(prefix+"ly_right_left"));
		if (properties.getProperty(prefix+"ly_right_left")!=null)                 this.ly_right_left=Boolean.parseBoolean(properties.getProperty(prefix+"ly_right_left"));


		if (properties.getProperty(prefix+"ly_per_quad")!=null)                   this.ly_per_quad=Integer.parseInt(properties.getProperty(prefix+"ly_per_quad"));
		if (properties.getProperty(prefix+"ly_per_quad_r")!=null)                 this.ly_per_quad_r=Double.parseDouble(properties.getProperty(prefix+"ly_per_quad_r"));
		if (properties.getProperty(prefix+"ly_inf")!=null)                        this.ly_inf=Integer.parseInt(properties.getProperty(prefix+"ly_inf"));
		if (properties.getProperty(prefix+"ly_inf_r")!=null)                      this.ly_inf_r=Double.parseDouble(properties.getProperty(prefix+"ly_inf_r"));
		if (properties.getProperty(prefix+"ly_inf_scale")!=null)                  this.ly_inf_scale=Integer.parseInt(properties.getProperty(prefix+"ly_inf_scale"));
		if (properties.getProperty(prefix+"ly_inf_scale_r")!=null)                this.ly_inf_scale_r=Double.parseDouble(properties.getProperty(prefix+"ly_inf_scale_r"));

		if (properties.getProperty(prefix+"ly_inf_frac")!=null)                   this.ly_inf_frac=Double.parseDouble(properties.getProperty(prefix+"ly_inf_frac"));
		if (properties.getProperty(prefix+"ly_inf_frac")!=null)                   this.ly_inf_frac=Double.parseDouble(properties.getProperty(prefix+"ly_inf_frac"));
		if (properties.getProperty(prefix+"ly_inf_max_disparity")!=null)          this.ly_inf_max_disparity=Double.parseDouble(properties.getProperty(prefix+"ly_inf_max_disparity"));
		if (properties.getProperty(prefix+"ly_inf_max_disparity")!=null)          this.ly_inf_max_disparity=Double.parseDouble(properties.getProperty(prefix+"ly_inf_max_disparity"));


@@ -1668,6 +1707,8 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"ly_smpl_rms")!=null)                   this.ly_smpl_rms=Double.parseDouble(properties.getProperty(prefix+"ly_smpl_rms"));
		if (properties.getProperty(prefix+"ly_smpl_rms")!=null)                   this.ly_smpl_rms=Double.parseDouble(properties.getProperty(prefix+"ly_smpl_rms"));
		if (properties.getProperty(prefix+"ly_disp_var")!=null)                   this.ly_disp_var=Double.parseDouble(properties.getProperty(prefix+"ly_disp_var"));
		if (properties.getProperty(prefix+"ly_disp_var")!=null)                   this.ly_disp_var=Double.parseDouble(properties.getProperty(prefix+"ly_disp_var"));
		if (properties.getProperty(prefix+"ly_disp_rvar")!=null)                  this.ly_disp_rvar=Double.parseDouble(properties.getProperty(prefix+"ly_disp_rvar"));
		if (properties.getProperty(prefix+"ly_disp_rvar")!=null)                  this.ly_disp_rvar=Double.parseDouble(properties.getProperty(prefix+"ly_disp_rvar"));
		if (properties.getProperty(prefix+"ly_disp_var_gt")!=null)                this.ly_disp_var_gt=Double.parseDouble(properties.getProperty(prefix+"ly_disp_var_gt"));
		if (properties.getProperty(prefix+"ly_disp_rvar_gt")!=null)               this.ly_disp_rvar_gt=Double.parseDouble(properties.getProperty(prefix+"ly_disp_rvar_gt"));
		if (properties.getProperty(prefix+"ly_norm_disp")!=null)                  this.ly_norm_disp=Double.parseDouble(properties.getProperty(prefix+"ly_norm_disp"));
		if (properties.getProperty(prefix+"ly_norm_disp")!=null)                  this.ly_norm_disp=Double.parseDouble(properties.getProperty(prefix+"ly_norm_disp"));
		if (properties.getProperty(prefix+"lym_overexp")!=null)                   this.lym_overexp=Double.parseDouble(properties.getProperty(prefix+"lym_overexp"));
		if (properties.getProperty(prefix+"lym_overexp")!=null)                   this.lym_overexp=Double.parseDouble(properties.getProperty(prefix+"lym_overexp"));
		if (properties.getProperty(prefix+"lym_update_disp")!=null)               this.lym_update_disp=Boolean.parseBoolean(properties.getProperty(prefix+"lym_update_disp"));
		if (properties.getProperty(prefix+"lym_update_disp")!=null)               this.lym_update_disp=Boolean.parseBoolean(properties.getProperty(prefix+"lym_update_disp"));
@@ -2227,6 +2268,8 @@ public class CLTParameters {
		//  			GenericDialog gd = new GenericDialog("Set CLT parameters");
		//  			GenericDialog gd = new GenericDialog("Set CLT parameters");
		GenericJTabbedDialog gd = new GenericJTabbedDialog("Set CLT parameters",800,900);
		GenericJTabbedDialog gd = new GenericJTabbedDialog("Set CLT parameters",800,900);
		gd.addTab         ("General", "General parameters");
		gd.addTab         ("General", "General parameters");
		gd.addNumericField("Nominal (rectilinear) disparity between side of square cameras (pix)",              this.disparity,  3,7,"pix",
				"Used when rendering 4 images");
		gd.addNumericField("Transform size (default 8)",                                                        this.transform_size,            0, 6, "pixels","Should always be 8");
		gd.addNumericField("Transform size (default 8)",                                                        this.transform_size,            0, 6, "pixels","Should always be 8");
		gd.addNumericField("Lapped transform window type (0- rectangular, 1 - sinus)",                          this.clt_window,                0);
		gd.addNumericField("Lapped transform window type (0- rectangular, 1 - sinus)",                          this.clt_window,                0);
		gd.addNumericField("shift_x",                                                                           this.shift_x,                   4);
		gd.addNumericField("shift_x",                                                                           this.shift_x,                   4);
@@ -2261,8 +2304,6 @@ public class CLTParameters {
		gd.addNumericField("Value (max) in vignetting data to correspond to 1x in the kernel",                  this.vignetting_max,      3);
		gd.addNumericField("Value (max) in vignetting data to correspond to 1x in the kernel",                  this.vignetting_max,      3);
		gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max",                this.vignetting_range,  3);
		gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max",                this.vignetting_range,  3);
		gd.addNumericField("Kernel step in pixels (has 1 kernel margin on each side)",                          this.kernel_step,            0);
		gd.addNumericField("Kernel step in pixels (has 1 kernel margin on each side)",                          this.kernel_step,            0);
		gd.addNumericField("Nominal (rectilinear) disparity between side of square cameras (pix)",              this.disparity,  3,7,"pix",
				"Used when rendering 4 images");
		gd.addNumericField("Inverse distance to infinity (misalignment correction)",                            this.z_correction,  6);
		gd.addNumericField("Inverse distance to infinity (misalignment correction)",                            this.z_correction,  6);
		gd.addCheckbox    ("Perform correlation",                                                               this.correlate);
		gd.addCheckbox    ("Perform correlation",                                                               this.correlate);
		gd.addNumericField("Bitmask of pairs to combine in the composite (top, bottom, left,righth)",           this.corr_mask,            0);
		gd.addNumericField("Bitmask of pairs to combine in the composite (top, bottom, left,righth)",           this.corr_mask,            0);
@@ -2406,6 +2447,14 @@ public class CLTParameters {
		gd.addCheckbox    ("Equalize weights of right/left FoV",           this.ly_right_left,
		gd.addCheckbox    ("Equalize weights of right/left FoV",           this.ly_right_left,
				"Use this mode use with horizon visible in both FoV halves when gross infinity correction is needed");
				"Use this mode use with horizon visible in both FoV halves when gross infinity correction is needed");



		gd.addNumericField("Minimal tiles per quadrant (not counting the worst) tp proceed",                         this.ly_per_quad,  0);
		gd.addNumericField("Minimal tiles per quadrant (not counting the worst) tp proceed - fraction of all tiles", this.ly_per_quad_r,  3);
		gd.addNumericField("Minimal number of tiles at infinity to proceed",                                         this.ly_inf,  0);
		gd.addNumericField("Minimal number of tiles at infinity to proceed - fraction of all tiles",                 this.ly_inf_r,  3);
		gd.addNumericField("Minimal number of tiles at infinity to apply weight scaling",                            this.ly_inf_scale,  0);
		gd.addNumericField("Minimal number of tiles at infinity to apply weight scaling - fraction of all tiles",    this.ly_inf_scale_r,  3);

		gd.addNumericField("Relative weight of infinity calibration data",                                          this.ly_inf_frac,  3);
		gd.addNumericField("Relative weight of infinity calibration data",                                          this.ly_inf_frac,  3);


		gd.addNumericField("Maximal disparity to be treated as infinity when adjusting with the rig data",           this.ly_inf_max_disparity,  8,3,"pix",
		gd.addNumericField("Maximal disparity to be treated as infinity when adjusting with the rig data",           this.ly_inf_max_disparity,  8,3,"pix",
@@ -2425,6 +2474,10 @@ public class CLTParameters {
				"Full allowed mismatch is a sum of absolute and disparity times relative");
				"Full allowed mismatch is a sum of absolute and disparity times relative");
		gd.addNumericField("Maximal relative full disparity difference to 8 neighbors",                         this.ly_disp_rvar, 8,5,"",
		gd.addNumericField("Maximal relative full disparity difference to 8 neighbors",                         this.ly_disp_rvar, 8,5,"",
				"Full allowed mismatch is a sum of absolute and disparity times relative");
				"Full allowed mismatch is a sum of absolute and disparity times relative");
		gd.addNumericField("Maximal full disparity difference to 8 neighbors with GT",                          this.ly_disp_var_gt, 8,5,"pix",
				"Full allowed mismatch is a sum of absolute and disparity times relative (relaxed when ground truth is available)");
		gd.addNumericField("Maximal relative full disparity difference to 8 neighbors with GT",                 this.ly_disp_rvar_gt, 8,5,"",
				"Full allowed mismatch is a sum of absolute and disparity times relative (relaxed when ground truth is available)");
		gd.addNumericField("Reduce weight of higher disparity tiles",                                           this.ly_norm_disp, 5);
		gd.addNumericField("Reduce weight of higher disparity tiles",                                           this.ly_norm_disp, 5);
		gd.addMessage     ("--- Lazy eye multi-step fitting ---");
		gd.addMessage     ("--- Lazy eye multi-step fitting ---");
		gd.addNumericField("Any (near) saturated pixels - discard tile (see sat_level also)",                   this.lym_overexp,  10);
		gd.addNumericField("Any (near) saturated pixels - discard tile (see sat_level also)",                   this.lym_overexp,  10);
@@ -3067,6 +3120,7 @@ public class CLTParameters {
  			gd.showDialog();
  			gd.showDialog();
		 */
		 */
		if (gd.wasCanceled()) return false;
		if (gd.wasCanceled()) return false;
		this.disparity=             gd.getNextNumber();
		this.transform_size=  (int) gd.getNextNumber();
		this.transform_size=  (int) gd.getNextNumber();
		this.clt_window=      (int) gd.getNextNumber();
		this.clt_window=      (int) gd.getNextNumber();
		this.shift_x =              gd.getNextNumber();
		this.shift_x =              gd.getNextNumber();
@@ -3099,7 +3153,6 @@ public class CLTParameters {
		this.vignetting_max=        gd.getNextNumber();
		this.vignetting_max=        gd.getNextNumber();
		this.vignetting_range=      gd.getNextNumber();
		this.vignetting_range=      gd.getNextNumber();
		this.kernel_step=     (int) gd.getNextNumber();
		this.kernel_step=     (int) gd.getNextNumber();
		this.disparity=             gd.getNextNumber();
		this.z_correction=          gd.getNextNumber();
		this.z_correction=          gd.getNextNumber();
		this.correlate=             gd.getNextBoolean();
		this.correlate=             gd.getNextBoolean();
		this.corr_mask=       (int) gd.getNextNumber();
		this.corr_mask=       (int) gd.getNextNumber();
@@ -3216,6 +3269,14 @@ public class CLTParameters {
		this.ly_par_sel=      (int) gd.getNextNumber();
		this.ly_par_sel=      (int) gd.getNextNumber();


		this.ly_right_left=         gd.getNextBoolean();
		this.ly_right_left=         gd.getNextBoolean();

		this.ly_per_quad=     (int) gd.getNextNumber();
		this.ly_per_quad_r=         gd.getNextNumber();
		this.ly_inf=          (int) gd.getNextNumber();
		this.ly_inf_r=              gd.getNextNumber();
		this.ly_inf_scale=    (int) gd.getNextNumber();
		this.ly_inf_scale_r=        gd.getNextNumber();

		this.ly_inf_frac=           gd.getNextNumber();
		this.ly_inf_frac=           gd.getNextNumber();
		this.ly_inf_max_disparity=  gd.getNextNumber();
		this.ly_inf_max_disparity=  gd.getNextNumber();


@@ -3228,6 +3289,8 @@ public class CLTParameters {
		this.ly_smpl_rms=           gd.getNextNumber();
		this.ly_smpl_rms=           gd.getNextNumber();
		this.ly_disp_var=           gd.getNextNumber();
		this.ly_disp_var=           gd.getNextNumber();
		this.ly_disp_rvar=          gd.getNextNumber();
		this.ly_disp_rvar=          gd.getNextNumber();
		this.ly_disp_var_gt=        gd.getNextNumber();
		this.ly_disp_rvar_gt=       gd.getNextNumber();
		this.ly_norm_disp=          gd.getNextNumber();
		this.ly_norm_disp=          gd.getNextNumber();
		this.lym_overexp=           gd.getNextNumber();
		this.lym_overexp=           gd.getNextNumber();
		this.lym_update_disp=       gd.getNextBoolean();
		this.lym_update_disp=       gd.getNextBoolean();
+16 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,7 @@ public class EyesisCorrectionParameters {


    	public String mlDirectory="ml";
    	public String mlDirectory="ml";


    	public boolean  thumb_overwrite =     true;
    	public int      thumb_width =         200;
    	public int      thumb_width =         200;
    	public int      thumb_height =        100;
    	public int      thumb_height =        100;
    	public double   thumb_h_center =      0.5;
    	public double   thumb_h_center =      0.5;
@@ -296,6 +297,17 @@ public class EyesisCorrectionParameters {
  			cp.clt_batch_dsi_aux=    	  this.clt_batch_dsi_aux;
  			cp.clt_batch_dsi_aux=    	  this.clt_batch_dsi_aux;
  			cp.clt_batch_save_extrinsics= this.clt_batch_save_extrinsics;
  			cp.clt_batch_save_extrinsics= this.clt_batch_save_extrinsics;
  			cp.clt_batch_save_all=        this.clt_batch_save_all;
  			cp.clt_batch_save_all=        this.clt_batch_save_all;


    		cp.thumb_overwrite =        this.thumb_overwrite;
    		cp.thumb_width =            this.thumb_width;
    		cp.thumb_height =           this.thumb_height;
    		cp.thumb_h_center =         this.thumb_h_center;
    		cp.thumb_v_center =         this.thumb_v_center;
    		cp.thumb_size =             this.thumb_size;
    		cp.default_rating =         this.default_rating;


		}
		}




@@ -462,6 +474,7 @@ public class EyesisCorrectionParameters {
    		properties.setProperty(prefix+"clt_batch_save_extrinsics", this.clt_batch_save_extrinsics+"");
    		properties.setProperty(prefix+"clt_batch_save_extrinsics", this.clt_batch_save_extrinsics+"");
    		properties.setProperty(prefix+"clt_batch_save_all",        this.clt_batch_save_all+"");
    		properties.setProperty(prefix+"clt_batch_save_all",        this.clt_batch_save_all+"");


    		properties.setProperty(prefix+"thumb_overwrite",       this.thumb_overwrite+"");
    		properties.setProperty(prefix+"thumb_width",           this.thumb_width+"");
    		properties.setProperty(prefix+"thumb_width",           this.thumb_width+"");
    		properties.setProperty(prefix+"thumb_height",          this.thumb_height+"");
    		properties.setProperty(prefix+"thumb_height",          this.thumb_height+"");
    		properties.setProperty(prefix+"thumb_h_center",        this.thumb_h_center+"");
    		properties.setProperty(prefix+"thumb_h_center",        this.thumb_h_center+"");
@@ -616,6 +629,7 @@ public class EyesisCorrectionParameters {
			if (properties.getProperty(prefix+"clt_batch_save_extrinsics")!= null) this.clt_batch_save_extrinsics=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_extrinsics"));
			if (properties.getProperty(prefix+"clt_batch_save_extrinsics")!= null) this.clt_batch_save_extrinsics=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_extrinsics"));
			if (properties.getProperty(prefix+"clt_batch_save_all")!= null)        this.clt_batch_save_all=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_all"));
			if (properties.getProperty(prefix+"clt_batch_save_all")!= null)        this.clt_batch_save_all=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_all"));


			if (properties.getProperty(prefix+"thumb_overwrite")!= null)     this.thumb_overwrite=Boolean.parseBoolean(properties.getProperty(prefix+"thumb_overwrite"));
			if (properties.getProperty(prefix+"thumb_width")!=null)          this.thumb_width=Integer.parseInt(properties.getProperty(prefix+"thumb_width"));
			if (properties.getProperty(prefix+"thumb_width")!=null)          this.thumb_width=Integer.parseInt(properties.getProperty(prefix+"thumb_width"));
  		    if (properties.getProperty(prefix+"thumb_height")!=null)         this.thumb_height=Integer.parseInt(properties.getProperty(prefix+"thumb_height"));
  		    if (properties.getProperty(prefix+"thumb_height")!=null)         this.thumb_height=Integer.parseInt(properties.getProperty(prefix+"thumb_height"));
  		    if (properties.getProperty(prefix+"thumb_h_center")!=null)       this.thumb_h_center=   Double.parseDouble(properties.getProperty(prefix+"thumb_h_center"));
  		    if (properties.getProperty(prefix+"thumb_h_center")!=null)       this.thumb_h_center=   Double.parseDouble(properties.getProperty(prefix+"thumb_h_center"));
@@ -769,6 +783,7 @@ public class EyesisCorrectionParameters {
    		gd.addCheckbox   ("Swap top and equator images",     this.swapSubchannels01);
    		gd.addCheckbox   ("Swap top and equator images",     this.swapSubchannels01);


    		gd.addTab("Thumbnails","Thumbnail image generation");
    		gd.addTab("Thumbnails","Thumbnail image generation");
    		gd.addCheckbox("Overwrite existing thumbnail images",this.thumb_overwrite);
    		gd.addNumericField("Thumbnail image width",          this.thumb_width, 0,4,"pix",
    		gd.addNumericField("Thumbnail image width",          this.thumb_width, 0,4,"pix",
    				"");
    				"");
    		gd.addNumericField("Thumbnail image height",         this.thumb_height, 0,4,"pix",
    		gd.addNumericField("Thumbnail image height",         this.thumb_height, 0,4,"pix",
@@ -871,6 +886,7 @@ public class EyesisCorrectionParameters {
    		this.removeUnusedSensorData= gd.getNextBoolean();
    		this.removeUnusedSensorData= gd.getNextBoolean();
    		this.swapSubchannels01=      gd.getNextBoolean();
    		this.swapSubchannels01=      gd.getNextBoolean();


    		this.thumb_overwrite =       gd.getNextBoolean();
    		this.thumb_width=      (int) gd.getNextNumber();
    		this.thumb_width=      (int) gd.getNextNumber();
    		this.thumb_height=     (int) gd.getNextNumber();
    		this.thumb_height=     (int) gd.getNextNumber();
    		this.thumb_h_center=         gd.getNextNumber();
    		this.thumb_h_center=         gd.getNextNumber();
+70 −18
Original line number Original line Diff line number Diff line
@@ -705,6 +705,10 @@ private Panel panel1,
			addButton("GPU files",                  panelClt_GPU, color_conf_process);
			addButton("GPU files",                  panelClt_GPU, color_conf_process);
			addButton("Rig8 gpu",                   panelClt_GPU, color_conf_process);
			addButton("Rig8 gpu",                   panelClt_GPU, color_conf_process);
			addButton("ShowGPU",                    panelClt_GPU, color_conf_process);
			addButton("ShowGPU",                    panelClt_GPU, color_conf_process);

			addButton("LWIR_TEST",                  panelClt_GPU, color_conf_process);
			addButton("LWIR_ACQUIRE",               panelClt_GPU, color_conf_process);

			plugInFrame.add(panelClt_GPU);
			plugInFrame.add(panelClt_GPU);
		}
		}
		if (LWIR_MODE) {
		if (LWIR_MODE) {
@@ -730,13 +734,13 @@ private Panel panel1,
			addButton("AUX OUT 3D",                 panelLWIR, color_process_aux);
			addButton("AUX OUT 3D",                 panelLWIR, color_process_aux);
			addButton("Main img AUX",               panelLWIR, color_process_aux);
			addButton("Main img AUX",               panelLWIR, color_process_aux);
			addButton("Main to AUX",                panelLWIR, color_process_aux);
			addButton("Main to AUX",                panelLWIR, color_process_aux);

			addButton("LWIR batch",                  panelClt4, color_process);
			addButton("LWIR_TEST",                  panelLWIR, color_conf_process);
//			addButton("LWIR_TEST",                  panelLWIR, color_conf_process);
			addButton("LWIR_ACQUIRE",               panelLWIR, color_conf_process);
//			addButton("LWIR_ACQUIRE",               panelLWIR, color_conf_process);
			plugInFrame.add(panelLWIR);
			plugInFrame.add(panelLWIR);
		}
		}
		plugInFrame.pack();
		plugInFrame.pack();

//"LWIR batch"
		GUI.center(plugInFrame);
		GUI.center(plugInFrame);
		plugInFrame.setVisible(true);
		plugInFrame.setVisible(true);
		FHT_INSTANCE=       new DoubleFHT();
		FHT_INSTANCE=       new DoubleFHT();
@@ -3960,12 +3964,6 @@ private Panel panel1,
			IJ.showMessage("Warning",msg);
			IJ.showMessage("Warning",msg);
			return;
			return;
    	}
    	}
/*
        EYESIS_CORRECTIONS.initSensorFiles(DEBUG_LEVEL,
        		true, // true - ignore missing files
    			true, // boolean all_sensors,
    			COLOR_PROC_PARAMETERS.correct_vignetting); //boolean correct_vignetting
*/
        QUAD_CLT.resetGeometryCorrection();
        QUAD_CLT.resetGeometryCorrection();
        QUAD_CLT.initGeometryCorrection(DEBUG_LEVEL+2);
        QUAD_CLT.initGeometryCorrection(DEBUG_LEVEL+2);


@@ -5016,6 +5014,14 @@ private Panel panel1,
    	batchRig();
    	batchRig();
    	return;
    	return;


/* ======================================================================== */
    } else if (label.equals("LWIR batch")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
        CLT_PARAMETERS.batch_run = true;
    	batchLwir();
    	return;

/* ======================================================================== */
/* ======================================================================== */
    } else if (label.equals("CLT rig edit")) {
    } else if (label.equals("CLT rig edit")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
@@ -5464,7 +5470,7 @@ private Panel panel1,


		return true;
		return true;
	}
	}

// inverted false/true in initSensorFiles(), should work with LWIR also
	public boolean prepareRigImages() {
	public boolean prepareRigImages() {
        if (QUAD_CLT == null){
        if (QUAD_CLT == null){
        	QUAD_CLT = new  QuadCLT (
        	QUAD_CLT = new  QuadCLT (
@@ -5489,8 +5495,6 @@ private Panel panel1,
        		System.out.println("Created new QuadCLT instance, will need to read CLT kernels");
        		System.out.println("Created new QuadCLT instance, will need to read CLT kernels");
        	}
        	}
        }
        }
//        QuadCLT dbg_QUAD_CLT = QUAD_CLT;
//        QuadCLT dbg_QUAD_CLT_AUX = QUAD_CLT_AUX;
    	String configPath=getSaveCongigPath();
    	String configPath=getSaveCongigPath();
    	if (configPath.equals("ABORT")) return false;
    	if (configPath.equals("ABORT")) return false;
    	if (DEBUG_LEVEL > -2){
    	if (DEBUG_LEVEL > -2){
@@ -5498,15 +5502,15 @@ private Panel panel1,
    	}
    	}
        EYESIS_CORRECTIONS.initSensorFiles(
        EYESIS_CORRECTIONS.initSensorFiles(
        		DEBUG_LEVEL+2,
        		DEBUG_LEVEL+2,
        		true,
        		false, // true,
        		false,
        		true,  // false,
    			COLOR_PROC_PARAMETERS.correct_vignetting); //boolean correct_vignetting
    			COLOR_PROC_PARAMETERS.correct_vignetting); //boolean correct_vignetting
    	if (DEBUG_LEVEL > -2){
    	if (DEBUG_LEVEL > -2){
    		System.out.println("++++++++++++++ Running initSensorFiles for the auxiliary camera ++++++++++++++");
    		System.out.println("++++++++++++++ Running initSensorFiles for the auxiliary camera ++++++++++++++");
    	}
    	}
        EYESIS_CORRECTIONS_AUX.initSensorFiles(DEBUG_LEVEL+2,
        EYESIS_CORRECTIONS_AUX.initSensorFiles(DEBUG_LEVEL+2,
        		true,
        		false, // true,
        		false,
        		true,  // false,
    			COLOR_PROC_PARAMETERS_AUX.correct_vignetting); //boolean correct_vignetting
    			COLOR_PROC_PARAMETERS_AUX.correct_vignetting); //boolean correct_vignetting




@@ -6149,6 +6153,52 @@ private Panel panel1,
		return true;
		return true;
	}
	}


	public boolean batchLwir() {
		long startTime=System.nanoTime();
		// load needed sensor and kernels files
		if (!prepareRigImages()) return false;
		String configPath=getSaveCongigPath();
		if (configPath.equals("ABORT")) return false;
		setAllProperties(PROPERTIES); // batchRig may save properties with the model. Extrinsics will be updated, others should be set here
		if (DEBUG_LEVEL > -2){
			System.out.println("++++++++++++++ Running batch processing of dual-quad EO/LWIR camera rig ++++++++++++++");
		}
		// parameters are different
///		if (COLOR_PROC_PARAMETERS_AUX == null) {
///			COLOR_PROC_PARAMETERS_AUX = COLOR_PROC_PARAMETERS.clone();
///		}
		try {
			TWO_QUAD_CLT.batchLwirRig(
					QUAD_CLT, // QuadCLT quadCLT_main,
					QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
					CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
					DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
					COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
					COLOR_PROC_PARAMETERS_AUX, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters_aux,
					CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters     channelGainParameters,
					RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters             rgbParameters,
					EQUIRECTANGULAR_PARAMETERS, // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
					PROPERTIES,  // Properties                                           properties,
					THREADS_MAX, //final int          threadsMax,  // maximal number of threads to launch
					UPDATE_STATUS, //final boolean    updateStatus,
					DEBUG_LEVEL);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} //final int        debugLevel);
		if (configPath!=null) {
			saveTimestampedProperties( // save config again
					configPath,      // full path or null
					null, // use as default directory if path==null
					true,
					PROPERTIES);
		}
		System.out.println("batchRig(): Processing finished at "+
				IJ.d2s(0.000000001*(System.nanoTime()-startTime),3)+" sec, --- Free memory="+
				Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")");
		return true;
	}







@@ -6337,7 +6387,9 @@ private Panel panel1,


		String mask = ".*EXTRINSICS\\.corr-xml";
		String mask = ".*EXTRINSICS\\.corr-xml";
		String full_conf_suffix = ".corr-xml";
		String full_conf_suffix = ".corr-xml";
		String dsi_suffix = "-DSI_COMBO.tiff";
//		String dsi_suffix = "-DSI_COMBO.tiff";
		String dsi_suffix = TwoQuadCLT.DSI_COMBO_SUFFIX+".tiff";

		String correction_parameters_prefix = "CORRECTION_PARAMETERS.";
		String correction_parameters_prefix = "CORRECTION_PARAMETERS.";


		System.out.println("File mask = "+mask);
		System.out.println("File mask = "+mask);
+156 −20

File changed.

Preview size limit exceeded, changes collapsed.

+11 −4
Original line number Original line Diff line number Diff line
@@ -998,6 +998,9 @@ public class GeometryCorrection {
	}
	}


	public void showRig() {
	public void showRig() {
		if (this.rigOffset == null) {
			this.rigOffset = new RigOffset();
		}
		this.rigOffset.showRigOffsets();
		this.rigOffset.showRigOffsets();
	}
	}


@@ -1401,18 +1404,22 @@ public class GeometryCorrection {







		// returns false if any component is NaN, in that case do not increment
		public void incrementVector(double [] incr,
		public boolean incrementVector(double [] incr,
				double scale)
				double scale)
		{
		{
			for (int i = 0; i < incr.length; i++){
				if (Double.isNaN(vector[i])) return false;
			}
			for (int i = 0; i < incr.length; i++){
			for (int i = 0; i < incr.length; i++){
				vector[i]+= incr[i] * scale;
				vector[i]+= incr[i] * scale;
			}
			}
			return true;
		}
		}


		public void incrementVector(CorrVector incr, double scale)
		public boolean incrementVector(CorrVector incr, double scale)
		{
		{
			incrementVector(incr.toArray(), scale);
			return incrementVector(incr.toArray(), scale);
		}
		}


		@Override
		@Override
Loading