nabu.processing.unsharp module¶
- class nabu.processing.unsharp.UnsharpMask(shape, sigma, coeff, mode='reflect', method='gaussian')[source]¶
Bases:
object
A helper class for unsharp masking.
Initialize a Unsharp mask. UnsharpedImage = (1 + coeff)*Image - coeff * ConvolutedImage
If method == “log”: UnsharpedImage = Image + coeff*ConvolutedImage
- Parameters:
shape (tuple) – Shape of the image.
sigma (float) – Standard deviation of the Gaussian kernel
coeff (float) – Coefficient in the linear combination of unsharp mask
mode (str, optional) – Convolution mode. Default is “reflect”
method (str, optional) – Method of unsharp mask. Can be “gaussian” (default) or “log” (Laplacian of Gaussian), or “imagej”.
Notes
The computation is the following depending on the method:
For method=”gaussian”: output = (1 + coeff) * image - coeff * image_blurred
For method=”log”: output = image + coeff * image_blurred
For method=”imagej”: output = (image - coeff*image_blurred)/(1-coeff)
- avail_methods = ['gaussian', 'log', 'imagej']¶