prtools.gauss#

gauss(shape, sigma, shift=(0, 0), indexing='ij')[source]#

Generate a 2D Gaussian function.

Parameters:
  • shape (array_like) – Size of output in pixels (nrows, ncols)

  • sigma (float or (2,) array_like) – Stardard deviation of the Gaussian in pixels. If sigma has two entries it is interpreted as (sigma horizontal, sigma vertical).

  • shift ((2,) array_like, optional) – Shape translation from center of containing array. Default is (0, 0)

  • indexing ({'ij', 'xy'}, optional) – Matrix (‘ij’, default) or cartesian (‘xy’) indexing of output.

Return type:

ndarray

Examples

>>> gauss = prtools.gauss(shape=(256,256), sigma=20)
>>> plt.imshow(gauss, cmap='gray')
../_images/prtools-gauss-1.png