background_flatten — 3D surface_fit op

Data kinds: image2dimage2d

Call: import fullseye as fs; fs.ledger.background_flatten(image, degree=2) (to call the implementation directly, import match3d; match3d.background_flatten(image, degree=2); from the registry, ops3d.get("background_flatten"))

Usage

Fit and subtract a low-order surface (uneven illumination) from an image = shading correction. → flattened.

> The detailed description below is the original text — the summary and the headings are translated.

`(H,W) 画像に x = 列y = 行fit_poly_surface(degree)`(既定 2 次)を当て、

`image − fit` を float64 で返す。出力は平均がほぼ 0 で 負の値を含む(表示・閾値化には

`min` を引くか定数を足す)。前景が広いと前景もフィットに引かれて削られる(前景を除いた点で

`fit_poly_surfaceeval_poly_surface` で減算する方が安全)。

グレースケール 2-D のみ(3-D は失敗)。NaN があると lstsq が失敗する。

用途: 閾値化の前処理、`polar_unwrap` した円環画像の照明補正。

Background guides (the physics and conventions behind this op)

blas_threads_and_memory — 行列分解が遅い理由の知識 — BLAS スレッド・キャッシュ・メモリ配置

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.

Runnable examples (verified samples that actually call this op)

geometry_metrologypy -3.11 examples_3d/geometry_metrology.py

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

fuse_to_voxel · fit_poly_surface · eval_poly_surface · surface_form_error · polar_unwrap · fit_zernike · matcap_shade · antialias

Same category (surface_fit)

fit_poly_surface · eval_poly_surface · surface_form_error


*Provenance: match3d.py — 3D 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.