Commit 96ea490a authored by Andrey Filippov's avatar Andrey Filippov
Browse files

fixing for scene==ref_scene

parent 3430abee
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4895,10 +4895,12 @@ public class OpticalFlow {
							batch_mode,               // final boolean                batch_mode,
							debugLevel);              // final int                    debugLevel)
					*/
					int      num_avg_pairs = 16; // number of scene pairs to average
//					int      num_avg_pairs = 16; // number of scene pairs to average
					int      num_avg_pairs = 1;  // number of scene pairs to average
					QuadCLT[][] scenes_pairs = new QuadCLT[num_avg_pairs][2];
					for (int i = 0; i < num_avg_pairs; i++) {
						scenes_pairs[i][0] = quadCLTs[ref_index - 1 - i];
//						scenes_pairs[i][0] = quadCLTs[ref_index - 1 - i];
						scenes_pairs[i][0] = quadCLTs[ref_index - i];
						scenes_pairs[i][1] = quadCLTs[earliest_scene + num_avg_pairs - 1 - i];
					}
					double [][] sfm_dsn = StructureFromMotion.sfmPair(
+20 −15
Original line number Diff line number Diff line
@@ -576,6 +576,10 @@ public class StructureFromMotion {
    		QuadCLT [] scenes = scene_pairs[npair];
    		for (int nscene = 0; nscene < scenes.length; nscene++) {
    			String ts = scenes[nscene].getImageName();
    			if (ts.equals(ref_scene.getImageName())) {
    				scenes_xyzatr[npair][nscene] = ref_xyzatr;
    				scenes_xyzatr_dt[npair][nscene]= ref_xyzatr_dt;
    			} else {
    				if ((ers_reference.getSceneXYZ(ts)== null) || (ers_reference.getSceneATR(ts)== null)) {
    					System.out.println("sfmPair(): no pose for timestamp "+ts);
    					return null;
@@ -586,7 +590,7 @@ public class StructureFromMotion {
    					scenes_xyzatr_dt[npair][nscene]= new double[][] {
    						ers_reference.getSceneErsXYZ_dt(ts),
    						ers_reference.getSceneErsATR_dt(ts)};
    					for (int i = 0; i < scenes_xyzatr_dt[nscene].length; i++) {
    						for (int i = 0; i < scenes_xyzatr_dt[npair][nscene].length; i++) {
    							if (scenes_xyzatr_dt[npair][nscene][i] == null) {
    								System.out.println("sfmPair(): scene_xyzatr_dt["+i+"] == null");
    								scenes_xyzatr_dt[npair][nscene][i] = ZERO3.clone();
@@ -594,6 +598,7 @@ public class StructureFromMotion {
    						}
    			}
    		}
    	}        
    	
        for (int ntry = 0; ntry < num_readjust; ntry++) {
        	SfmCorr [] sfmCorr = getSfmCorr(