# calibration-8k, 115459 ground phase (gp5t8w): the first moments of the takeoff clip, fixed

Lane: calib8k, Ansel (01a16f0a) for BOS-Takeoff-Veillance (8ac6d87f), Claude Code chat ef1a66e3, 2026-10-25.
Stephen: "first moments of takeoff has bad camera pose estimation. let's clean that up". Then, via the coordinator: "use
google photo tiles for oblique calibration".
Follows [calibration-8k-v03_q4v9m2.md](calibration-8k-v03_q4v9m2.md) (v0.3) and [calibration-8k_b8k3t5.md](calibration-8k_b8k3t5.md).
No b8k3t5 or q4v9m2 file was edited. New files end in `_gp5t8w`. Nothing synced.

## The finding: the clip does not start on the runway

The full-rate readsb trace of a0b846 (UAL414, N14546, United A321neo, ADS-B category A3) shows the takeoff timing.

- **Geometric altitude:** -50 ft on the ground until 15:54:55. Then 0 ft at :56.2, +100 ft at :59.1, +200 ft at 15:55:00.1 and +300 ft at :02.5.
- **Baro rate:** 1344 fpm at 15:54:54.5.
- **Liftoff:** about 15:54:56.

The clip starts at 15:54:59.476 (photo-sync). At f0 the eye is already about 70 m above the runway, climbing at 13-15 m/s. There
is no takeoff roll in it: f0-f300 is the initial climb from about 80 to 230 m MSL.

Two biases put the old eye far too low:

1. **The "runway rule" of `eyetrack_b8k3t5.mjs`.** It adds four pseudo-observations at 10 m MSL (sigma 3 m) at 15:54:56, :58,
   15:55:00 and :02. They were written before the trace arrived, when rotation was assumed at ~15:55:03. With the trace in,
   they still beat its heights (sigma 15 m).
2. **The phone-photo GPS heights.** They lag: a stale 7 m fix at 15:55:05.8, and 116 m at :14.2. They held the climb
   15-20 m low over f80-f480.

How far off the old eye was:

| frame | f0 | f60 | f120 | f180 | f240 | f300 |
|---|---|---|---|---|---|---|
| eye too low by (m) | 57 | 66 | 60 | 45 | 29 | 16 |

This is why, in v0.3:

- the 3D Tiles anchors held only from f330 on;
- the AKAZE/KLT transfers broke (DEM-depth parallax with a wrong eye; 92 of 514 KLT pairs lost);
- the heading swung 274-303.

A check by eye agrees. At f0, AAL1205 (475 m away) sits about 8 deg below the horizon, which takes about 65 m of height.

v0.3 also has a broken field of view in f0-f105: its rows' hfov reads 56.6, 18.6, **8.2** (f60) and 11.8 deg, against the 61.55
it claims to hold. That is why the player's AAL1205 prediction at f60 lands thousands of px off.

## Method (`anchors-oblique_gp5t8w.mjs`, `oblique_gp5t8w.mjs`, `calibrate_gp5t8w.mjs`)

### 1. Eye (`eyetrack_gp5t8w.mjs`)

- The b8k3t5 spline on the trace ONLY, with geometric height and the -28.6 m geoid.
- The cabin eye is 1.7 m left of the antenna and 1.7 m below it.
- Then a **measured eye offset of +7 m along track and +6 m up**. The oblique tiles score was computed over a grid of eye shifts
  (rotation re-fitted each time) at f60, f90, f180 and f300. It peaks at +5 to +8 m up and +4 to +12 m ahead at all four, so
  one constant was adopted.
  - +7 m along is 0.08 s at 84 m/s. v0.3 saw the tiles peak ~0.12 s later along track on 115634.
  - The height lies between the two ADS-B sources: QNH-corrected baro reads ~10 m above geometric on this climb.

### 2. Oblique Google 3D Tiles render-and-compare (the primary instrument)

