morph — SHAPE2D morph op

• 資料種類:image2d × image2d × pairs × pairs → image2d

• 呼叫: import fullseye as fs; fs.ledger.morph(imgA, imgB, ptsA, ptsB, alpha, method='affine', lam=0.0, with_corners=True)(要直接呼叫實作,import imagemorph; imagemorph.morph(imgA, imgB, ptsA, ptsB, alpha, method='affine', lam=0.0, with_corners=True);從台帳取用則 opsshape2d.get("morph"))

用法

透過對應點對 2 張影像 A、B 進行變形(morph),產生比例 alpha 的中間影像。

步驟(Beier–Neely 式網格變形):

1. 建構中間形狀 mid = (1-alpha)·ptsA + alpha·ptsB。

2. 把 A 依 ptsA→mid、把 B 依 ptsB→mid 變形(使兩者的特徵對齊到 mid)。

3. 用 alpha 對 warp(A)、warp(B) 做交叉溶接。

alpha=0 時與 A 一致,alpha=1 時與 B 一致。與單純的 blend(A,B,alpha) 不同,眼、鼻等特徵不會成為重影,而是重疊為 1 個(=「真正的中間」)。

參數:

imgA, imgB: (H,W[,C]),同 shape,[0,1]。

ptsA, ptsB: (K,2) 的 (x,y)。A 與 B 的對應點(數量相同、順序相同)。

alpha: 合成比例 [0,1]。

method: "affine"(分段仿射,快)或 "tps"(平滑)。

lam: TPS 的平滑係數(method="tps" 時)。

with_corners: 為 True 時把四角加為固定點,防止邊緣出現空洞。

回傳值: (H,W[,C]) 的中間影像([0,1])。

詳細使用指南

• shape_description_2d 族使用指南

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• image_morph — py -3.11 examples/image_morph.py

• poc_vanishing_detail_and_morphing_area — py -3.11 examples/poc_vanishing_detail_and_morphing_area.py

型別可銜接的下一個運算子(可接受 image2d 作為輸入)

warp_tps_image · warp_piecewise_affine · blend · morph_sequence

同類別(morph)

add_frame_corners · warp_tps_image · warp_piecewise_affine · blend · morph_sequence


*Provenance: imagemorph.py — SHAPE2D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.