spym.process package
Submodules
spym.process.filters module
- class spym.process.filters.Filters(spym_instance)[source]
Bases:
object
Filters.
- destripe(**kwargs)[source]
Find and remove scan stripes by averaging neighbourhood lines.
- Parameters:
min_length – only scars that are as long or longer than this value (in pixels) will be marked.
hard_threshold – the minimum difference of the value from the neighbouring upper and lower lines to be considered a defect.
soft_threshold – values differing at least this much do not form defects themselves, but they are attached to defects obtained from the hard threshold if they touch one.
sign – whether mark stripes with positive values, negative values or both.
rel_threshold – the minimum difference of the value from the neighbouring upper and lower lines to be considered a defect (in physical values). Overwrite hard_threshold.
- Returns:
destriped 2d array.
- gauss(**kwargs)[source]
Apply Gaussian smoothing filter.
- Parameters:
size – size of the filter in pixels.
- mean(**kwargs)[source]
Apply mean smoothing filter.
- Parameters:
size – size of the filter in pixels.
- spym.process.filters.destripe(image, min_length=20, hard_threshold=0.4, soft_threshold=0.2, sign='positive', rel_threshold=None)[source]
Find and remove scan stripes by averaging neighbourhood lines.
- Parameters:
image – 2d numpy array.
min_length – only scars that are as long or longer than this value (in pixels) will be marked.
hard_threshold – the minimum difference of the value from the neighbouring upper and lower lines to be considered a defect.
soft_threshold – values differing at least this much do not form defects themselves, but they are attached to defects obtained from the hard threshold if they touch one.
sign – whether mark stripes with positive values, negative values or both.
rel_threshold – the minimum difference of the value from the neighbouring upper and lower lines to be considered a defect (in physical values). Overwrite hard_threshold.
- Returns:
destriped 2d array.
- spym.process.filters.gauss(image, size=3)[source]
Apply Gaussian smoothing filter.
- Parameters:
image – numpy array.
size – size of the filter in pixels.
- Returns:
filtered numpy array.
- spym.process.filters.mean(image, size=3)[source]
Apply mean smoothing filter.
- Parameters:
image – numpy array.
size – size of the filter in pixels.
- Returns:
filtered numpy array.
spym.process.level module
- class spym.process.level.Level(spym_instance)[source]
Bases:
object
Level.
- align(**kwargs)[source]
Align rows.
- Parameters:
baseline – defines how baselines are estimated; ‘mean’ (default), ‘median’, ‘poly’.
axis – axis along wich calculate the baselines.
poly_degree – polnomial degree if baseline=’poly’.
- spym.process.level.align(image, baseline='mean', axis=1, poly_degree=2)[source]
Align rows.
- Parameters:
image – 2d numpy array.
baseline – defines how baselines are estimated; ‘mean’ (default), ‘median’, ‘poly’.
axis – axis along wich calculate the baselines.
poly_degree – polnomial degree if baseline=’poly’.
- Returns:
corrected 2d numpy array.