- One full perspective render per keyframe from the eye:
  - 1.6 x the 61.55 deg field at 1500 px;
  - up to 3000 leaves, so the distant skyline is in the render (Boston, the Tobin, Chelsea, 3-8 km) as well as the airfield,
    the bay, Constitution Beach and East Boston;
  - the Node server key via node-io; renders in memory only.
- Score: band-passed ZNCC of grey cells (band 2-10 cells), times the render's coverage of the frame's ground cells.
- Masks:
  - the window frame;
  - the frame's sky;
  - the frame's **water**: the bay renders dark in the tiles but bright blue in the frame, and that contrast reversal pulled the
    f60 heading 10 deg off before it was masked;
  - AAL1205.
- No sky fill: a constant sky value made a false pose win.
- Search, coarse to fine: a heading/pitch/roll grid at 24 px cells (±6 deg at the seed, ±4 deg after), then the best 8 distinct
  candidates refined at 12 px, then the winner at 6 px.
- Then patch shifts (12 x 7) give a per-keyframe residual and sigma, plus a 6-DOF diagnostic of the eye.
- Keyframes every 15 frames over f0-f330 and every 30 after: 29 in all, in two chains seeded at f60 and f240.

### 3. Joint adjustment

calib8k-lib `jointAdjust`, as in v0.3, with:

- **Anchors:**
  - the oblique anchors with s >= 0.5. 28 of 29 are held: s is 0.60-0.79 for all of them, and f0 is out at 0.48.
- **Interframe terms:**
  - KLT every frame on the 960 proxy and AKAZE between keyframes (>= 40 inliers), both by `transferPose` with the corrected eye;
  - hfov held at 61.55 deg.
- **Low-stretch interframe sigmas.** Below f330 (eye < 250 m) the KLT floor is 0.08 deg/frame (else 0.03) and the AKAZE floor
  0.3 deg (else 0.08).
  - Why: the near ground moves 0.5 deg per frame at 84 m/s, and the DEM-depth parallax correction let ~0.02 deg/frame of
    systematic heading error through.
  - The evidence: AAL1205's ADS-B offset must be constant, and it was constant to 0.16 deg under the raw oblique anchors but
    bent 0.5-0.8 deg under the joint solution with the old floors.
  - A scan over 0.06, 0.08, 0.10 and 0.15 chose 0.08.
- **f0, the first frame.**
  - It has no usable link: its frame interval is 0.175 s, KLT f0->f1 fails at rms 31 px, and its oblique match is weak (s 0.48,
    and worse with the eye moved back in time).
  - It gets a **heading-only anchor relative to AAL1205**: AAL1205's offset over f1-f66 has a median of -2.17 deg, f0 read
    -3.96, so the shift is +1.79 deg, sigma 0.3.
  - This is the only use of AAL1205 in the solution. Its pitch and roll come from the flow.

### Not used

- The 5-6 "physical prior" was not needed as a constraint. The data say the heading is not constant: there is no roll, and the
  phone is hand-held, turning ~+2.8 deg over f1-f60 and then drifting down ~3.7 deg to f330.
- AAL1205 stays an independent check except at f0.

## Results, before (v0.3 q4v9m2) and after (gp5t8w)

From `heldout_115459_gp5t8w.json`. Angles in deg; px at 1920 wide.

| segment | held-out before (every 4th) | held-out after: every 3rd / leave-one-out (median, max) | anchor residual before / after (median) | heading range before / after |
|---|---|---|---|---|
| early climb f0-f90 (80-125 m) | none held out | 0.23 / 0.29, 0.66 | (drape, no check) / 0.17 | 299.2-311.3 / 293.9-296.7 |
| climb f91-f300 (125-230 m) | 2.98 | 0.09, 0.29 / 0.08, 0.30 | 2.48 / 0.067 | 293.3-311.4 / 294.0-296.2 |
| f301-f514 | 0.54 | 0.28 / 0.31, 0.85 | 0.36 / 0.24 | 286.9-293.6 / 286.6-293.9 |
| **f0-f300** | **2.98** (1 keyframe) | **0.091 median, 0.293 max** (7) / **0.105, 0.656** (20) | | |

