spym.process.filters

Module Contents

Classes

Filters Filters.

Functions

gauss(image, size=3) Apply Gaussian smoothing filter.
median(image, size=3) Apply median smoothing filter.
mean(image, size=3) Apply mean smoothing filter.
sharpen(image, size=3, alpha=30) Apply a sharpening filter.
destripe(image, min_length=20, hard_threshold=0.4, soft_threshold=0.2, sign=’positive’, rel_threshold=None) Find and remove scan stripes by averaging neighbourhood lines.
class spym.process.filters.Filters(spym_instance)

Filters.

gauss(self, **kwargs)

Apply Gaussian smoothing filter.

Args:
size: size of the filter in pixels.
median(self, **kwargs)

Apply median smoothing filter.

Args:
size: size of the filter in pixels.
mean(self, **kwargs)

Apply mean smoothing filter.

Args:
size: size of the filter in pixels.
sharpen(self, **kwargs)

Apply a sharpening filter.

Args:
size: size of the filter in pixels. alpha: weight.
destripe(self, **kwargs)

Find and remove scan stripes by averaging neighbourhood lines.

Args:
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)

Apply Gaussian smoothing filter.

Args:
image: numpy array. size: size of the filter in pixels.
Returns:
filtered numpy array.
spym.process.filters.median(image, size=3)

Apply median smoothing filter.

Args:
image: numpy array. size: size of the filter in pixels.
Returns:
filtered numpy array.
spym.process.filters.mean(image, size=3)

Apply mean smoothing filter.

Args:
image: numpy array. size: size of the filter in pixels.
Returns:
filtered numpy array.
spym.process.filters.sharpen(image, size=3, alpha=30)

Apply a sharpening filter.

Args:
image: numpy array. size: size of the filter in pixels. alpha: weight.
Returns:
filtered numpy array.
spym.process.filters.destripe(image, min_length=20, hard_threshold=0.4, soft_threshold=0.2, sign='positive', rel_threshold=None)

Find and remove scan stripes by averaging neighbourhood lines.

Args:
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.