camera_orientation_from_sun — GEOCAM sun op

• Data kinds: keypoints × signal → table

• Call: import fullseye as fs; fs.ledger.camera_orientation_from_sun(sun_pixels, unix_times, lat_deg, lon_deg, K) (to call the implementation directly, import geocam; geocam.camera_orientation_from_sun(sun_pixels, unix_times, lat_deg, lon_deg, K); from the registry, opsgeocam.get("camera_orientation_from_sun"))

Usage

Time-stamped pixel positions of the sun, ≥ 2 points → camera (yaw, pitch, roll) (SVD solution of Wahba's problem = Kabsch).

For each observation: pixel → ray in camera coordinates d_c (from K), time → sun direction in the world s_w (sun_position, using the refraction-included elevation: what the camera sees is the apparent sun). R = argmin Σ |R d_c − s_w|² is solved in closed form with SVD (Kabsch 1976 / Markley 1988) and decomposed into (yaw, pitch, roll).

It is uniquely determined by 2 points (the plane spanned by 2 directions is needed). If there is 1 observation, or all point the same way (collinear), ValueError -- for example 2 images at the same time, or only noon for many days. The sun's azimuth moves a lot in 1 day, so 2 images, morning and evening of the same day, are enough.

Args:

sun_pixels: (N, 2) (u, v). Stacked outputs of sun_pixel_position.

unix_times: (N,) UNIX seconds (UTC).

lat_deg, lon_deg: camera position.

K: (fx, fy, cx, cy).

Returns:

table: yaw_deg / pitch_deg / roll_deg / residual_deg (RMS of the angular residual between rays and

sun directions) / max_residual_deg / n / condition (breadth of the plane spanned by the observation directions =

the 2nd singular value; the closer to 0, the more undetermined).

Detailed usage guide

• geocam family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_public_camera_heading — py -3.11 examples/poc_public_camera_heading.py

Ops the type connects to (they accept table as input)

render_skyline_view · camera_orientation_from_skyline

Same category (sun)

sun_position · sun_pixel_position · sun_bloom_fit · camera_orientation_from_sun_candidates


*Provenance: geocam.py — GEOCAM operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.