Over the whole clip:

| | v0.3 | gp5t8w |
|---|---|---|
| held-out median / max (deg) | 0.54 / 2.98 | 0.10 / 0.29 |
| KLT pairs held | 412/514 | 513/514 (f0-f330: 329/330) |
| anchors | 12 | 28 oblique + 1 relative |

Independent checks:

- **AAL1205 (f0-f66, the found pixel against its ADS-B position):**
  - before: median 7.0 deg off, 5.2 deg of spread;
  - after: 2.18 deg off, of which a **constant -2.17 deg horizontal / +0.12 deg vertical** and only **0.08 deg of spread**.
  - The constant part is the object, not the pose. It is 2.2 deg along AAL1205's northbound taxi track, about 17 m at 470 m:
    the A321's GNSS antenna ahead of the fuselage centroid the finder locks on (~12 m) plus ~0.5 s of ADS-B surface latency.
  - The distant azimuth ticks below confirm the absolute heading.
- **Runway edge stripes (OSM 4L/4R/15L/15R edges against the painted edge stripes; a random pose reads ~10 px):**
  - before: f0 12, f30 11.5, f60 10, f120 11, f180 10.5, f240 12 (random);
  - after: f30 4.5, f60 6, f120 5.5, f180 5.5, f240 8.5.
  - The floor of this check is OSM's own geometry: 1 m at 600 m is ~3 px.
  - In the f60 crop, the 4L centreline sits ~5-10 px above the midline of the aiming-point bars.
