skimage 0.17.2

NotesParametersReturnsBackRef
difference_of_gaussians(image, low_sigma, high_sigma=None, *, mode='nearest', cval=0, multichannel=False, truncate=4.0)

This function uses the Difference of Gaussians method for applying band-pass filters to multi-dimensional arrays. The input array is blurred with two Gaussian kernels of differing sigmas to produce two intermediate, filtered images. The more-blurred image is then subtracted from the less-blurred image. The final output image will therefore have had high-frequency components attenuated by the smaller-sigma Gaussian, and low frequency components will have been removed due to their presence in the more-blurred intermediate.

Notes

This function will subtract an array filtered with a Gaussian kernel with sigmas given by high_sigma from an array filtered with a Gaussian kernel with sigmas provided by low_sigma . The values for high_sigma must always be greater than or equal to the corresponding values in low_sigma , or a ValueError will be raised.

When high_sigma is none, the values for high_sigma will be calculated as 1.6x the corresponding values in low_sigma . This ratio was originally proposed by Marr and Hildreth (1980) and is commonly used when approximating the inverted Laplacian of Gaussian, which is used in edge and blob detection.

Input image is converted according to the conventions of img_as_float .

Except for sigma values, all parameters are used for both filters.

Parameters

image : ndarray

Input array to filter.

low_sigma : scalar or sequence of scalars

Standard deviation(s) for the Gaussian kernel with the smaller sigmas across all axes. The standard deviations are given for each axis as a sequence, or as a single number, in which case the single number is used as the standard deviation value for all axes.

high_sigma : scalar or sequence of scalars, optional (default is None)

Standard deviation(s) for the Gaussian kernel with the larger sigmas across all axes. The standard deviations are given for each axis as a sequence, or as a single number, in which case the single number is used as the standard deviation value for all axes. If None is given (default), sigmas for all axes are calculated as 1.6 * low_sigma.

mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Default is 'nearest'.

cval : scalar, optional

Value to fill past edges of input if mode is 'constant'. Default is 0.0

multichannel : bool, optional (default: False)

Whether the last axis of the image is to be interpreted as multiple channels. If True, each channel is filtered separately (channels are not mixed together).

truncate : float, optional (default is 4.0)

Truncate the filter at this many standard deviations.

Returns

filtered_image : ndarray

the filtered array.

Find features between low_sigma and high_sigma in size.

See Also

skimage.feature.blog_dog

Examples

Apply a simple Difference of Gaussians filter to a color image:

This example is valid syntax, but we were not able to check execution
>>> from skimage.data import astronaut
... from skimage.filters import difference_of_gaussians
... filtered_image = difference_of_gaussians(astronaut(), 2, 10,
...  multichannel=True)

Apply a Laplacian of Gaussian filter as approximated by the Difference of Gaussians filter:

This example is valid syntax, but we were not able to check execution
>>> filtered_image = difference_of_gaussians(astronaut(), 2,
...  multichannel=True)

Apply a Difference of Gaussians filter to a grayscale image using different sigma values for each axis:

This example is valid syntax, but we were not able to check execution
>>> from skimage.data import camera
... filtered_image = difference_of_gaussians(camera(), (2,5), (3,20))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.filters._gaussian.difference_of_gaussians skimage.feature.blob.blob_dog

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/filters/_gaussian.py#160
type: <class 'function'>
Commit: