Commit 40bc3da4 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: fopen_pose_compare.py — use timestamp as frame identity, drop scene_idx

Timestamps are unambiguous when using sub-sequences (e.g. 378 of 498
frames).  0-based sequential scene_idx was misleading.

- console top-N table: Scene column replaced with Timestamp
- CSV: scene_idx column removed, timestamp is the identity column
- parse_interframe_xml: drop scene_idx from returned dicts
Co-authored-by: 's avatarClaude <claude@elphel.com>
parent 730211c2
......@@ -193,8 +193,7 @@ def parse_interframe_xml(path, skip_rows=None):
Returns list of dicts sorted by timestamp — same order as COLMAP frame_NNNN
(elphel_to_colmap.py assigns frame numbers by sorting timestamps).
scene_idx — 0-based sequential index
timestamp — float seconds
timestamp — float seconds (from key "1763233715_106222" → 1763233715.106222)
x/y/z — position (m) relative to reference scene
az/tilt/roll — orientation (rad)
"""
......@@ -229,7 +228,6 @@ def parse_interframe_xml(path, skip_rows=None):
continue
x, y, z, az, tilt, roll = vals
rows.append({
'scene_idx': i,
'timestamp': ts,
'x': x, 'y': y, 'z': z,
'az': az, 'tilt': tilt, 'roll': roll,
......@@ -423,10 +421,10 @@ def print_top_pos_residuals(pairs, residuals, s, n=10):
"""Top-n worst position residuals."""
idx = np.argsort(residuals)[::-1]
print(f"\n Top-{n} worst position frames (1 COLMAP = {1/s:.1f} m):")
print(f" {'Frame':>6} {'Scene':>6} {'res(COLMAP)':>12} {'res(m)':>10}")
print(f" {'Frame':>6} {'Timestamp':>20} {'res(COLMAP)':>12} {'res(m)':>10}")
for i in idx[:n]:
c, e = pairs[i]
print(f" {c['frame']:>6} {e['scene_idx']:>6} {residuals[i]:>12.4f} "
print(f" {c['frame']:>6} {e['timestamp']:>20.3f} {residuals[i]:>12.4f} "
f"{residuals[i]/s:>10.2f}")
......@@ -481,7 +479,7 @@ def main():
# ── CSV ────────────────────────────────────────────────────────────────
if args.out:
base_fields = [
'frame', 'scene_idx', 'timestamp',
'frame', 'timestamp',
'colmap_X', 'colmap_Y', 'colmap_Z',
'xml_x', 'xml_y', 'xml_z',
'xml_az_rad', 'xml_tilt_rad', 'xml_roll_rad',
......@@ -506,7 +504,6 @@ def main():
for i, (ce, er) in enumerate(pairs):
row = {
'frame': ce['frame'],
'scene_idx': er['scene_idx'],
'timestamp': er['timestamp'],
'colmap_X': ce['center'][0],
'colmap_Y': ce['center'][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