remove_background#
- de_ebsd.index.preprocess.remove_background(patterns, static_bg=None, dynamic=True, operation='subtract', sigma=None, truncate=4.0, device=None, dtype=torch.float32)[source]#
Full EBSD preprocessing: static then dynamic background removal, on the GPU.
Convenience wrapper that runs
remove_static_background()(whenstatic_bgis given) followed byremove_dynamic_background()(whendynamic), the usual pre-indexing pipeline, all ondevicein one pass over the scan.- Parameters:
- patterns
The raw scan,
(H, W)/(N, H, W)/(rows, cols, H, W), numpy or torch.- static_bg
The static background image
(H, W); ifNone, the static step is skipped.- dynamic
Whether to also remove the dynamic (per-pattern Gaussian) background (default
True).- operation, sigma, truncate, device, dtype
Passed through to the two steps (see those functions).
- Returns:
torch.TensorThe cleaned patterns, same leading shape as the input, rescaled to
[0, 1], ready to hand toindex().