Commit 1bbeb0e2 authored by Andrey Filippov's avatar Andrey Filippov

Debugging, bug fix in LMA weight for the 2-component mode (no 3D)

parent 4a753523
...@@ -1388,7 +1388,7 @@ public class Interscene { ...@@ -1388,7 +1388,7 @@ public class Interscene {
int debugLevel) int debugLevel)
{ {
System.out.println("reAdjustPairsLMAInterscene(): using mb_max_gain="+mb_max_gain); System.out.println("reAdjustPairsLMAInterscene(): using mb_max_gain="+mb_max_gain);
boolean freeze_xy_pull = true; // debugging freezing xy to xy_pull boolean freeze_xy_pull = false; // true; // debugging freezing xy to xy_pull
final boolean[] param_select = configured_lma? clt_parameters.ilp.ilma_lma_select : final boolean[] param_select = configured_lma? clt_parameters.ilp.ilma_lma_select :
ErsCorrection.getParamSelect( ErsCorrection.getParamSelect(
!freeze_xy_pull && (!readjust_xy_ims || (reg_weight_xy != 0)), // false only in mode c): freeze X,Y// boolean use_XY !freeze_xy_pull && (!readjust_xy_ims || (reg_weight_xy != 0)), // false only in mode c): freeze X,Y// boolean use_XY
...@@ -2296,6 +2296,10 @@ public class Interscene { ...@@ -2296,6 +2296,10 @@ public class Interscene {
intersceneLma.getSceneERSATR(true)); // true for initial values intersceneLma.getSceneERSATR(true)); // true for initial values
return null; return null;
} }
if (debug_level > -3){
System.out.println ("iter="+lmaResult+", RMS="+intersceneLma.getLastRms()[0]+
" (Pure RMS="+intersceneLma.getLastRms()[1]+")");
}
camera_xyz0 = intersceneLma.getSceneXYZ(false); // true for initial values camera_xyz0 = intersceneLma.getSceneXYZ(false); // true for initial values
camera_atr0 = intersceneLma.getSceneATR(false); // true for initial values camera_atr0 = intersceneLma.getSceneATR(false); // true for initial values
double [] diffs_atr = intersceneLma.getV3Diff(ErsCorrection.DP_DSAZ); double [] diffs_atr = intersceneLma.getV3Diff(ErsCorrection.DP_DSAZ);
...@@ -3103,8 +3107,8 @@ public class Interscene { ...@@ -3103,8 +3107,8 @@ public class Interscene {
return null; return null;
} else { } else {
if (debug_level > -3){ if (debug_level > -3){
System.out.println ("interCorrPair(): avg_offs = "+avg_offs+ System.out.print ("interCorrPair(): avg_offs = "+avg_offs+
" <= "+min_max[1]+", sw = "+sw); " <= "+min_max[1]+", sw = "+sw+" ");
} }
} }
} }
...@@ -4296,21 +4300,14 @@ public class Interscene { ...@@ -4296,21 +4300,14 @@ public class Interscene {
for (int nscene = earliest_scene; nscene < quadCLTs.length; nscene++) { for (int nscene = earliest_scene; nscene < quadCLTs.length; nscene++) {
QuadCLT scene = quadCLTs[nscene]; QuadCLT scene = quadCLTs[nscene];
/// if (nscene == ref_index) {
/// scenes_xyzatr[nscene] = new double[2][3];
/// scenes_xyzatr_dt[nscene] = new double[2][3];
/// } else {
String ts = scene.getImageName(); String ts = scene.getImageName();
scenes_xyzatr[nscene] = new double [][] {ers_reference.getSceneXYZ(ts),ers_reference.getSceneATR(ts)}; scenes_xyzatr[nscene] = new double [][] {ers_reference.getSceneXYZ(ts),ers_reference.getSceneATR(ts)};
scenes_xyzatr_dt[nscene] = ers_reference.getSceneErsXYZATR_dt(ts); scenes_xyzatr_dt[nscene] = ers_reference.getSceneErsXYZATR_dt(ts);
if (scenes_xyzatr[nscene] != null) { if (scenes_xyzatr[nscene] != null) {
num_processed++; num_processed++;
} }
/// }
} }
boolean use_processed = num_processed > 1; boolean use_processed = num_processed > 1;
// double [] quat_ortho = {0.5, 0.5, -0.5, 0.5}; // approximate IMU orientation
String header_ts="#\ttimestamp"; String header_ts="#\ttimestamp";
String header_img="\tx(m)\ty(m)\tz(m)\ta(rad)\ttilt(rad)\troll(rad)"+ String header_img="\tx(m)\ty(m)\tz(m)\ta(rad)\ttilt(rad)\troll(rad)"+
"\tVx(m/s)\tVy(m/s)\tVz(m/s)\tVa(rad/s)\tVt(rad/s)\tVr(rad/s)"+ "\tVx(m/s)\tVy(m/s)\tVz(m/s)\tVa(rad/s)\tVt(rad/s)\tVr(rad/s)"+
......
...@@ -737,9 +737,11 @@ public class IntersceneLma { ...@@ -737,9 +737,11 @@ public class IntersceneLma {
for (int iMTile = ai.getAndIncrement(); iMTile < vector_XYSDS.length; iMTile = ai.getAndIncrement()) if (vector_XYSDS[iMTile] != null){ for (int iMTile = ai.getAndIncrement(); iMTile < vector_XYSDS.length; iMTile = ai.getAndIncrement()) if (vector_XYSDS[iMTile] != null){
weights[num_components * iMTile] *= s; weights[num_components * iMTile] *= s;
weights[num_components * iMTile + 1] = weights[num_components * iMTile]; weights[num_components * iMTile + 1] = weights[num_components * iMTile];
if (num_components > 2) {
weights[num_components * iMTile + 2] *=s; weights[num_components * iMTile + 2] *=s;
} }
} }
}
}; };
} }
ImageDtt.startAndJoin(threads); ImageDtt.startAndJoin(threads);
......
...@@ -5269,7 +5269,7 @@ public class OpticalFlow { ...@@ -5269,7 +5269,7 @@ public class OpticalFlow {
boolean lpf_xy = false; // lpf x and y, re-adjust X,Y,Z,A,T,R with pull for X,Y. Disables boolean lpf_xy = false; // lpf x and y, re-adjust X,Y,Z,A,T,R with pull for X,Y. Disables
double avg_rlen = clt_parameters.imp.avg_len; // 3.0; double avg_rlen = clt_parameters.imp.avg_len; // 3.0;
boolean readjust_xy_ims = true; // false; boolean readjust_xy_ims = true; // false;
double reg_weight_xy = 10.0; // 0.05; // TODO: find out reasonable values double reg_weight_xy = 10.0; // 1.0; // 10.0; // 0.05; // TODO: find out reasonable values
boolean disable_ers = (quadCLTs[ref_index].getNumOrient() < 2); // first orient - no ERS! boolean disable_ers = (quadCLTs[ref_index].getNumOrient() < 2); // first orient - no ERS!
......
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