- **Distant skyline (rendered 3D Tiles silhouette beyond 2.5 km against the frame's skyline step):**
  - median +5, +1, -1 and +3 px at f0, f30, f60 and f120.
  - From f180 on it reads ~+20 px. That is not a pose error: the render stops at its 12 km range limit, below the hazy true
    horizon. The overlays show the silhouette on the city skyline.

## The click-ask's 6 landmarks

I confirmed them myself on the overlays, with OSM positions.

1. **AAL1205.** Confirmed: the accepted track-object rows, analysed above.
2. **Chelsea Street Bridge lift towers.** Confirmed, and **the click-ask's coordinate was wrong**.
   - It had 42.3867,-71.0298 ("from memory"); OSM puts the movable span at 42.38571,-71.02234 to 42.38690,-71.02307
     (ways 821600786-88), about 580 m east.
   - Ticks at those ends land on the two white towers at f0, f30, f60, f240 and f300, within ~5-15 px.
3. **Constitution Beach, east end.** Seen (the beach arc at f120-f300), not measured: no precise OSM point.
4. **The 22R threshold bars.** Confirmed visually at f60 and f120: the piano keys sit on the projected 4L/22R between the
   projected edges.
5. **The Tobin Bridge.** Confirmed: the tick at the OSM way (591493140) lands on the green truss at f30-f300.
6. **The Zakim towers.** Confirmed at the left edge at f0, f30 and f60 (OSM way 508557869).

Also confirmed: the Mystic station chimney (135 m, OSM way 240680217) lands on the tall stack. These are checks only; none
entered the solution.

## Acceptance, honestly

- **"Heading over the roll steady within ~0.5 deg":** the premise does not hold, because the clip has no roll.
  - The heading moves smoothly: +2.8 deg over f1-f60 (the phone turning in the hand), then down ~3.7 deg to f330.
  - The largest change in any 1 s is 0.74 deg over f91-f300 and 2.1 deg over f0-f90 (v0.3: 9.6 and 7.9).
  - The independent check is AAL1205's offset spread of 0.08 deg.
- **Runway markings within a few px:**
  - 4.5-6 px over f30-f180, 8.5 at f240, part of it OSM.
  - **f0 fails in the near field.** Its distant skyline and towers sit on the frame, but the near runways are 30-60 px off.
    Its stripe check reads 11 px (random).
  - f0's heading is corrected via AAL1205, but its pitch and roll come only from the flow. **Treat f0 alone as unreliable**
    (sigma_deg 0.6 in the file). f1 onward is fine.
- **Held-out median below 0.2 deg over f0-f300:** met.
  - 0.091 (every 3rd) and 0.105 (leave-one-out).
  - The early segment f0-f90 alone is 0.23 / 0.29, slightly above 0.2.
- **AAL1205's prediction on the aircraft:** it lands 2.2 deg (about 65 px at 1920) ahead of the aircraft along its taxi
  track, at a constant offset (spread 0.08 deg).
  - Before: 7 deg, with 5 deg of scatter.
  - The constant part is AAL1205's own ADS-B reference point and latency. The player could subtract it per object.

## Files (artifacts/calibration-8k/)

- **Poses:**
  - `poses_115459_gp5t8w.json` (schema bos-calib8k-poses/2, 515 rows; v0.3's columns and lens).
  - `kind` is `anchor:tiles-oblique`, `anchor:object-relative` (f0), `keyframe:flow` or `flow`.
  - `anchor_px` is the oblique patch residual at the anchor keyframes.
  - `meta.eye` documents the fix.
  - `summary` has `heldout`, `leave_one_out`, `aal1205_check` and `f0_fix`.
- **Held-out test:** `heldout_115459_gp5t8w.json`, the before/after per segment above.
- **Overlays:** `overlays_gp5t8w/115459_f0000|0030|0060|0120|0180|0240|0300|0400.jpg`, with `checks.json`.
  - Contents: OSM runway edges, centrelines and taxiways; the 3D Tiles distant silhouette; the frame skyline; OSM tall
    landmarks; azimuth ticks; AAL1205.
  - The **before** set, from the v0.3 poses, is in `overlays_gp5t8w/before-q4v9m2/` (same frames).
  - Attribution is burned in.
- **Plot:** `compare-rotation_115459_gp5t8w.html`, heading, pitch and roll over time, v0.3 against gp5t8w.
  - Anchors are dots; hover gives values; there is a table view; light and dark.
- **Code:** `eyetrack_gp5t8w.mjs`, `oblique_gp5t8w.mjs`, `anchors-oblique_gp5t8w.mjs` (its output is
  `anchors-oblique_115459_gp5t8w.json`: poses, scores and patch shifts, no renders), `calibrate_gp5t8w.mjs`,
  `overlay_gp5t8w.mjs`, `heldout-report_gp5t8w.mjs`, `plot-compare_gp5t8w.mjs`, `fetch-osm-aeroway_gp5t8w.mjs` with
  `osm_gp5t8w/aeroway.json` (ODbL).
- **Logs:** `calib-log_115459_gp5t8w.json`.
- **Scratch:** the 1920 frames, both passes and the experiments are in `_scratch/bos-calib8k/gp5t8w/`.

## For the other lanes

- **Consumers of 115459 (player, takeoff-3d, ROP):** switch to `poses_115459_gp5t8w.json`. Its row eye heights differ from v0.3
  by up to 66 m in f0-f300 (+6 m elsewhere), so the eye in the rows must be used, not recomputed.
- **The other clips (115531, 115634)** still use the b8k3t5 eye with the photo heights. The +7 m / +6 m offset and the
  photo-height bias probably apply there too; this was not re-run.
- **`camera-distort_q4v9m2.mjs projectDir` folds far off-axis points back into the image.** With k1 < 0, a ray ~86 deg
  off-axis (tangent ~15) wraps around: taxiway M, 2.4 km behind-left at f300, drew a line across the bay.
  - Consumers projecting wide point sets should keep only points whose undistorted tangents fall inside the field.
  - `overlay_gp5t8w.mjs` has the guard (`inField`). The q4v9m2 file is not edited.

## Next

- f0: a sub-frame time for the phone's first frame, or a dedicated near-field fit.
- Re-run 115531 and 115634 on the trace-only eye with the measured offset.
- A per-object offset (antenna and latency) for the player's track view.
