pynrc.maths.image_manip.align_LSQ¶
- pynrc.maths.image_manip.align_LSQ(reference, target, mask=None, pad=False, interp='cubic', shift_function=<function fshift>)[source]¶
Find best shift value
LSQ optimization with option of shift alignment algorithm
- Parameters
reference (ndarray) – N x K image to be aligned to
target (ndarray) – N x K image to align to reference
mask (ndarray, optional) – N x K image indicating pixels to ignore when performing the minimization. The masks acts as a weighting function in performing the fit.
pad (bool) – Should we pad the array before shifting, then truncate? Otherwise, the image is wrapped.
interp (str) – Interpolation for fshift function. Default is ‘cubic’. Options are ‘linear’, ‘cubic’, or ‘quintic’.
shift_function (func) – which function to use for sub-pixel shifting. Options are fourier_imshift or fshift. fshift tends to be 3-5 times faster for similar results.
- Returns
list – (x, y, beta) values from LSQ optimization, where (x, y) are the misalignment of target from reference and beta is the fraction by which the target intensity must be reduced to match the intensity of the reference.