update_pixel_map_gs

pyrost.bin.update_pixel_map_gs(signatures, args, kwargs, defaults)

Update the pixel mapping by minimizing mean-squared-error (MSE). Perform a grid search within the search window of sw_ss, sw_fs size along the slow and fast axes accordingly in order to minimize the MSE.

Parameters
  • I_n (numpy.ndarray) – Measured intensity frames.

  • W (numpy.ndarray) – Measured frames’ whitefield.

  • I0 (numpy.ndarray) – Reference image of the sample.

  • u0 (numpy.ndarray) – Initial pixel mapping.

  • di (numpy.ndarray) – Sample’s translations along the slow detector axis in pixels.

  • dj (numpy.ndarray) – Sample’s translations along the fast detector axis in pixels.

  • sw_ss (int) – Search window size in pixels along the slow detector axis.

  • sw_fs (int) – Search window size in pixels along the fast detector axis.

  • ls (float) – Reference image length scale in pixels.

Returns

u – Updated pixel mapping array.

Return type

numpy.ndarray

Notes

The following error metric is being minimized:

\[MSE[i, j] = \frac{\sum_n \left( I_g[n] - I_{ref}[ii_n, jj_n] \right)^2}{\sum_n \left( I_g[n] - 1 \right)^2}\]

Where \(I_g[n]\) is a kriged intensity profile of the particular detector coordinate \(I_n[n, i, j]\). Intensity profile \(I_n[n, i, j]\) is kriged with gaussian radial basis function \(\phi\):

\[I_g[n] = \frac{\sum_{\Delta i, \Delta j} I_n[n, i + \Delta i, j + \Delta j] W[i + \Delta i, j + \Delta j] \phi[\Delta u[0], \Delta u[1]]} {\sum_{\Delta i, \Delta j} W[i + \Delta i, j + \Delta j]^2 \phi[\Delta u[0], \Delta u[1]]}\]
\[\Delta u[0] = u[0, i + \Delta i, j + \Delta j] - u[0, i, j]\]
\[\Delta u[1] = u[1, i + \Delta i, j + \Delta j] - u[1, i, j]\]
\[\phi [\Delta ii_{ref}, \Delta jj_{ref}] = \exp\left[{-\frac{(\Delta ii_{ref})^2 + (\Delta jj_{ref})^2}{ls^2}}\right]\]