skimage2.feature.blob_doh#
- skimage2.feature.blob_doh(image, min_sigma=1, max_sigma=30, num_sigma=10, threshold=0.01, overlap=0.5, log_scale=False, *, threshold_rel=<DEPRECATED>, prescale='legacy')[source]#
Finds blobs in the given grayscale image.
Blobs are found using the Determinant of Hessian method [1]. For each blob found, the method returns its coordinates and the standard deviation of the Gaussian Kernel used for the Hessian matrix whose determinant detected the blob. Determinant of Hessians is approximated using [2].
- Parameters:
- image2D ndarray
Input grayscale image. Blobs can either be light on dark or vice versa.
- min_sigmafloat, optional
The minimum standard deviation for Gaussian Kernel used to compute Hessian matrix. 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_sigmafloat, optional
The maximum standard deviation for Gaussian Kernel used to compute Hessian matrix. Keep this value 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_sigmaint, optional
The number of evenly spaced values for standard deviation of the Gaussian kernel to consider on the closed interval
[min_sigma, max_sigma].- thresholdfloat or None, optional
An absolute threshold applied to the internally computed stack of Determinant-of-Hessian (DoH) images. Local maxima in DoH smaller than
thresholdare ignored. Reduce this to detect blobs with lower intensities.- overlapfloat, 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_scalebool, 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_relDEPRECATED
Deprecated since version 0.27: Starting with version 0.27,
threshold_relis deprecated. Sincemax(doh_space) * threshold_relwas used to calculate the minimum peak intensity, this parameters effect was difficult to reason about. Usethresholdin conjunction withprescaleinstead.- prescale{‘minmax’, ‘none’, ‘legacy’}, optional
Method for rescaling (normalizing)
imagebefore processing. Note that rescaling impacts the ranges of the internally computed Determinant-of-Hessian (DoH) images, and therefore also the choice ofthreshold.'minmax'Normalize
imagebetween 0 and 1 regardless of dtype. After normalization, the resulting array will have a floating dtype.'none'Don’t prescale the value range of
imageat all and return a copy ofimage. Useful whenimagehas already been rescaled.'legacy'Normalize only if
imagehas an integer dtype. Ifimageis of floating dtype, it is left alone. Seeskimage2.util.img_as_float()for more details.Warning
The scaling and the effect of
thresholdwill depend on the dtype ofimage. For consistent behavior we recommend'minmax'.
- Returns:
- Andarray of shape (n, 3)
A 2d array with each row representing 3 values,
(y,x,sigma)where(y,x)are coordinates of the blob andsigmais the standard deviation of the Gaussian kernel of the Hessian Matrix whose determinant detected the blob.
Notes
The radius of each blob is approximately
sigma. Computation of Determinant of Hessians is independent of the standard deviation. Therefore detecting larger blobs won’t take more time. In methods lineblob_dog()andblob_log()the computation of Gaussians for largersigmatakes more time. The downside is that this method can’t be used for detecting blobs of radius less than3pxdue to the box filters used in the approximation of Hessian Determinant.References
[2]Herbert Bay, Andreas Ess, Tinne Tuytelaars, Luc Van Gool, “SURF: Speeded Up Robust Features” ftp://ftp.vision.ee.ethz.ch/publications/articles/eth_biwi_00517.pdf
Examples
>>> from _skimage2 import data, feature >>> img = data.coins() >>> feature.blob_doh(img) array([[197. , 153. , 20.33333333], [124. , 336. , 20.33333333], [126. , 153. , 20.33333333], [195. , 100. , 23.55555556], [192. , 212. , 23.55555556], [121. , 271. , 30. ], [126. , 101. , 20.33333333], [193. , 275. , 23.55555556], [123. , 205. , 20.33333333], [270. , 363. , 30. ], [265. , 113. , 23.55555556], [262. , 243. , 23.55555556], [185. , 348. , 30. ], [156. , 302. , 30. ], [123. , 44. , 23.55555556], [260. , 173. , 30. ], [197. , 44. , 20.33333333]])