remove_dynamic_background#

de_ebsd.index.preprocess.remove_dynamic_background(patterns, sigma=None, operation='subtract', truncate=4.0, device=None, dtype=torch.float32)[source]#

Remove the per-pattern dynamic background (a Gaussian blur of each pattern).

Parameters:
patterns

Detector images, (H, W) / (N, H, W) / (rows, cols, H, W), numpy or torch.

sigma

Standard deviation of the Gaussian window. None (default) uses width / 8 (kikuchipy’s default), the width being the number of columns.

operation

"subtract" (default) or "divide".

truncate

Truncate the Gaussian window at this many standard deviations (default 4.0, matching scipy/kikuchipy).

device, dtype

As in remove_static_background().

Returns:
torch.Tensor

The cleaned patterns, same leading shape as the input, each rescaled to [0, 1].