Commit 8b5bd41b authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Updated/tested with center reference

parent a095795c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ public class CLTParameters {
	
	
	public boolean    generate_bg =      true;  // Generate background image for 3dmodels
	public boolean    show_textures    = true;  // show generated textures
	public boolean    debug_filters    = false;// show intermediate results of filtering
	// not used anywhere so far
@@ -1624,6 +1624,7 @@ public class CLTParameters {
		properties.setProperty(prefix+"gmap_crop_extra",            this.gmap_crop_extra+"");            // int     
		properties.setProperty(prefix+"gmap_tex_pals",              CLTParameters.arr_to_str(this.gmap_tex_pals)); // int[]
		
		properties.setProperty(prefix+"generate_bg",                this.generate_bg+"");
		properties.setProperty(prefix+"show_textures",              this.show_textures+"");
		properties.setProperty(prefix+"debug_filters",              this.debug_filters+"");
@@ -2639,6 +2640,7 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"gmap_crop_extra")!=null)      this.gmap_crop_extra=Integer.parseInt(properties.getProperty(prefix+       "gmap_crop_extra"));// int     
		if (properties.getProperty(prefix+"gmap_tex_pals")!=null)        this.gmap_tex_pals=CLTParameters.str_to_iarr(properties.getProperty(prefix+"gmap_tex_pals"));
		
		if (properties.getProperty(prefix+"generate_bg")!=null)                   this.generate_bg=Boolean.parseBoolean(properties.getProperty(prefix+"generate_bg"));
		if (properties.getProperty(prefix+"show_textures")!=null)                 this.show_textures=Boolean.parseBoolean(properties.getProperty(prefix+"show_textures"));
		if (properties.getProperty(prefix+"debug_filters")!=null)                 this.debug_filters=Boolean.parseBoolean(properties.getProperty(prefix+"debug_filters"));
