Commit 009eb8ea authored by Andrey Filippov's avatar Andrey Filippov

Added disparity filtering to remove NaN to transformFromVirtual()

parent 86106498
......@@ -1339,6 +1339,33 @@ public class Cuas {
int initial_capacity = 4;
final int min_samples = 1;
// fill NaN in disparity_ref (not needed for planes)
boolean had_nans = false;
for (int i = 0; i < disparity_ref.length; i++) {
if (Double.isNaN(disparity_ref[i])) {
had_nans=true;
break;
}
}
if (had_nans) {
int grow_width = Math.max(tilesX, tilesY);
int num_passes = 20;
System.out.println("transformFromVirtual(): disparity_ref had NaN, filling them from surrounding.");
double [] disparity_ref1 = TileProcessor.fillNaNs(
disparity_ref, // final double [] data,
null, // final boolean [] prohibit,
tilesX, // int width,
2 * grow_width, // 100, // 2*width, // 16, // final int grow,
0.7, // double diagonal_weight, // relative to ortho
num_passes, // int num_passes,
0.03); // final double max_rchange, // = 0.01 - does not need to be accurate
System.arraycopy(disparity_ref1, 0, disparity_ref, 0, disparity_ref.length);
}
final String debugTitle=debug?reference_QuadClt.getImageName()+"-"+debugSuffix : null;
String [] debug_frame_titles = {"X", "Y", "D"};
String [] debug_titles = new String[num_refines+1];
......
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