Commit 935e1dcd authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: CuasPoseRT: pixel-unit RMSE + per-scene log identification

Per Andrey: (1) fitted-vs-stored deltas reported in PIXELS (the informative
unit), using the same scales as the LMA par_scales - az/tilt = focal/pixelSize,
roll = distortionRadius/pixelSize; mrad kept secondary. (2) A 'CuasPoseRT scene
i (of N) <timestamp> Done/FAILED' line after each fit so the unlabeled LMA
iteration prints above it are attributable to a scene (SYSTEM_OUT-01.log had
iterations but no index/timestamp). Per-scene line also shows dstored in pix.

Verified with standalone javac (Eyesis live - no mvn).
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent d23011b4
......@@ -192,6 +192,14 @@ public class CuasPoseRT {
quadCLTs[earliest].getImageName()+", seeding with identity");
}
// Angle->pixel conversion, same scales the LMA uses (GeometryCorrection par_scales):
// az/tilt ~ focal length, roll ~ distortion radius (edge-of-field displacement)
final double px_per_rad_at = 1000.0 * center_CLT.getGeometryCorrection().focalLength /
center_CLT.getGeometryCorrection().pixelSize;
final double px_per_rad_r = 1000.0 * center_CLT.getGeometryCorrection().distortionRadius /
center_CLT.getGeometryCorrection().pixelSize;
final double [] px_per_rad = {px_per_rad_at, px_per_rad_at, px_per_rad_r};
// ---- Ascending per-scene loop (the RT iterator) ----
final int tilesX = center_CLT.getTilesX();
final int tilesY = center_CLT.getTilesY();
......@@ -316,6 +324,23 @@ public class CuasPoseRT {
if (ok && (stored[nscene] != null)) num_cmp++;
sb.append(String.format(", %.6f, %.1f, %.0f, %d\n",
ok ? lma_rms[0] : Double.NaN, lma_rms[2], lma_rms[3], fail_reason[0]));
// Scene identification line - attributes the preceding (unlabeled) LMA iteration
// prints from adjustPairsLMAInterscene to this scene (index of N + timestamp)
if (debugLevel > -4) {
StringBuffer sl = new StringBuffer();
sl.append("CuasPoseRT scene "+nscene+" (of "+quadCLTs.length+") "+ts_name+
(ok ? " Done." : " FAILED (coasted).")+
String.format(" RMS=%.4f, weight=%.1f, num=%.0f", lma_rms[0], lma_rms[2], lma_rms[3]));
if (st != null) {
sl.append(" dstored[pix]=[");
for (int j = 0; j < 3; j++) {
sl.append(String.format((j > 0 ? ", %7.4f" : "%7.4f"),
(fitted[nscene][1][j] - st[j]) * px_per_rad[j]));
}
sl.append("]");
}
System.out.println(sl.toString());
}
// zero-order prediction for the next scene
prev_pose = predicted;
prev_ts = ts;
......@@ -359,10 +384,15 @@ public class CuasPoseRT {
if (num_cmp > 0) {
final String [] names = {"azimuth", "tilt", "roll"};
for (int j = 0; j < 3; j++) {
final double rms_rad = Math.sqrt(sum2_d[j]/num_cmp);
System.out.println(String.format(
" fitted-stored %8s: RMS=%9.6f rad (%8.4f mrad), max=%9.6f rad",
names[j], Math.sqrt(sum2_d[j]/num_cmp), 1000*Math.sqrt(sum2_d[j]/num_cmp), max_d[j]));
" fitted-stored %8s: RMS=%7.4f pix, max=%7.4f pix (%8.4f mrad, max %8.4f mrad)",
names[j], rms_rad*px_per_rad[j], max_d[j]*px_per_rad[j],
1000*rms_rad, 1000*max_d[j]));
}
System.out.println(String.format(
" (pixel scales: az/tilt %.1f pix/rad = focal/pixelSize, roll %.1f pix/rad = distortionRadius/pixelSize)",
px_per_rad_at, px_per_rad_r));
}
return fitted;
}
......
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