slmsuite.holography.toolbox.window_square

window_square(window, padding_frac=0, padding_pix=0)[source]

Find a square that covers the active region of window.

Parameters
  • window (numpy.ndarray<bool> (height, width)) – Boolean mask.

  • padding (float) – Fraction of the window width and height to pad these by on all sides. For instance, This result is clipped to be within shape of the window.

Returns

window_square – A square that covers the active region of window in the format (x, width2, y, height2) where (x, y) is the upper left coordinate, and (width2, height2) define the extent.

Return type

(int, int, int, int)