Last modified: November 20, 2009
Contents
Image [Float] AveragingKernel (int radius = 3)
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Creates an Averaging filter kernel for use with separable convolution. The window size is (2*radius+1) * (2*radius+1).
Image [Float] BinomialKernel (int radius = 3)
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Creates a binomial filter kernel for use with separable convolution of a given radius.
Image [Float] GaussianDerivativeKernel (float standard_deviation = 1.00, int order = 1)
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Init as a Gaussian derivative of order 'order'. The radius of the kernel is always 3*std_dev.
Image [Float] GaussianKernel (float standard_deviation = 1.00)
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Init as a Gaussian function. The radius of the kernel is always 3*standard_deviation.
Image [Float] SimpleSharpeningKernel (float sharpening_factor = 0.50)
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Creates a kernel for simple sharpening.
Image [Float] SymmetricGradientKernel ()
Returns: | Image [Float] |
---|---|
Category: | Convolution/Kernels |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Init as a symmetric gradient filter of the form [ 0.5, 0.0, -0.5]
Image [GreyScale|Grey16|Float|RGB|Complex] convolve (Image [Float] kernel, Choice [avoid|clip|repeat|reflect|wrap] border_treatment = clip)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Convolves an image with a given kernel.
Uses code from the Vigra library (Copyright 1998-2007 by Ullrich Köthe).
Specifies how to treat the borders of the image. Must be one of the following:
BORDER_TREATMENT_AVOID (0)
do not operate on a pixel where the kernel does not fit in the image
BORDER_TREATMENT_CLIP (1)
clip kernel at image border (this is only useful if the kernel is >= 0 everywhere)
BORDER_TREATMENT_REPEAT (2)
repeat the nearest valid pixel
BORDER_TREATMENT_REFLECT (3)
reflect image at last row/column
BORDER_TREATMENT_WRAP (4)
wrap image around (periodic boundary conditions)
Example usage:
# Using a custom kernel
img2 = image.convolve([[0.125, 0.0, -0.125],
[0.25 , 0.0, -0.25 ],
[0.125, 0.0, -0.125]])
# Using one of the included kernel generators
img2 = image.convolve(GaussianKernel(3.0))
Image [GreyScale|Grey16|Float|RGB|Complex] convolve_x (Image [Float] kernel_x, Choice [avoid|clip|repeat|reflect|wrap] border_treatment = clip)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Convolves an image in the X directions with a 1D kernel. This is equivalent to what the Vigra library calls "Separable Convolution".
Uses code from the Vigra library (Copyright 1998-2007 by Ullrich Köthe).
Image [GreyScale|Grey16|Float|RGB|Complex] convolve_xy (Image [Float] kernel_x, Image [Float] kernel_y, Choice [avoid|clip|repeat|reflect|wrap] border_treatment = clip)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Convolves an image in both X and Y directions with 1D kernels. This is equivalent to what the Vigra library calls "Separable Convolution".
Uses code from the Vigra library (Copyright 1998-2007 by Ullrich Köthe).
Image [GreyScale|Grey16|Float|RGB|Complex] convolve_y (Image [Float] kernel_y, Choice [avoid|clip|repeat|reflect|wrap] border_treatment = clip)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Convolves an image in the X directions with a 1D kernel. This is equivalent to what the Vigra library calls "Separable Convolution".
Uses code from the Vigra library (Copyright 1998-2007 by Ullrich Köthe).
[object] gaussian_gradient (float scale = 0.50)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | [object] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.
scale
Returns a tuple of (x_gradient, y_gradient).
Example 1: gaussian_gradient(1.0)
Example 2: gaussian_gradient(1.0)
Example 3: gaussian_gradient(1.0)
Image [GreyScale|Grey16|Float|RGB|Complex] gaussian_smoothing (float standard_deviation = 1.00)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Performs gaussian smoothing on an image.
Example 1: gaussian_smoothing(1.0)
Example 2: gaussian_smoothing(3.0)
Example 3: gaussian_smoothing(1.0)
[object] hessian_matrix_of_gaussian (float scale = 0.50)
Operates on: | Image [GreyScale|Grey16|Float] |
---|---|
Returns: | [object] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix.
scale
Example 1: hessian_matrix_of_gaussian(1.0)
Image [GreyScale|Grey16|Float] laplacian_of_gaussian (float scale = 0.50)
Operates on: | Image [GreyScale|Grey16|Float] |
---|---|
Returns: | Image [GreyScale|Grey16|Float] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Filter image with the Laplacian of Gaussian operator at the given scale.
scale
Example 1: laplacian_of_gaussian(1.0)
Image [GreyScale|Grey16|Float|RGB|Complex] simple_sharpen (float sharpening_factor = 0.50)
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Perform simple sharpening.
Example 1: simple_sharpen(1.0)
Example 2: simple_sharpen(3.0)
Image [GreyScale|Grey16|Float|RGB|Complex] sobel_edge_detection ()
Operates on: | Image [GreyScale|Grey16|Float|RGB|Complex] |
---|---|
Returns: | Image [GreyScale|Grey16|Float|RGB|Complex] |
Category: | Convolution |
Defined in: | convolution.py |
Author: | Michael Droettboom (With code from VIGRA by Ullrich Köthe) |
Performs simple Sobel edge detection on the image.
Example 1: sobel_edge_detection(1.0)
Example 2: sobel_edge_detection(3.0)