@@ -3900,6 +3902,7 @@ public class CLTParameters {
		
		
		gd.addMessage     ("Earlier 3D generation parameters");
		gd.addCheckbox    ("Generate background (infinity) image for 3D (not needed for view down)",                 this.generate_bg);
		gd.addCheckbox    ("Show generated textures",                                                                this.show_textures);
		gd.addCheckbox    ("show intermediate results of filtering",                                                 this.debug_filters);
@@ -5112,6 +5115,7 @@ public class CLTParameters {
		
		this.gmap_tex_pals =           CLTParameters.str_to_iarr(gd.getNextString());
		
		this.generate_bg=           gd.getNextBoolean();
		this.show_textures=         gd.getNextBoolean();
		this.debug_filters=         gd.getNextBoolean();
		this.min_smth=              gd.getNextNumber();
+44 −4
Original line number Diff line number Diff line
@@ -237,6 +237,10 @@ public class ErsCorrection extends GeometryCorrection {
	public double [] getCameraATR() {
		return camera_atr;
	}
	
	public double [][] getErsXYZATR_dt() {
		return new double[][] {ers_wxyz_center_dt,ers_watr_center_dt};
	}
	public double [] getErsXYZ_dt() {
		return ers_wxyz_center_dt;
	}
@@ -378,7 +382,7 @@ public class ErsCorrection extends GeometryCorrection {
		scenes_poses = new HashMap <String, XyzAtr>();
	}

	public void removeScene(String timestamp) {
	public void removeScene(String timestamp) { // not used
		scenes_poses.remove(timestamp);
	}

@@ -393,21 +397,46 @@ public class ErsCorrection extends GeometryCorrection {
		return scenes;
	}

	public void addScene(String timestamp, XyzAtr scene) {
	public void addScene(String timestamp) { // will it work?
//		scenes_poses.put(timestamp, null);
		scenes_poses.remove(timestamp);
	}
	
	public void addScene(String timestamp, XyzAtr scene) { // will it work?
		if (scene != null) {
			scenes_poses.put(timestamp, scene);
		} else {
			scenes_poses.remove(timestamp);
		}
	}

	public void addScene(String timestamp, double [] xyz, double [] atr) {
		scenes_poses.put(timestamp, new XyzAtr(xyz, atr));
	}
	public void addScene(String timestamp, double [][] xyzatr) {
		scenes_poses.put(timestamp, new XyzAtr(xyzatr[0], xyzatr[1]));
	}
	
	public void addScene(String timestamp, double [] xyz, double [] atr, double [] ers_xyz_dt, double [] ers_atr_dt) {
		scenes_poses.put(timestamp, new XyzAtr(xyz, atr, ers_xyz_dt, ers_atr_dt));
	}
	
	public void addScene(String timestamp, double [][] xyzatr, double [][] ers_xyzatr_dt) {
		scenes_poses.put(timestamp, new XyzAtr(xyzatr[0], xyzatr[1], ers_xyzatr_dt[0], ers_xyzatr_dt[1]));
	}
	
	//not used
	public void addScene(String timestamp, double [] xyz, double [] atr, double [] ers_xyz_dt, double [] ers_atr_dt, double [] ers_xyz_d2t, double [] ers_atr_d2t) {
		scenes_poses.put(timestamp, new XyzAtr(xyz, atr, ers_xyz_dt, ers_atr_dt, ers_xyz_d2t, ers_atr_d2t));
	}

	public void addScene(String timestamp, double [][] xyzatr, double [][] ers_xyzatr_dt, double [][] ers_xyzatr_d2t) {
		scenes_poses.put(timestamp, new XyzAtr(
				xyzatr[0], xyzatr[1],
				ers_xyzatr_dt[0], ers_xyzatr_dt[1],
				ers_xyzatr_d2t[0], ers_xyzatr_d2t[1]));
	}
	
	public String getEarliestScene() {
		return Collections.min(scenes_poses.keySet());
	}
@@ -419,7 +448,10 @@ public class ErsCorrection extends GeometryCorrection {
	
	public double[][] getSceneXYZATR(String timestamp) {
		XyzAtr scene = scenes_poses.get(timestamp);
		if (scene == null) return null;
		if (scene == null) {
//			if timestamp.equals()
			return null;
		}
		return scene.getXYZATR();
	}
	public double[] getSceneXYZ(String timestamp) {
@@ -432,6 +464,14 @@ public class ErsCorrection extends GeometryCorrection {
		if (scene == null) return null;
		return scene.getATR();
	}

	public double[][] getSceneErsXYZATR_dt(String timestamp) {
		XyzAtr scene = scenes_poses.get(timestamp);
		if (scene == null) return null;
		return scene.getErsXYZATR_dt();
	}
	
	
	public double[] getSceneErsXYZ_dt(String timestamp) {
		XyzAtr scene = scenes_poses.get(timestamp);
		if (scene == null) return null;
+254 −39

File changed.

Preview size limit exceeded, changes collapsed.

+5 −1
Original line number Diff line number Diff line
@@ -763,7 +763,7 @@ public class IntersceneLma {
		final double [] full_vector = getFullVector(vector);
		final ErsCorrection ers_ref =   reference_QuadClt.getErsCorrection();
		final ErsCorrection ers_scene = scene_QuadClt.getErsCorrection();
		final double [] scene_xyz =     new double[3];;
		final double [] scene_xyz =     new double[3];
		final double [] scene_atr  =    new double[3];
		final double [] reference_xyz = new double[3]; // will stay 0
		final double [] reference_atr = new double[3]; // will stay 0
@@ -786,6 +786,10 @@ public class IntersceneLma {
			scene_atr[i] =     full_vector[ErsCorrection.DP_DSAZ +  i];
			scene_xyz[i] =     full_vector[ErsCorrection.DP_DSX +  i];
		}
		if (Double.isNaN(scene_xyz[0])) {
			System.out.println("getFxDerivs(): scene_xyz[0]=NaN");
			System.out.println();
		}
		ers_scene.setupERS();
		ers_ref.setupERS();
		final Matrix [] reference_matrices_inverse = ErsCorrection.getInterRotDeriveMatrices(
+15 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class IntersceneMatchParameters {
				ims_mount_atr[1] * Math.PI/180,
				ims_mount_atr[2] * Math.PI/180};
	}
	public  boolean center_reference =   false;
	public  boolean force_ref_dsi =      false; // true;
	public  boolean force_orientations = false;
	public  boolean run_ly =             false; // will return just after LY adjustments, skipping all output generation
@@ -161,6 +162,7 @@ public class IntersceneMatchParameters {
	//------------	
	
	// Sky detection/filtering
	public  boolean sky_extract =                    true;  // do not try to extract blue sky
	public  boolean sky_recalc =                     false; // force blue sky recalculation even if it exists
	public  double  sky_highest_min =                -50; // lowest absolute value should not be higher (requires photometric) 
	public  double  cold_frac =                        0.005; // this and lower will scale fom by  cold_scale
@@ -444,6 +446,8 @@ public class IntersceneMatchParameters {
		gd.addTab         ("Scene Series", "Processing series of scenes and multi-series sets");
		gd.addMessage  ("Build series options");
		
		gd.addCheckbox ("Use center scene as a reference",           this.center_reference,
				"True for mapping with post-processing. If false, use the last scene as a reference (driving).");
		gd.addCheckbox ("Force reference scene DSI calculation",     this.force_ref_dsi,
				"Calculate reference scene DSI even if the file exists.");
		gd.addCheckbox ("Force egomotion calculation",               this.force_orientations,
@@ -657,6 +661,8 @@ public class IntersceneMatchParameters {
		
		gd.addTab("Sky","Featureless sky areas detection and filtering (LWIR only)");
		gd.addMessage  ("Temperature-related filtering (requires photometric calibration)");
		gd.addCheckbox ("Try blue sky calculation/use",              this.sky_extract,
				"Disable if no sky will appear in the image (such as for down-pointed camera).");
		gd.addCheckbox ("Force blue sky recalculation",              this.sky_recalc,
				"Recalculate blue sky even if it already exists.");
		gd.addNumericField("High limit of the scene coldest tile",   this.sky_highest_min, 5,7,"",
@@ -1108,6 +1114,7 @@ public class IntersceneMatchParameters {
		this.ims_mount_xyz = IntersceneMatchParameters. StringToDoubles(gd.getNextString(), 3);
		this.sfm_use =                        gd.getNextBoolean();
		this.sfm_min_base =                   gd.getNextNumber();
		this.center_reference =               gd.getNextBoolean();
		this.force_ref_dsi =                  gd.getNextBoolean();
		this.force_orientations =             gd.getNextBoolean();
		this.run_ly =                         gd.getNextBoolean();
@@ -1203,6 +1210,7 @@ public class IntersceneMatchParameters {
		this.strong_strength =                gd.getNextNumber();
		this.weak_strength =                  gd.getNextNumber();
		
		this.sky_extract =              gd.getNextBoolean();
		this.sky_recalc =               gd.getNextBoolean();
		this.sky_highest_min =          gd.getNextNumber(); 	
		this.cold_frac =                gd.getNextNumber();       	
@@ -1461,6 +1469,7 @@ public class IntersceneMatchParameters {
		properties.setProperty(prefix+"ims_mount_xyz",                 IntersceneMatchParameters.doublesToString(this.ims_mount_xyz));
		properties.setProperty(prefix+"sfm_use",                       this.sfm_use + "");                     // boolean
		properties.setProperty(prefix+"sfm_min_base",                  this.sfm_min_base+"");                  // double
		properties.setProperty(prefix+"center_reference",              this.center_reference + "");               // boolean
		properties.setProperty(prefix+"force_ref_dsi",                 this.force_ref_dsi + "");               // boolean
		properties.setProperty(prefix+"force_orientations",            this.force_orientations + "");          // boolean
		properties.setProperty(prefix+"run_ly",                        this.run_ly + "");                      // boolean
@@ -1563,6 +1572,7 @@ public class IntersceneMatchParameters {
		properties.setProperty(prefix+"strong_strength",               this.strong_strength+"");               // double
		properties.setProperty(prefix+"weak_strength",                 this.weak_strength+"");                 // double

		properties.setProperty(prefix+"sky_extract",          this.sky_extract+"");         // boolean
		properties.setProperty(prefix+"sky_recalc",           this.sky_recalc+"");          // boolean
		properties.setProperty(prefix+"sky_highest_min",      this.sky_highest_min+"");     // double
		properties.setProperty(prefix+"cold_frac",            this.cold_frac+"");           // double
@@ -1774,6 +1784,7 @@ public class IntersceneMatchParameters {
		if (properties.getProperty(prefix+"ims_mount_xyz")!=null) 	   this.ims_mount_xyz= IntersceneMatchParameters.StringToDoubles(properties.getProperty(prefix+"ims_mount_xyz"),3);
		if (properties.getProperty(prefix+"sfm_use")!=null)            this.sfm_use=Boolean.parseBoolean(properties.getProperty(prefix+"sfm_use"));		
		if (properties.getProperty(prefix+"sfm_min_base")!=null)       this.sfm_min_base=Double.parseDouble(properties.getProperty(prefix+"sfm_min_base"));
		if (properties.getProperty(prefix+"center_reference")!=null)              this.center_reference=Boolean.parseBoolean(properties.getProperty(prefix+"center_reference"));		
		if (properties.getProperty(prefix+"force_ref_dsi")!=null)                 this.force_ref_dsi=Boolean.parseBoolean(properties.getProperty(prefix+"force_ref_dsi"));		
		if (properties.getProperty(prefix+"force_orientations")!=null)            this.force_orientations=Boolean.parseBoolean(properties.getProperty(prefix+"force_orientations"));		
		if (properties.getProperty(prefix+"run_ly")!=null)                        this.run_ly=Boolean.parseBoolean(properties.getProperty(prefix+"run_ly"));		
@@ -1881,6 +1892,7 @@ public class IntersceneMatchParameters {
		if (properties.getProperty(prefix+"strong_strength")!=null)               this.strong_strength=Double.parseDouble(properties.getProperty(prefix+"strong_strength"));
		if (properties.getProperty(prefix+"weak_strength")!=null)                 this.weak_strength=Double.parseDouble(properties.getProperty(prefix+"weak_strength"));
		
		if (properties.getProperty(prefix+"sky_extract")!=null)          this.sky_extract=Boolean.parseBoolean(properties.getProperty(prefix+"sky_extract"));		
		if (properties.getProperty(prefix+"sky_recalc")!=null)           this.sky_recalc=Boolean.parseBoolean(properties.getProperty(prefix+"sky_recalc"));		
		if (properties.getProperty(prefix+"sky_highest_min")!=null)      this.sky_highest_min=Double.parseDouble(properties.getProperty(prefix+"sky_highest_min"));
		if (properties.getProperty(prefix+"cold_frac")!=null)            this.cold_frac=Double.parseDouble(properties.getProperty(prefix+"cold_frac"));
@@ -2114,6 +2126,7 @@ public class IntersceneMatchParameters {
 		imp.ims_mount_xyz                 = this.ims_mount_xyz.clone();
 		imp.sfm_use                       = this.sfm_use;
 		imp.sfm_min_base                  = this.sfm_min_base;
		imp.center_reference              = this.center_reference;
		imp.force_ref_dsi                 = this.force_ref_dsi;
		imp.force_orientations            = this.force_orientations;
		imp.run_ly                        = this.run_ly;
@@ -2212,6 +2225,7 @@ public class IntersceneMatchParameters {
		imp.strong_strength               = this.strong_strength;
		imp.weak_strength                 = this.weak_strength;
		
		imp.sky_extract =           this.sky_extract;
		imp.sky_recalc =            this.sky_recalc;
		imp.sky_highest_min =       this.sky_highest_min;
		imp.cold_frac =             this.cold_frac;
Loading