surface_fit opimage2d × image2d × image2d → poly_surfaceimport fullseye as fs; fs.ledger.fit_poly_surface(x, y, z, degree=2) (実装を直接呼ぶなら import match3d; match3d.fit_poly_surface(x, y, z, degree=2)、台帳から引くなら ops3d.get("fit_poly_surface"))散布 (x,y,z) → z=f(x,y) 多項式最小二乗。返り値 model(coef/powers/degree/rms/pv)。
基底 {x^i·y^j : i + j <= degree}(項数 (degree+1)(degree+2)/2。degree=1 で 3 項の平面、
2 で 6 項の 2 次曲面)を lstsq で当てる。x, y, z は同じ要素数なら形は問わない(内部で
ravel。格子なら np.mgrid の出力をそのまま)。
返り値 dict: coef (T,) 係数、powers は各係数の (i, j)(項 x**i * y**j)、
degree、rms は残差 RMS、pv は残差の peak-to-valley(max − min)。単位は z。
eval_poly_surface(model, x, y) で任意点を評価。格子の高さ場なら surface_form_error
/ background_flatten がこれを内部で呼ぶ。py -3.11 examples_3d/contours_to_terrain.pypoly_surface を入力に取れる)fuse_to_voxel · eval_poly_surface
surface_fit)eval_poly_surface · surface_form_error · 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.