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

fixing for scene==ref_scene

parent 3430abee
...@@ -4895,10 +4895,12 @@ public class OpticalFlow { ...@@ -4895,10 +4895,12 @@ public class OpticalFlow {
batch_mode, // final boolean batch_mode, batch_mode, // final boolean batch_mode,
debugLevel); // final int debugLevel) 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]; QuadCLT[][] scenes_pairs = new QuadCLT[num_avg_pairs][2];
for (int i = 0; i < num_avg_pairs; i++) { 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]; scenes_pairs[i][1] = quadCLTs[earliest_scene + num_avg_pairs - 1 - i];
} }
double [][] sfm_dsn = StructureFromMotion.sfmPair( double [][] sfm_dsn = StructureFromMotion.sfmPair(
......
...@@ -576,22 +576,27 @@ public class StructureFromMotion { ...@@ -576,22 +576,27 @@ public class StructureFromMotion {
QuadCLT [] scenes = scene_pairs[npair]; QuadCLT [] scenes = scene_pairs[npair];
for (int nscene = 0; nscene < scenes.length; nscene++) { for (int nscene = 0; nscene < scenes.length; nscene++) {
String ts = scenes[nscene].getImageName(); String ts = scenes[nscene].getImageName();
if ((ers_reference.getSceneXYZ(ts)== null) || (ers_reference.getSceneATR(ts)== null)) { if (ts.equals(ref_scene.getImageName())) {
System.out.println("sfmPair(): no pose for timestamp "+ts); scenes_xyzatr[npair][nscene] = ref_xyzatr;
return null; scenes_xyzatr_dt[npair][nscene]= ref_xyzatr_dt;
} } else {
scenes_xyzatr[npair][nscene] = new double[][] { if ((ers_reference.getSceneXYZ(ts)== null) || (ers_reference.getSceneATR(ts)== null)) {
ers_reference.getSceneXYZ(ts), System.out.println("sfmPair(): no pose for timestamp "+ts);
ers_reference.getSceneATR(ts)}; return null;
scenes_xyzatr_dt[npair][nscene]= new double[][] { }
ers_reference.getSceneErsXYZ_dt(ts), scenes_xyzatr[npair][nscene] = new double[][] {
ers_reference.getSceneErsATR_dt(ts)}; ers_reference.getSceneXYZ(ts),
for (int i = 0; i < scenes_xyzatr_dt[nscene].length; i++) { ers_reference.getSceneATR(ts)};
if (scenes_xyzatr_dt[npair][nscene][i] == null) { scenes_xyzatr_dt[npair][nscene]= new double[][] {
System.out.println("sfmPair(): scene_xyzatr_dt["+i+"] == null"); ers_reference.getSceneErsXYZ_dt(ts),
scenes_xyzatr_dt[npair][nscene][i] = ZERO3.clone(); ers_reference.getSceneErsATR_dt(ts)};
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();
}
} }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment