Commit 6c2fb8a0 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

refactoring, alignment with LWIR sensors

parent 04a6a7dd
Loading
Loading
Loading
Loading
+3949 −3915
Original line number Original line Diff line number Diff line
@@ -29,9 +29,12 @@ public class CLTParameters {
	public int        dbg_mode =            0;  // 0 - normal, +1 - no DCT/IDCT
	public int        dbg_mode =            0;  // 0 - normal, +1 - no DCT/IDCT
	public int        ishift_x =            0;  // debug feature - shift source image by this pixels left
	public int        ishift_x =            0;  // debug feature - shift source image by this pixels left
	public int        ishift_y =            0;  // debug feature - shift source image by this pixels down
	public int        ishift_y =            0;  // debug feature - shift source image by this pixels down
  		public double     fat_zero =          0.0;  // modify phase correlation to prevent division by very small numbers
	private double    fat_zero =          0.05; // modify phase correlation to prevent division by very small numbers
	private double    fat_zero_mono =     0.1;  // modify phase correlation to prevent division by very small numbers
	private double    corr_sigma =        0.8;  // LPF correlation sigma
	private double    corr_sigma =        0.8;  // LPF correlation sigma
	private double    corr_sigma_mono =   0.1;  // LPF correlation sigma for monochrome images
	private double    corr_sigma_mono =   0.1;  // LPF correlation sigma for monochrome images
	private double    scale_strength_main = 1.0; // leave as is
	private double    scale_strength_aux =  0.3; // reduce to match lower sigma
	public boolean    norm_kern =         true; // normalize kernels
	public boolean    norm_kern =         true; // normalize kernels
	public boolean    gain_equalize =     false;// equalize green channel gain (bug fix for wrong exposure in Exif ?)
	public boolean    gain_equalize =     false;// equalize green channel gain (bug fix for wrong exposure in Exif ?)
	public boolean    colors_equalize =   true; // equalize R/G, B/G of the individual channels
	public boolean    colors_equalize =   true; // equalize R/G, B/G of the individual channels
@@ -168,6 +171,7 @@ public class CLTParameters {
	public boolean    ly_com_roll=      false;   // Enable common roll (valid for high disparity range only)
	public boolean    ly_com_roll=      false;   // Enable common roll (valid for high disparity range only)
	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 double     ly_inf_frac =     0.5;     // Relative weight of infinity calibration data
	public double     ly_inf_frac =     0.5;     // 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
@@ -186,7 +190,8 @@ public class CLTParameters {
	public double     lym_overexp     = 0.0001;  // Any (near) saturated pixels - discard tile (see sat_level also)
	public double     lym_overexp     = 0.0001;  // Any (near) saturated pixels - discard tile (see sat_level also)
	public boolean    lym_update_disp = true;    // Update target disparity after each step
	public boolean    lym_update_disp = true;    // Update target disparity after each step
	public int        lym_iter =        25;      // Maximal number of iterations
	public int        lym_iter =        25;      // Maximal number of iterations
  		public double     lym_change =      1e-5;    // Parameter vector difference to exit 4e-6 - OK
	private double    lym_change =      1e-5;    // Parameter vector difference to exit 4e-6 - OK
	private double    lym_change_aux =  1e-4;    // same for aux camera (currntly)lwir
	public double     lym_poly_change = 0.002;   // Parameter vector difference to exit from polynomial correction
	public double     lym_poly_change = 0.002;   // Parameter vector difference to exit from polynomial correction


	public boolean    lyf_filter =      true;    // Filter lazy eye pairs by their values
	public boolean    lyf_filter =      true;    // Filter lazy eye pairs by their values
@@ -770,6 +775,18 @@ public class CLTParameters {
	public double getCorrSigma(boolean monochrome) {
	public double getCorrSigma(boolean monochrome) {
		return monochrome ? corr_sigma_mono : corr_sigma;
		return monochrome ? corr_sigma_mono : corr_sigma;
	}
	}
	public double getFatZero(boolean monochrome) {
		return monochrome ? fat_zero_mono : fat_zero;
	}

	public double getScaleStrength(boolean aux) {
		return aux ? scale_strength_aux : scale_strength_main;
	}

	public double getLymChange(boolean aux) {
		return aux ? lym_change_aux : lym_change;
	}



	public CLTParameters(){}
	public CLTParameters(){}
	public void setProperties(String prefix,Properties properties){
	public void setProperties(String prefix,Properties properties){
@@ -784,8 +801,12 @@ public class CLTParameters {
		properties.setProperty(prefix+"ishift_x",                   this.ishift_x+"");
		properties.setProperty(prefix+"ishift_x",                   this.ishift_x+"");
		properties.setProperty(prefix+"ishift_y",                   this.ishift_y+"");
		properties.setProperty(prefix+"ishift_y",                   this.ishift_y+"");
		properties.setProperty(prefix+"fat_zero",                   this.fat_zero+"");
		properties.setProperty(prefix+"fat_zero",                   this.fat_zero+"");
		properties.setProperty(prefix+"fat_zero_mono",              this.fat_zero_mono+"");
		properties.setProperty(prefix+"corr_sigma",                 this.corr_sigma+"");
		properties.setProperty(prefix+"corr_sigma",                 this.corr_sigma+"");
		properties.setProperty(prefix+"corr_sigma_mono",            this.corr_sigma_mono+"");
		properties.setProperty(prefix+"corr_sigma_mono",            this.corr_sigma_mono+"");
		properties.setProperty(prefix+"scale_strength_main",        this.scale_strength_main+"");
		properties.setProperty(prefix+"scale_strength_aux",         this.scale_strength_aux+"");

		properties.setProperty(prefix+"norm_kern",                  this.norm_kern+"");
		properties.setProperty(prefix+"norm_kern",                  this.norm_kern+"");
		properties.setProperty(prefix+"gain_equalize",              this.gain_equalize+"");
		properties.setProperty(prefix+"gain_equalize",              this.gain_equalize+"");
		properties.setProperty(prefix+"colors_equalize",            this.colors_equalize+"");
		properties.setProperty(prefix+"colors_equalize",            this.colors_equalize+"");
@@ -909,6 +930,7 @@ public class CLTParameters {
		properties.setProperty(prefix+"ly_com_roll",                this.ly_com_roll+"");
		properties.setProperty(prefix+"ly_com_roll",                this.ly_com_roll+"");


		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_inf_frac",                this.ly_inf_frac +"");
		properties.setProperty(prefix+"ly_inf_frac",                this.ly_inf_frac +"");


@@ -927,6 +949,7 @@ public class CLTParameters {
		properties.setProperty(prefix+"lym_update_disp",            this.lym_update_disp+"");
		properties.setProperty(prefix+"lym_update_disp",            this.lym_update_disp+"");
		properties.setProperty(prefix+"lym_iter",                   this.lym_iter+"");
		properties.setProperty(prefix+"lym_iter",                   this.lym_iter+"");
		properties.setProperty(prefix+"lym_change",                 this.lym_change +"");
		properties.setProperty(prefix+"lym_change",                 this.lym_change +"");
		properties.setProperty(prefix+"lym_change_aux",             this.lym_change_aux +"");
		properties.setProperty(prefix+"lym_poly_change",            this.lym_poly_change +"");
		properties.setProperty(prefix+"lym_poly_change",            this.lym_poly_change +"");


		properties.setProperty(prefix+"lyf_filter",                 this.lyf_filter+"");
		properties.setProperty(prefix+"lyf_filter",                 this.lyf_filter+"");
@@ -1479,8 +1502,14 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"ishift_x")!=null)                      this.ishift_x=Integer.parseInt(properties.getProperty(prefix+"ishift_x"));
		if (properties.getProperty(prefix+"ishift_x")!=null)                      this.ishift_x=Integer.parseInt(properties.getProperty(prefix+"ishift_x"));
		if (properties.getProperty(prefix+"ishift_y")!=null)                      this.ishift_y=Integer.parseInt(properties.getProperty(prefix+"ishift_y"));
		if (properties.getProperty(prefix+"ishift_y")!=null)                      this.ishift_y=Integer.parseInt(properties.getProperty(prefix+"ishift_y"));
		if (properties.getProperty(prefix+"fat_zero")!=null)                      this.fat_zero=Double.parseDouble(properties.getProperty(prefix+"fat_zero"));
		if (properties.getProperty(prefix+"fat_zero")!=null)                      this.fat_zero=Double.parseDouble(properties.getProperty(prefix+"fat_zero"));
		if (properties.getProperty(prefix+"fat_zero_mono")!=null)                 this.fat_zero_mono=Double.parseDouble(properties.getProperty(prefix+"fat_zero_mono"));
		if (properties.getProperty(prefix+"corr_sigma")!=null)                    this.corr_sigma=Double.parseDouble(properties.getProperty(prefix+"corr_sigma"));
		if (properties.getProperty(prefix+"corr_sigma")!=null)                    this.corr_sigma=Double.parseDouble(properties.getProperty(prefix+"corr_sigma"));
		if (properties.getProperty(prefix+"corr_sigma_mono")!=null)               this.corr_sigma_mono=Double.parseDouble(properties.getProperty(prefix+"corr_sigma_mono"));
		if (properties.getProperty(prefix+"corr_sigma_mono")!=null)               this.corr_sigma_mono=Double.parseDouble(properties.getProperty(prefix+"corr_sigma_mono"));
		if (properties.getProperty(prefix+"scale_strength_main")!=null)           this.scale_strength_main=Double.parseDouble(properties.getProperty(prefix+"scale_strength_main"));
		if (properties.getProperty(prefix+"scale_strength_aux")!=null)            this.scale_strength_aux=Double.parseDouble(properties.getProperty(prefix+"scale_strength_aux"));



		if (properties.getProperty(prefix+"norm_kern")!=null)                     this.norm_kern=Boolean.parseBoolean(properties.getProperty(prefix+"norm_kern"));
		if (properties.getProperty(prefix+"norm_kern")!=null)                     this.norm_kern=Boolean.parseBoolean(properties.getProperty(prefix+"norm_kern"));
		if (properties.getProperty(prefix+"gain_equalize")!=null)                 this.gain_equalize=Boolean.parseBoolean(properties.getProperty(prefix+"gain_equalize"));
		if (properties.getProperty(prefix+"gain_equalize")!=null)                 this.gain_equalize=Boolean.parseBoolean(properties.getProperty(prefix+"gain_equalize"));
		if (properties.getProperty(prefix+"colors_equalize")!=null)               this.colors_equalize=Boolean.parseBoolean(properties.getProperty(prefix+"colors_equalize"));
		if (properties.getProperty(prefix+"colors_equalize")!=null)               this.colors_equalize=Boolean.parseBoolean(properties.getProperty(prefix+"colors_equalize"));
@@ -1606,6 +1635,7 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"ly_com_roll")!=null)                   this.ly_com_roll=Boolean.parseBoolean(properties.getProperty(prefix+"ly_com_roll"));
		if (properties.getProperty(prefix+"ly_com_roll")!=null)                   this.ly_com_roll=Boolean.parseBoolean(properties.getProperty(prefix+"ly_com_roll"));


		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_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"));
@@ -1627,6 +1657,8 @@ public class CLTParameters {
		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"));
		if (properties.getProperty(prefix+"lym_iter")!=null)                      this.lym_iter=Integer.parseInt(properties.getProperty(prefix+"lym_iter"));
		if (properties.getProperty(prefix+"lym_iter")!=null)                      this.lym_iter=Integer.parseInt(properties.getProperty(prefix+"lym_iter"));
		if (properties.getProperty(prefix+"lym_change")!=null)                    this.lym_change=Double.parseDouble(properties.getProperty(prefix+"lym_change"));
		if (properties.getProperty(prefix+"lym_change")!=null)                    this.lym_change=Double.parseDouble(properties.getProperty(prefix+"lym_change"));
		if (properties.getProperty(prefix+"lym_change_aux")!=null)                this.lym_change_aux=Double.parseDouble(properties.getProperty(prefix+"lym_change_aux"));

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


		if (properties.getProperty(prefix+"lyf_filter")!=null)                    this.lyf_filter=Boolean.parseBoolean(properties.getProperty(prefix+"lyf_filter"));
		if (properties.getProperty(prefix+"lyf_filter")!=null)                    this.lyf_filter=Boolean.parseBoolean(properties.getProperty(prefix+"lyf_filter"));
@@ -2190,8 +2222,13 @@ public class CLTParameters {
		gd.addNumericField("ishift_x: shift source image by this pixels left",                                  this.ishift_x,                  0);
		gd.addNumericField("ishift_x: shift source image by this pixels left",                                  this.ishift_x,                  0);
		gd.addNumericField("ishift_y: shift source image by this pixels down",                                  this.ishift_y,                  0);
		gd.addNumericField("ishift_y: shift source image by this pixels down",                                  this.ishift_y,                  0);
		gd.addNumericField("Modify phase correlation to prevent division by very small numbers",                this.fat_zero,                  4);
		gd.addNumericField("Modify phase correlation to prevent division by very small numbers",                this.fat_zero,                  4);
   			gd.addNumericField("LPF correlarion sigma for Bayer color images",                            this.corr_sigma,                3);
		gd.addNumericField("Modify phase correlation for monochrome images",                                    this.fat_zero_mono,             4);
   			gd.addNumericField("LPF correlarion sigma for monochrome images",                             this.corr_sigma_mono,           3);
		gd.addNumericField("LPF correlarion sigma for Bayer color images",                                      this.corr_sigma,                4);
		gd.addNumericField("LPF correlarion sigma for monochrome images",                                       this.corr_sigma_mono,           4);

		gd.addNumericField("Scale all correlation strengths (to compensate correlation sigma) for main camera", this.scale_strength_main,       4);
		gd.addNumericField("Scale all correlation strengths (to compensate correlation sigma) for aux camera",  this.scale_strength_aux,        4);

		gd.addCheckbox    ("Normalize kernels",                                                                 this.norm_kern);
		gd.addCheckbox    ("Normalize kernels",                                                                 this.norm_kern);
		gd.addCheckbox    ("Equalize green channel gain of the individual cnannels (bug fix for exposure)",           this.gain_equalize);
		gd.addCheckbox    ("Equalize green channel gain of the individual cnannels (bug fix for exposure)",           this.gain_equalize);
		gd.addCheckbox    ("Equalize R/G, B/G balance of the individual channels",                              this.colors_equalize);
		gd.addCheckbox    ("Equalize R/G, B/G balance of the individual channels",                              this.colors_equalize);
@@ -2345,6 +2382,9 @@ public class CLTParameters {


		gd.addNumericField("Manual parameter mask selection (0 use checkboxes above)",                          this.ly_par_sel,  0, 5,"",
		gd.addNumericField("Manual parameter mask selection (0 use checkboxes above)",                          this.ly_par_sel,  0, 5,"",
				"bit 0 - sym0, bit1 - sym1, ...");
				"bit 0 - sym0, bit1 - sym1, ...");
		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");

		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",
@@ -2369,7 +2409,9 @@ public class CLTParameters {
		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);
		gd.addCheckbox    ("Update target disparity after each step",                                           this.lym_update_disp);
		gd.addCheckbox    ("Update target disparity after each step",                                           this.lym_update_disp);
		gd.addNumericField("Maximal number of iterations",                                                      this.lym_iter,  0);
		gd.addNumericField("Maximal number of iterations",                                                      this.lym_iter,  0);
			gd.addNumericField("Parameter vector difference to exit",                                     this.lym_change,  10);
		gd.addNumericField("Parameter vector difference to exit (main camera)",                                 this.lym_change,  10);
		gd.addNumericField("Parameter vector difference to exit (aux camera)",                                  this.lym_change_aux,  10);

		gd.addNumericField("Parameter vector difference to exit from polynomial correction",                    this.lym_poly_change,  10);
		gd.addNumericField("Parameter vector difference to exit from polynomial correction",                    this.lym_poly_change,  10);


		gd.addMessage     ("--- Lazy eye samples filter ---");
		gd.addMessage     ("--- Lazy eye samples filter ---");
@@ -3015,8 +3057,11 @@ public class CLTParameters {
		this.ishift_x=        (int) gd.getNextNumber();
		this.ishift_x=        (int) gd.getNextNumber();
		this.ishift_y=        (int) gd.getNextNumber();
		this.ishift_y=        (int) gd.getNextNumber();
		this.fat_zero =             gd.getNextNumber();
		this.fat_zero =             gd.getNextNumber();
		this.fat_zero_mono =        gd.getNextNumber();
		this.corr_sigma =           gd.getNextNumber();
		this.corr_sigma =           gd.getNextNumber();
		this.corr_sigma_mono =      gd.getNextNumber();
		this.corr_sigma_mono =      gd.getNextNumber();
		this.scale_strength_main =  gd.getNextNumber();
		this.scale_strength_aux =   gd.getNextNumber();
		this.norm_kern=             gd.getNextBoolean();
		this.norm_kern=             gd.getNextBoolean();
		this.gain_equalize=         gd.getNextBoolean();
		this.gain_equalize=         gd.getNextBoolean();
		this.colors_equalize=       gd.getNextBoolean();
		this.colors_equalize=       gd.getNextBoolean();
@@ -3147,6 +3192,7 @@ public class CLTParameters {
		this.ly_com_roll=           gd.getNextBoolean();
		this.ly_com_roll=           gd.getNextBoolean();
		this.ly_par_sel=      (int) gd.getNextNumber();
		this.ly_par_sel=      (int) gd.getNextNumber();


		this.ly_right_left=         gd.getNextBoolean();
		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();


@@ -3164,6 +3210,8 @@ public class CLTParameters {
		this.lym_update_disp=       gd.getNextBoolean();
		this.lym_update_disp=       gd.getNextBoolean();
		this.lym_iter=        (int) gd.getNextNumber();
		this.lym_iter=        (int) gd.getNextNumber();
		this.lym_change=            gd.getNextNumber();
		this.lym_change=            gd.getNextNumber();
		this.lym_change_aux=        gd.getNextNumber();

		this.lym_poly_change=       gd.getNextNumber();
		this.lym_poly_change=       gd.getNextNumber();


		this.lyf_filter=            gd.getNextBoolean();
		this.lyf_filter=            gd.getNextBoolean();
@@ -3919,20 +3967,6 @@ public class CLTParameters {
		gd.showDialog();
		gd.showDialog();
		if (gd.wasCanceled()) return false;
		if (gd.wasCanceled()) return false;
		HashMap<String,Double> new_map = new HashMap<String,Double>();
		HashMap<String,Double> new_map = new HashMap<String,Double>();
    		/*
			for (HashMap.Entry<String,Double> entry : infinity_distace_map.entrySet()){
				double d = gd.getNextNumber();
				if (d != 0.0) {
					new_map.put(entry.getKey(),d);
				}
			}

				for (StringDouble entry : sd_list){

					gd.addNumericField(entry.str,   entry.dbl, 1,6, "m");
				}

 */
		for (StringDouble entry : sd_list){
		for (StringDouble entry : sd_list){
			double d = gd.getNextNumber();
			double d = gd.getNextNumber();
			if (d != 0.0) {
			if (d != 0.0) {
+7 −2
Original line number Original line Diff line number Diff line
@@ -1247,7 +1247,9 @@ public class EyesisCorrectionParameters {


    		String [] extensions = getSourceSuffixes();//    		={this.sourceSuffix};
    		String [] extensions = getSourceSuffixes();//    		={this.sourceSuffix};
    		String [] prefixes = getSourcePrefixes();
    		String [] prefixes = getSourcePrefixes();
    		int num_chn_files = numSubCameras + ((aux_camera != null)?aux_camera.numSubCameras : 0);
    		int num_chn_main = numSubCameras;
    		int num_chn_aux =  ((aux_camera != null)?aux_camera.numSubCameras : 0);
    		int num_chn_files = num_chn_main + num_chn_aux;
    		extensions[0] = sourceSuffix;
    		extensions[0] = sourceSuffix;
    		prefixes[0] =   sourcePrefix;
    		prefixes[0] =   sourcePrefix;
			MultipleExtensionsFileFilter setFilter = new MultipleExtensionsFileFilter(prefixes,extensions,"Image sets");
			MultipleExtensionsFileFilter setFilter = new MultipleExtensionsFileFilter(prefixes,extensions,"Image sets");
@@ -1281,7 +1283,10 @@ public class EyesisCorrectionParameters {
//	    		String [] setChnFiles = files[nFile].list(setFilter);
//	    		String [] setChnFiles = files[nFile].list(setFilter);
	    		File [] setChnFiles = files[nFile].listFiles(setFilter);
	    		File [] setChnFiles = files[nFile].listFiles(setFilter);
	    		int num_match = setChnFiles.length;
	    		int num_match = setChnFiles.length;
	    		if (num_match == num_chn_files) { // only use sets of exact number of files
	    		if (    (num_match == num_chn_files) || // all files for main and aux
	    				(num_match == num_chn_main) || // only main camera files
	    				(num_match == num_chn_aux))   // only aux camera files
	    				{ // only use sets of exact number of files
	    			setDirList.add(files[nFile]);
	    			setDirList.add(files[nFile]);
	    			for (File f: setChnFiles) {
	    			for (File f: setChnFiles) {
	    				setFilesList.add(f);
	    				setFilesList.add(f);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1220,7 +1220,7 @@ public class EyesisDCT {
		  }
		  }


		  if (this.correctionsParameters.deconvolve) { // process with DCT, otherwise use simple debayer
		  if (this.correctionsParameters.deconvolve) { // process with DCT, otherwise use simple debayer
			  ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
			  ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
			  double [][][][] dct_data = image_dtt.mdctStack(
			  double [][][][] dct_data = image_dtt.mdctStack(
					  stack,
					  stack,
					  channel,
					  channel,
+29 −100
Original line number Original line Diff line number Diff line
@@ -3064,7 +3064,7 @@ private Panel panel1,
           	}
           	}


           }
           }
           ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
		  ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
           double [][][][] dctdc_data = image_dtt.mdctScale(
           double [][][][] dctdc_data = image_dtt.mdctScale(
           		DBG_IMP.getStack(),
           		DBG_IMP.getStack(),
           		DCT_PARAMETERS.kernel_chn,
           		DCT_PARAMETERS.kernel_chn,
@@ -3162,7 +3162,7 @@ private Panel panel1,
        	}
        	}


        }
        }
        ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
        ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
        double [][][][] dctdc_data = image_dtt.mdctStack(
        double [][][][] dctdc_data = image_dtt.mdctStack(
        		DBG_IMP.getStack(),
        		DBG_IMP.getStack(),
        		DCT_PARAMETERS.kernel_chn,
        		DCT_PARAMETERS.kernel_chn,
@@ -4631,7 +4631,6 @@ private Panel panel1,
        QUAD_CLT.cltDisparityScans(
        QUAD_CLT.cltDisparityScans(
        		CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
        		CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
        		DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
        		DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
//        		NONLIN_PARAMETERS, //EyesisCorrectionParameters.NonlinParameters       nonlinParameters,
        		COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
        		COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
        		CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters     channelGainParameters,
        		CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters     channelGainParameters,
        		RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters             rgbParameters,
        		RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters             rgbParameters,
@@ -4678,82 +4677,12 @@ private Panel panel1,


    	clt3d(adjust_extrinsics, adjust_poly, dry_run);
    	clt3d(adjust_extrinsics, adjust_poly, dry_run);
        return;
        return;
    } else if (label.equals("AUX extrinsics") || label.equals("AUX Poly corr")) {
    } else if (label.equals("AUX 3D") || label.equals("AUX extrinsics") || label.equals("AUX Poly corr")) {
    	boolean adjust_extrinsics = label.equals("AUX extrinsics") || label.equals("AUX Poly corr");
    	boolean adjust_extrinsics = label.equals("AUX extrinsics") || label.equals("AUX Poly corr");
    	boolean adjust_poly = label.equals("AUX Poly corr");
    	boolean adjust_poly = label.equals("AUX Poly corr");
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	clt3d_aux(adjust_extrinsics, adjust_poly);
    	clt3d_aux(adjust_extrinsics, adjust_poly);
/*
        if (QUAD_CLT_AUX == null){
        	if (EYESIS_CORRECTIONS_AUX == null) {
        		EYESIS_CORRECTIONS_AUX = new EyesisCorrections(SYNC_COMMAND.stopRequested,CORRECTION_PARAMETERS.getAux());
        	}
        	QUAD_CLT_AUX = new  QuadCLT (
        			QuadCLT.PREFIX_AUX,
        			PROPERTIES,
        			EYESIS_CORRECTIONS_AUX,
        			CORRECTION_PARAMETERS.getAux());
        	if (DEBUG_LEVEL > 0){
        		System.out.println("Created new QuadCLT instance for AUX camera, will need to read CLT kernels for aux camera");
        	}
        }
    	String configPath=getSaveCongigPath();
    	if (configPath.equals("ABORT")) return;

    	EYESIS_CORRECTIONS_AUX.initSensorFiles(DEBUG_LEVEL);
        int numChannelsAux=EYESIS_CORRECTIONS_AUX.getNumChannels();
        CHANNEL_GAINS_PARAMETERS_AUX.modifyNumChannels(numChannelsAux);

        if (!QUAD_CLT_AUX.CLTKernelsAvailable()){
        	if (DEBUG_LEVEL > 0){
        		System.out.println("Reading AUX CLT kernels");
        	}
        	QUAD_CLT_AUX.readCLTKernels(
            		CLT_PARAMETERS,
                    THREADS_MAX,
                    UPDATE_STATUS, // update status info
            		DEBUG_LEVEL);

            if (DEBUG_LEVEL > 1){
            	QUAD_CLT_AUX.showCLTKernels(
            			THREADS_MAX,
            			UPDATE_STATUS, // update status info
            			DEBUG_LEVEL);
        	}
        }

        if (!QUAD_CLT_AUX.geometryCorrectionAvailable()){
        	if (DEBUG_LEVEL > 0){
        		System.out.println("Calculating geometryCorrection for AUX camera");
        	}
        	if (!QUAD_CLT_AUX.initGeometryCorrection(DEBUG_LEVEL+2)){
        		return;
        	}
        }

        QUAD_CLT_AUX.processCLTQuads3d(
        		adjust_extrinsics, // boolean adjust_extrinsics,
        		adjust_poly,       // boolean adjust_poly,
        		CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
        		DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
        		COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
        		CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters     channelGainParameters,
        		RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters             rgbParameters,
        		EQUIRECTANGULAR_PARAMETERS, // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
        		THREADS_MAX, //final int          threadsMax,  // maximal number of threads to launch
        		UPDATE_STATUS, //final boolean    updateStatus,
        		DEBUG_LEVEL); //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);
        }
*/
        return;
        return;


    } else if (label.equals("CLT planes")) {
    } else if (label.equals("CLT planes")) {
@@ -5826,7 +5755,7 @@ private Panel panel1,
  			    TWO_QUAD_CLT,                 // TwoQuadCLT       twoQuadCLT, //maybe null in no-rig mode, otherwise may contain rig measurements to be used as infinity ground truth
  			    TWO_QUAD_CLT,                 // TwoQuadCLT       twoQuadCLT, //maybe null in no-rig mode, otherwise may contain rig measurements to be used as infinity ground truth
				CLT_PARAMETERS,               // EyesisCorrectionParameters.DCTParameters           dct_parameters,
				CLT_PARAMETERS,               // EyesisCorrectionParameters.DCTParameters           dct_parameters,
				DEBAYER_PARAMETERS,           // EyesisCorrectionParameters.DebayerParameters     debayerParameters,
				DEBAYER_PARAMETERS,           // EyesisCorrectionParameters.DebayerParameters     debayerParameters,
				COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
				COLOR_PROC_PARAMETERS_AUX,    // EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
				CHANNEL_GAINS_PARAMETERS_AUX, // CorrectionColorProc.ColorGainsParameters     channelGainParameters,
				CHANNEL_GAINS_PARAMETERS_AUX, // CorrectionColorProc.ColorGainsParameters     channelGainParameters,
				RGB_PARAMETERS,               // EyesisCorrectionParameters.RGBParameters             rgbParameters,
				RGB_PARAMETERS,               // EyesisCorrectionParameters.RGBParameters             rgbParameters,
				EQUIRECTANGULAR_PARAMETERS,   // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
				EQUIRECTANGULAR_PARAMETERS,   // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
@@ -6840,7 +6769,7 @@ private Panel panel1,
			}
			}
		}
		}


        ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
		ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
		double [][][][][] clt_data = image_dtt.cltStack(
		double [][][][][] clt_data = image_dtt.cltStack(
				DBG_IMP.getStack(),
				DBG_IMP.getStack(),
				0, // CLT_PARAMETERS.kernel_chn,
				0, // CLT_PARAMETERS.kernel_chn,
@@ -6970,7 +6899,7 @@ private Panel panel1,


        }
        }
        String suffix = "-dx_"+(CLT_PARAMETERS.ishift_x+CLT_PARAMETERS.shift_x)+"_dy_"+(CLT_PARAMETERS.ishift_y+CLT_PARAMETERS.shift_y);
        String suffix = "-dx_"+(CLT_PARAMETERS.ishift_x+CLT_PARAMETERS.shift_x)+"_dy_"+(CLT_PARAMETERS.ishift_y+CLT_PARAMETERS.shift_y);
        ImageDtt image_dtt = new ImageDtt(COLOR_PROC_PARAMETERS.isMonochrome()); // Bayer, not monochrome
        ImageDtt image_dtt = new ImageDtt(COLOR_PROC_PARAMETERS.isMonochrome(), CLT_PARAMETERS.getScaleStrength(false)); // Bayer, not monochrome
        String [] titles = {
        String [] titles = {
        		"redCC",  "redSC",  "redCS",  "redSS",
        		"redCC",  "redSC",  "redCS",  "redSS",
        		"blueCC", "blueSC", "blueCS", "blueSS",
        		"blueCC", "blueSC", "blueCS", "blueSS",
@@ -7059,7 +6988,7 @@ private Panel panel1,
        			clt_data[chn],                  // final double [][][][] data1,  // array [tilesY][tilesX][4][dct_size*dct_size]
        			clt_data[chn],                  // final double [][][][] data1,  // array [tilesY][tilesX][4][dct_size*dct_size]
        			clt_data2[chn],                 // final double [][][][] data2,  // array [tilesY][tilesX][4][dct_size*dct_size]
        			clt_data2[chn],                 // final double [][][][] data2,  // array [tilesY][tilesX][4][dct_size*dct_size]
        			CLT_PARAMETERS.transform_size,  // final int             dct_size,
        			CLT_PARAMETERS.transform_size,  // final int             dct_size,
        			CLT_PARAMETERS.fat_zero,  // final double          fat_zero,    // add to denominator to modify phase correlation (same units as data1, data2)
        			CLT_PARAMETERS.getFatZero(image_dtt.isMonochrome()),  // final double          fat_zero,    // add to denominator to modify phase correlation (same units as data1, data2)
            		CLT_PARAMETERS.tileX, //final int debug_tileX
            		CLT_PARAMETERS.tileX, //final int debug_tileX
            		CLT_PARAMETERS.tileY, //final int debug_tileY
            		CLT_PARAMETERS.tileY, //final int debug_tileY


+33 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading