Commit 788cab17 authored by Andrey Filippov's avatar Andrey Filippov

fixed problem with rig adjustment when the same tile is measured with

NaN
parent 65bac413
...@@ -540,6 +540,10 @@ public class GeometryCorrection { ...@@ -540,6 +540,10 @@ public class GeometryCorrection {
diff_x, // used only with target_disparity == 0 diff_x, // used only with target_disparity == 0
diff_y, diff_y,
target_disparity); target_disparity);
if (Double.isNaN(rms)) {
System.out.println("rms= NaN");
}
if (debugLevel>-4) { if (debugLevel>-4) {
System.out.println("getRigCorrection(): Current RMS = "+rms+ "(debugLevel= "+debugLevel+")"); System.out.println("getRigCorrection(): Current RMS = "+rms+ "(debugLevel= "+debugLevel+")");
}; };
...@@ -651,6 +655,11 @@ public class GeometryCorrection { ...@@ -651,6 +655,11 @@ public class GeometryCorrection {
int tileY = nTile / tilesX; int tileY = nTile / tilesX;
int tileX = nTile % tilesX; int tileX = nTile % tilesX;
double w = strength[nTile]; double w = strength[nTile];
if (Double.isNaN(diff_y[nTile])) {
System.out.println("==== setupYW(): diff_y["+nTile+"]= NaN (can happen if the same tile is now measured differently)");
w = 0.0;
diff_y[nTile] = 0.0;
}
double inf_w_corr = 1.0; double inf_w_corr = 1.0;
if ((dx_max > 0) && (dx_pow > 0)){ if ((dx_max > 0) && (dx_pow > 0)){
inf_w_corr = (dx_max - diff_x[nTile])/dx_max; inf_w_corr = (dx_max - diff_x[nTile])/dx_max;
...@@ -661,6 +670,11 @@ public class GeometryCorrection { ...@@ -661,6 +670,11 @@ public class GeometryCorrection {
} }
if (target_disparity[nTile] == infinity_disparity) { // only for infinity tiles if (target_disparity[nTile] == infinity_disparity) { // only for infinity tiles
w *= inf_w_corr; w *= inf_w_corr;
if (Double.isNaN(diff_x[nTile])) {
System.out.println("==== setupYW(): diff_x["+nTile+"]= NaN (can happen if the same tile is now measured differently)");
w = 0.0;
diff_x[nTile] = 0.0;
}
y_vector[2*i + 0] = diff_x[nTile]; y_vector[2*i + 0] = diff_x[nTile];
w_vector[2*i + 0] = w; w_vector[2*i + 0] = w;
y_vector[2*i + 1] = diff_y[nTile]; y_vector[2*i + 1] = diff_y[nTile];
...@@ -692,7 +706,7 @@ public class GeometryCorrection { ...@@ -692,7 +706,7 @@ public class GeometryCorrection {
infinity_importance = 0.0; infinity_importance = 0.0;
k_near = (1.0 - infinity_importance)/sumw_near; k_near = (1.0 - infinity_importance)/sumw_near;
} }
System.out.println("setupYW(): k_inf="+k_inf+" k_near="+k_near); System.out.println("setupYW(): k_inf="+k_inf+" k_near="+k_near+" (sum2_inf="+sum2_inf+", sum2_near="+sum2_near+")");
double sum2 = k_inf*sum2_inf+k_near*sum2_near; double sum2 = k_inf*sum2_inf+k_near*sum2_near;
......
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