{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / feature / blob / blob_log

function

skimage.feature.blob:blob_log

source: /dev/scikit-image/src/skimage/feature/blob.py :461

Signature

def   blob_log ( image min_sigma = 1 max_sigma = 50 num_sigma = 10 threshold = 0.2 overlap = 0.5 log_scale = False * threshold_rel = <DEPRECATED> exclude_border = False prescale = legacy )

Summary

Finds blobs in the given grayscale image.

Extended Summary

Blobs are found using the Laplacian of Gaussian (LoG) method [1]. For each blob found, the method returns its coordinates and the standard deviation of the Gaussian kernel that detected the blob.

Parameters

image : ndarray

Input grayscale image, blobs are assumed to be light on dark background (white on black).

min_sigma : scalar or sequence of scalars, optional

Minimum standard deviation for Gaussian kernel. Keep this value low to detect smaller blobs. The standard deviation of the Gaussian kernel is given either as a sequence for each axis, or as a single number, in which case it is equal for all axes.

max_sigma : scalar or sequence of scalars, optional

The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviation of the Gaussian kernel is given either as a sequence for each axis, or as a single number, in which case it is equal for all axes.

num_sigma : int, optional

The number of evenly spaced values for standard deviation of the Gaussian kernel to consider on the closed interval [min_sigma, max_sigma].

threshold : float or None, optional

An absolute threshold applied to the internally computed stack of Laplacian-of-Gaussian (LoG) images. Local maxima in LoG smaller than threshold are ignored. Reduce this to detect blobs with lower intensities.

overlap : float, optional

A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.

log_scale : bool, optional

If set intermediate values of standard deviations are interpolated using a logarithmic scale to the base 10. If not, linear interpolation is used.

threshold_rel : DEPRECATED
exclude_border : tuple of ints, int, or False, optional

If tuple of ints, the length of the tuple must match the input array's dimensionality. Each element of the tuple will exclude peaks from within exclude_border-pixels of the border of the image along that dimension. If nonzero int, exclude_border excludes peaks from within exclude_border-pixels of the border of the image. If zero or False, peaks are identified regardless of their distance from the border.

prescale : {'minmax', 'none', 'legacy'}, optional

Method for rescaling (normalizing) image before processing. Note that rescaling impacts the ranges of the internally computed Laplacian-of-Gaussian (LoG) images, and therefore also the choice of threshold.

'minmax'

Normalize image between 0 and 1 regardless of dtype. After normalization, the resulting array will have a floating dtype.

'none'

Don't prescale the value range of image at all and return a copy of image. Useful when image has already been rescaled.

'legacy'

Normalize only if image has an integer dtype. If image is of floating dtype, it is left alone. See .img_as_float for more details.

Returns

A : (n, image.ndim + sigma) ndarray

A 2d array with each row representing 2 coordinate values for a 2D image, or 3 coordinate values for a 3D image, plus the sigma(s) used. When a single sigma is passed, outputs are: (r, c, sigma) or (p, r, c, sigma) where (r, c) or (p, r, c) are coordinates of the blob and sigma is the standard deviation of the Gaussian kernel which detected the blob. When an anisotropic gaussian is used (sigmas per dimension), the detected sigma is returned for each dimension.

Notes

The radius of each blob is approximately for a 2-D image and for a 3-D image.

Examples

from skimage import data, feature, exposure
img = data.coins()
img = exposure.equalize_hist(img)  # improves detection
feature.blob_log(img, threshold = .3)

Aliases

  • skimage.feature.blob_log

Referenced by