pingwyn.remove_artefacts

Remove a variety of scanning artefacts using FFT based feature detection. This function is based on Laurens Westenberg’s artefact removal code version 4, dated 2025-09-18.

Noise is detected by considering the similarities between the FFTs of the trace and retrace images, as well as features that lie along symmetry planes in the trace and retrace FFT images separately.

The returned image is an average of the cleaned trace and retrace images. The individual images are cleaned by blending between the input image and a denoised image based on the local noise strength.

param image_trace:

Trace image to remove artifacts from.

type image_trace:

pingwyn.Image

param image_retrace:

Retrace image corresponding to image_trace.

type image_retrace:

pingwyn.Image

param threshold:

Threshold for selecting the minimum ratio between trace/retrace and symmetry planes to be considered as noise. Default: 5.0

type threshold:

float

returns:

The cleanded up composite image.

rtype:

pingwyn.Image

See also

pingwyn.remove_plane

Perform image plane removal / flattening

pingwyn.align_rows

Perform image row alignment