warp_by_plane — 3D plane_sweep_stereo op

Data kinds: image2dimage2d

Call: import fullseye as fs; fs.ledger.warp_by_plane(img: 'np.ndarray', H: 'np.ndarray', order: 'int' = 1, cval: 'float' = nan) -> 'np.ndarray' (to call the implementation directly, import plane_sweep; plane_sweep.warp_by_plane(img: 'np.ndarray', H: 'np.ndarray', order: 'int' = 1, cval: 'float' = nan) -> 'np.ndarray'; from the registry, ops3d.get("warp_by_plane"))

Usage

Inverse-warp img by the homography H. → out[y,x] = img(H·(x,y,1)) (bilinear).

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

H は出力(ref)画素 → 入力(src)画素の写像。視野外は cval(既定 NaN)。

出力画素 (x=列, y=行) ごとに `q = H @ (x, y, 1)(sx, sy) = (q0/q2, q1/q2)` を求め、

`scipy.ndimage.map_coordinates` で入力画像の (行 sy, 列 sx) を補間して埋める(逆ワープなので

穴が空かない)。出力の形は入力と同じ (h,w)。同モジュールの `plane_homography` が返す H

(ref 画素 → src 画素)をそのまま渡すと「src を ref 視点へ持ってきた画像」になる。

• `img: (H,W) の 2-D グレースケール(float に変換)。空・非 2-D は ValueError`。

• `H: (3,3) 以外は ValueError`。

• `order: 補間次数(既定 1 = bilinear)。prefilter=False` で呼ぶため、2 以上を指定しても

スプライン前処理を省いた近似(平滑化寄り)になる。

• `cval: 入力の範囲外に写った画素、および |q2| < 1e-12`(無限遠に飛ぶ画素)に入れる値。

既定 NaN なので、後段で `np.isfinite` により「対応が取れなかった画素」を区別できる。

`plane_sweep_depth は候補深度ごとにこの関数で src をワープし、|I_ref - warp(I_src)|` を

photo-consistency コストにしている。

Background guides (the physics and conventions behind this op)

depth_sensors — 深度センサの知識 — 測距原理・実機の値・欠測の出方

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)

motion_scenepy -3.11 examples_3d/motion_scene.py

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

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

Same category (plane_sweep_stereo)

plane_sweep_depth


*Provenance: plane_sweep.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.