slitflow.img.noise module

class Gauss(info_path=None)[source]

Bases: Image

Add Gaussian noise to all pixels.

Parameters:
  • reqs[0] (Image) – Image to add noise. Required columns; intensity.

  • param["type"] (str, optional) – The value type of intensity. Defaults to “float32”.

  • param["sigma"] (float, optional) – The standard deviation of the Gaussian noise. Defaults to 1.

  • param["baseline"] (float, optional) – The baseline value of the background. Defaults to 0.

  • param["seed"] (int, optional) – The random seed.

  • param["split_depth"] (int) – The file split depth number.

Returns:

The image with Gaussian noise.

Return type:

Image

set_info(param={})[source]

Copy info from reqs[0] then change and add columns.

static process(reqs, param)[source]

Add Gaussian noise to all pixels.

Parameters:
  • reqs[0] (numpy.ndarray) – The image to which noise is to be added.

  • param["type"] (str) – The value type of intensity.

  • param["sigma"] (float) – The standard deviation of the Gaussian noise.

  • param["baseline"] (float) – The baseline value of the background.

Returns:

The image with Gaussian noise.

Return type:

numpy.ndarray

gauss_noise(x, sigma, baseline)[source]

Adds Gaussian noise to an input pixel value.

Parameters:
  • x (float) – Input pixel value.

  • sigma (float) – Standard deviation of the Gaussian noise.

  • baseline (float) – Baseline value of the noise.

Returns:

The input pixel value with added Gaussian noise.

Return type:

float