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

fixing for scene==ref_scene

parent 3430abee
......@@ -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(
......
......@@ -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(
......
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