surface_fit op• データ種: image2d → measurement
• 呼び出し: import fullseye as fs; fs.ledger.surface_form_error(height, degree=1) (実装を直接呼ぶなら import match3d; match3d.surface_form_error(height, degree=1)、台帳から引くなら ops3d.get("surface_form_error"))
• 台帳経由の戻り値: fullseye.ledger.surface_form_error(...) は**宣言 out 型 measurement の値だけ**を返す(本体は補助情報も返す)。捨てられた側が要るときは fullseye.ledger.surface_form_error.raw(...)、または match3d.surface_form_error を直接呼ぶ。
• 本体の返り: (residual, rms, pv) → pv float
高さ場 grid → 理想曲面(多項式)残差=形状誤差(平面度 deg1/球面度 deg2)。→ (residual, rms, pv)。
`(H,W) の高さ場に x = 列 index、y = 行 index で fit_poly_surface(degree)` を当て、
`residual = height − fit を返す。degree=1 は最小二乗平面(平面度=pv)、degree=2` は
2 次曲面(球面の近似。真の球ではない)。
返り値 `(residual (H,W) float64, rms, pv)`、単位は高さの単位(横方向は画素単位なので傾き
係数は「高さ/画素」)。NaN があると lstsq が失敗する(欠損は先に埋める)。2-D 以外の入力は
形の unpack で失敗する。
用途: 平面度・うねりの評価。`background_flatten` は同じ計算の「画像版」。点群の平面度は
`fit_plane_3d` の resid。
• blas_threads_and_memory — 行列分解が遅い理由の知識 — BLAS スレッド・キャッシュ・メモリ配置
• サンプルデータ カタログ(DL URL / ライセンス) — 2-D は skimage.data(BSD/public)+ 合成、3-D は実データ源(Stanford/PDS 等)の DL URL。
• 演算子の来歴・参考文献 — この op 族の元になった研究/手法の出典。
• geometry_metrology — py -3.11 examples_3d/geometry_metrology.py
measurement を入力に取れる)vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle
surface_fit)fit_poly_surface · eval_poly_surface · background_flatten
*Provenance: match3d.py — 3D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.