register_ecc — MATCHREG intensityreg op

• 数据种类:image2d × image2d → table

• 调用: import fullseye as fs; fs.ledger.register_ecc(fixed, moving, motion='affine', n_iter=200, eps=1e-06, warp_init=None, levels=1, smooth_sigma=1.1, nonpositive='raise', min_rho=0.0)(要直接调用实现,import intensityreg; intensityreg.register_ecc(fixed, moving, motion='affine', n_iter=200, eps=1e-06, warp_init=None, levels=1, smooth_sigma=1.1, nonpositive='raise', min_rho=0.0);从台账取用则 opsmatchreg.get("register_ecc"))

• GPU:无(仅 CPU 参考实现)

用法

用使增强相关系数(ECC)最大的参数变换将 moving 对齐到 fixed。→ table(kind="registration")。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

Evangelidis & Psarakis(2008)の前向き加法の反復: 毎回 moving と勾配を今の変換で標本化し、急降下画像 G = ∇I · ∂W/∂p(平均を引く)とゼロ平均の 2 枚から、相関係数の 2 次近似の最大へ Δp を解く。相関係数は明るさのアフィンな違い(利得とずれ)に不変 —— 負の利得(白黒の反転) や折り返しのある対応には効かない(分母が 0 以下になったら ValueError。それには register_mi)。

motion: "translation"(2)/ "euclidean"(3、回転 + 並進)/ "affine"(6)/ "homography"(8)。levels > 1 で粗から細のピラミッド(OpenCV の findTransformECC には無い追加。初期のずれの許容が広がる —— register_capture_range で測れる)。

実測(96×96 の featmatch.synthetic_scene、3 次スプラインで合成、tests/test_intensityreg.py

が固定): 並進 (2.5, -1.5) px の誤差 < 0.05 px、アフィンの 4 隅誤差 < 0.1 px、OpenCV 5.0 の findTransformECC と変換の差 < 0.05 px。

Args:

fixed: 基準(テンプレート)の 2-D 画像。

moving: 合わせる 2-D 画像(大きさは違ってよい)。

motion: ECC_MOTIONS。

n_iter: 段ごとの反復の上限。

eps: 相関係数の変化がこれ未満で収束。

warp_init: 初期の変換(2×3 / 3×3、fixed → moving)。None なら恒等。

levels: ピラミッドの段数(1 = 原寸だけ、None なら最も粗い段が 16 px 以上で最大 3 段)。

smooth_sigma: 前処理のガウスの σ [px] (OpenCV の gaussFiltSize=5 は σ ≈ 1.1)。0 で無し。

nonpositive: 相関の 2 次近似の分母が 0 以下になったとき(初期値が遠い・撮像が違う)。"raise"

(既定、OpenCV と同じく ValueError)/ "step"(相関を正へ戻す λ を選んで続ける。初期のずれの

許容が広がることがある —— register_capture_range で測れる)。

min_rho: 収束した相関係数がこれ未満なら ValueError("step" で白黒反転の組を「合った」と

返さないための床)。

Returns:

dict(kind="registration", method="ecc")。warp (3,3) / flow2d (2,H,W) の

(dy, dx) / warped(fixed の格子へ戻した moving、外側は 0)/ valid / valid_fraction /

metric_name="ecc_rho" / metric(最後の相関係数)/ iterations / converged /

history / model / image_shape。

Raises:

ValueError: 画像が不正 / motion が違う / 引数が値域外 / 初期の変換が特異 / 反復が発散 /

テンプレートが画像の外へ出た / 相関が負で ECC が定義できない(nonpositive="raise")/

収束した相関が min_rho 未満。

详细使用指南

• matching_registration 族使用指南

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

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

可运行的示例(实际调用该算子并已验证的样例)

• poc_multimodal_mi_registration — py -3.11 examples/poc_multimodal_mi_registration.py

类型可衔接的下一个算子(可接受 table 作为输入)

features_match · ransac_homography · ransac_fundamental · registration_to_flow2d

同类别(intensityreg)

register_mi · register_ffd · registration_to_flow2d · register_accuracy_map · register_capture_range


*Provenance: intensityreg.py — MATCHREG 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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