Commit 7c17ebab authored by Andrey Filippov's avatar Andrey Filippov

Fixed FPN mitigation - using farthest scene if perfect is not available

parent 590d3aba
...@@ -1388,7 +1388,9 @@ public class Interscene { ...@@ -1388,7 +1388,9 @@ public class Interscene {
for (;(fpn_index >= 0) && !need_fpn_mitigate[fpn_index]; fpn_index--); for (;(fpn_index >= 0) && !need_fpn_mitigate[fpn_index]; fpn_index--);
// find closest but farther than fpn_mitigate_dist; // find closest but farther than fpn_mitigate_dist;
fpn_pairs[ipair][0] = fpn_index; fpn_pairs[ipair][0] = fpn_index;
fpn_pairs[ipair][1] = -1; fpn_pairs[ipair][1] = -1;
double max_dist = 0.0;
int best_cond_pair = -1;
double best_dist = Double.NaN; double best_dist = Double.NaN;
for (int i = latest_scene; i >= earliest_scene; i--) { for (int i = latest_scene; i >= earliest_scene; i--) {
double fpn_dist = quadCLTs[latest_scene].estimateAverageShift( double fpn_dist = quadCLTs[latest_scene].estimateAverageShift(
...@@ -1397,6 +1399,7 @@ public class Interscene { ...@@ -1397,6 +1399,7 @@ public class Interscene {
avg_z, // double average_z, avg_z, // double average_z,
false, // boolean use_rot, false, // boolean use_rot,
rectilinear); // boolean rectilinear) rectilinear); // boolean rectilinear)
if (fpn_dist < fpn_mitigate_dist) { if (fpn_dist < fpn_mitigate_dist) {
fpn_dist = quadCLTs[i].estimateAverageShift( fpn_dist = quadCLTs[i].estimateAverageShift(
scenes_xyzatr[i], // double [][] xyzatr0, scenes_xyzatr[i], // double [][] xyzatr0,
...@@ -1411,8 +1414,17 @@ public class Interscene { ...@@ -1411,8 +1414,17 @@ public class Interscene {
fpn_pairs[ipair][1] = i; fpn_pairs[ipair][1] = i;
need_fpn_mitigate[fpn_pairs[ipair][0]] = false; need_fpn_mitigate[fpn_pairs[ipair][0]] = false;
} }
} else if (fpn_dist > max_dist) {
max_dist = fpn_dist;
best_cond_pair = i;
} }
} }
if (fpn_pairs[ipair][1] < 0) {
System.out.print("Failed to find a good pair for scene #"+fpn_pairs[ipair][0]+". ");
System.out.println("Using #"+best_cond_pair+" with distance = "+max_dist+" pix.");
fpn_pairs[ipair][1] = best_cond_pair;
need_fpn_mitigate[fpn_pairs[ipair][0]] = false;
}
} }
return fpn_pairs; return fpn_pairs;
} }
......
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