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])。
• 示例数据目录(下载 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.