pysdic.add_gaussian_blur#

add_gaussian_blur(image, *, sigma)[source]#

Blur an image with a Gaussian kernel (defocus or optical blur).

The image is convolved with a Gaussian kernel of standard deviation \(\sigma\) along the rows and the columns (not along the channels), with scipy.ndimage.gaussian_filter. The edges are extended with their nearest values.

See also

add_gaussian_noise() for the usual order of the simulation of an acquisition.

Parameters:
  • image (ArrayLike) – The image, an array of shape \((H, W)\) or \((H, W, C)\) with finite values.

  • sigma (Real) – The standard deviation \(\sigma \geq 0\) of the kernel, in pixels.

Returns:

The blurred image, a float64 array with the shape of image.

Return type:

numpy.ndarray

Raises:

ValueError – If the image has a wrong shape or non-finite values, or an input has a wrong value.