sun op• 数据种类:keypoints × signal × signal → table
• 调用: import fullseye as fs; fs.ledger.camera_orientation_from_sun_candidates(candidates, frame_index, unix_times, lat_deg, lon_deg, shape, K=None, hfov_range_deg=(25.0, 120.0), tol_px=20.0, roll_max_deg=12.0, pitch_range_deg=(-40.0, 0.0), min_dt=1800.0, max_pairs=600, seed=0)(要直接调用实现,import geocam; geocam.camera_orientation_from_sun_candidates(candidates, frame_index, unix_times, lat_deg, lon_deg, shape, K=None, hfov_range_deg=(25.0, 120.0), tol_px=20.0, roll_max_deg=12.0, pitch_range_deg=(-40.0, 0.0), min_dt=1800.0, max_pairs=600, seed=0);从台账取用则 opsgeocam.get("camera_orientation_from_sun_candidates"))
从每帧中多个“亮团块”候选(混有太阳、白色汽车、标志、文字)中,用 RANSAC 选出按时刻规律运动的 1 条,同时确定 (yaw, pitch, roll) 与焦距 → table。固定相机中只有太阳以太阳的速度运动, 因此不凭外观、而凭运动来认定太阳(在 Fintraffic 天气相机上,基于外观的门禁曾 24/24 误检,2026-09-21)。
假设 = 从时刻差 ≥ min_dt 的 2 帧中各取 1 个候选 → 与 camera_orientation_from_sun 相同的 Wahba 2 点解。不满足道路相机先验知识(|roll| ≤ roll_max_deg,pitch 在 pitch_range_deg 内,水平视场角在 hfov_range_deg 内)的假设被舍弃 —— 相对于自由度 4(旋转 3 + 焦距)而候选过多时,偶然的 3 点会让非物理的位姿通过。票数 = 在预测位置 tol_px 以内有候选的帧数(地平线以下的时刻不投票)。实拍的光晕(bloom)中心会抖动 5~13 px(云、曝光),所以默认 20 px。用最优假设的内点把焦距做 1 维优化,并用全部点重新拟合旋转(2 次)。
湿路面上映出的太阳反射也以太阳的速度移动(镜像),所以仅凭运动无法区分。反射位于图像下侧(路面), 因此把它当作太阳拟合就会得到“相机朝上”的位姿(pitch > 0)—— 默认 pitch_range_deg 的上限 0 就是为此设的门禁(道路相机不会朝上)。若是朝上的相机请放宽。也建议做独立的验算(车道消失点的仰角 ≈ 0)。
传入 K 时就用它(不搜索焦距)。K=None 时主点为图像中心,把 fx = fy = f 在 hfov_range_deg 的范围内搜索 —— 公开相机通常没有内参。
Args:
candidates: (N, 2) 的 (u, v)。把全部帧的候选堆叠而成(sun_bloom_fit 或 sun_pixel_position 的输出)。
frame_index: (N,) 各候选属于哪一帧(unix_times 的下标,整数值)。
unix_times: (F,) 各帧的 UNIX 秒(UTC)。
lat_deg, lon_deg: 相机的位置。
shape: (H, W)。
K: (fx, fy, cx, cy) 或 None。
Returns:
table: yaw_deg / pitch_deg / roll_deg / f_px / hfov_deg / K(4,)/ inlier(N,,1 = 采用)/
n_inliers / n_frames / n_frames_with_candidates / residual_deg(采用点的角度残差 RMS)/
max_residual_deg / residual_px / loo_px(留 1 法预测误差的平均)/ loo_max_px / span_h
(采用点的时间跨度)/ n_hypotheses(通过先验知识的假设数)/ at_prior_bound(1 = 答案贴在先验知识的边缘:不可信)。
Raises:
ValueError: 候选少于 2 帧、没有通过先验知识的假设、内点少于 3。
• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。
• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。
• 算法的正典(作者、年份)与用途见上面的族使用指南。
• poc_public_camera_heading_real — py -3.11 examples/poc_public_camera_heading_real.py
table 作为输入)render_skyline_view · camera_orientation_from_skyline
sun)sun_position · sun_pixel_position · camera_orientation_from_sun · sun_bloom_fit
*Provenance: geocam.py — GEOCAM 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.