surface_fit op• 資料種類:image2d × image2d × image2d → poly_surface
• 呼叫: import 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)。
用 lstsq 擬合基底 {x^i·y^j : i + j <= degree}(項數 (degree+1)(degree+2)/2。degree=1 為 3 項的平面, 2 為 6 項的 2 次曲面)。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。
• 點數少於項數時會靜默回傳最小範數解。x, y 的數量級大時高次會病態
(先將座標中心化、正規化)。不檢查 NaN。
後續: 用 eval_poly_surface(model, x, y) 在任意點求值。網格上的高度場由 surface_form_error / background_flatten 在內部呼叫本函式。
• blas_threads_and_memory — 矩陣分解為何慢 —— BLAS 執行緒、快取、記憶體配置
• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。
• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。
• contours_to_terrain — py -3.11 examples_3d/contours_to_terrain.py
poly_surface 作為輸入)fuse_to_voxel · eval_poly_surface
surface_fit)eval_poly_surface · surface_form_error · background_flatten
*Provenance: match3d.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.