mcc_scoring#

mcc_scoring(template, template_mask, template_filter, ft_target, ft_target2, ft_target_mask, fast_shape, fast_ft_shape, rotations, callback, interpolation_order, overlap_ratio=0.3)[source]#

Computes a normalized cross-correlation score between target (f), template (g), template_mask (m) and target_mask (t)

\[\frac{ CC(f, g) - \frac{CC(f, m) \cdot CC(t, g)}{CC(t, m)} }{ \sqrt{ (CC(f ^ 2, m) - \frac{CC(f, m) ^ 2}{CC(t, m)}) \cdot (CC(t, g^2) - \frac{CC(t, g) ^ 2}{CC(t, m)}) } },\]

where

\[CC(f,g) = \mathcal{F}^{-1}(\mathcal{F}(f) \cdot \mathcal{F}(g)^*).\]
Parameters:
templateUnion[Tuple[type, tuple of ints, type], BackendArray]

Template data buffer, its shape and datatype.

template_maskUnion[Tuple[type, tuple of ints, type], BackendArray]

Template mask data buffer, its shape and datatype.

template_filterUnion[Tuple[type, tuple of ints, type], BackendArray]

Template filter data buffer, its shape and datatype.

ft_targetUnion[Tuple[type, tuple of ints, type], BackendArray]

Fourier transformed target data buffer, its shape and datatype.

ft_target2Union[Tuple[type, tuple of ints, type], BackendArray]

Fourier transformed squared target data buffer, its shape and datatype.

ft_target_maskUnion[Tuple[type, tuple of ints, type], BackendArray]

Fourier transformed target mask data buffer, its shape and datatype.

fast_shape: tuple of ints

Data shape for the forward Fourier transform.

fast_ft_shape: tuple of ints

Data shape for the inverse Fourier transform.

rotationsBackendArray

Rotation matrices to be sampled (n, d, d).

callbackCallbackClass

A callable for processing the result of each rotation.

interpolation_orderint

Spline order for template rotations.

overlap_ratiofloat, optional

Required fractional mask overlap, 0.3 by default.

References

[1]

Masked FFT registration, Dirk Padfield, CVPR 2010 conference