smlmlp.registrate_solve_redundant_affine module
- smlmlp.registrate_solve_redundant_affine(shiftx, shifty, angle, shearx, sheary, scalex, scaley, pair_info=None, /, sigma_thresh=3.0, max_outliers=None, shape=None, ref_pix=None, *, cuda=False, parallel=False)[source]
Solve absolute channel affine transforms from redundant pairwise transforms.
This function reconstructs one affine transform per channel from redundant pairwise affine measurements. It follows the same two-pass residual-based outlier rejection used for redundant shifts, but solves the affine matrices directly. The solved matrices are then recentered by the inverse of their mean matrix so the global movement is distributed across all channels.
- Parameters:
shiftx (array-like) – Pairwise shifts. Values are interpreted in the units defined by
ref_pix.shifty (array-like) – Pairwise shifts. Values are interpreted in the units defined by
ref_pix.angle (array-like) – Pairwise rotations in degrees.
shearx (array-like) – Pairwise shear parameters.
sheary (array-like) – Pairwise shear parameters.
scalex (array-like) – Pairwise scale parameters.
scaley (array-like) – Pairwise scale parameters.
pair_info (dict or None, optional) – Optional info dictionary returned by
registrate_ecc_affine. When provided,shapeandref_pixare read from it unless explicitly supplied.sigma_thresh (float, optional) – Threshold multiplier applied to the robust residual dispersion for outlier rejection in the second pass.
max_outliers (int or None, optional) – Maximum number of outlier pairs to reject. If
None, all detected outliers are removed.shape (tuple or None, optional) – Image shape used to rebuild pairwise affine matrices.
ref_pix (float or tuple of float or None, optional) – Reference pixel size used to convert shifts back to pixels. If
None, it is read frompair_infoor defaults to1.0.cuda (bool, optional) – Unused in this function. It is kept for API consistency.
parallel (bool, optional) – Unused in this function. It is kept for API consistency.
- Returns:
A tuple
(abs_shiftx, abs_shifty, abs_angle, abs_shearx, abs_sheary, abs_scalex, abs_scaley, info)where the first seven arrays contain one solved transform parameter per channel.- Return type:
tuple