smlmlp.registrate_ecc_affine module
- smlmlp.registrate_ecc_affine(optimized, /, ref_pix=1.0, *, ecc_max_iters=1000, ecc_eps=1e-07, ecc_gauss_filt=0, mask_quantile=70.0, translation_init=True, cuda=False, parallel=False)[source]
Estimate redundant pairwise affine transforms with ECC registration.
This function computes an affine transform between every pair of optimized channel images with OpenCV’s enhanced correlation coefficient registration. The OpenCV warp is converted to the row/column convention used by
scipy.ndimage.affine_transformandarrlp.img_transformbefore being decomposed into transform parameters.- Parameters:
optimized (sequence of ndarray) – Sequence of optimized registration images.
ref_pix (float or tuple of float, optional) – Reference pixel size used to convert fitted parameters.
ecc_max_iters (int, optional) – Maximum iterations for OpenCV ECC optimization.
ecc_eps (float, optional) – Convergence epsilon for OpenCV ECC optimization.
ecc_gauss_filt (int, optional) – Gaussian filter size used by OpenCV ECC. Use
0to keep the original no-smoothing ECC behavior.mask_quantile (float, optional) – Reserved compatibility knob (currently unused in baseline ECC logic).
translation_init (bool, optional) – Reserved compatibility knob (currently unused in baseline ECC logic).
cuda (bool, optional) – Whether to use CUDA execution.
parallel (bool, optional) – Whether to use parallel execution.
- Returns:
A tuple
(shiftx, shifty, angle, shearx, sheary, scalex, scaley, info)where each list contains one value per channel pair. Shifts are returned in the units defined byref_pix.The dictionary contains the following keys:
'ref_pix'Reference pixel size used for shift conversion.
'shape'Optimized image shape used when extracting affine parameters.
'pairs'List of channel index pairs corresponding to the outputs.
'matrices'Pairwise affine matrices in
arrlp.img_transformconvention.'warp_matrices'Pairwise affine matrices in OpenCV x/y convention.
'ecc'Enhanced correlation coefficient values returned by OpenCV.
- Return type:
tuple