skimage.feature.blob_dog(image[, min_sigma, …])
Finds blobs in the given grayscale image.
skimage.feature.blob_doh(image[, min_sigma, …])
Finds blobs in the given grayscale image.
skimage.feature.blob_log(image[, min_sigma, …])
Finds blobs in the given grayscale image.
skimage.feature.canny(image[, sigma, …])
Edge filter an image using the Canny algorithm.
skimage.feature.corner_fast(image[, n, …])
Extract FAST corners for a given image.
skimage.feature.corner_foerstner(image[, sigma])
Compute Foerstner corner measure response image.
skimage.feature.corner_harris(image[, …])
Compute Harris corner measure response image.
skimage.feature.corner_kitchen_rosenfeld(image)
Compute Kitchen and Rosenfeld corner measure response image.
skimage.feature.corner_moravec(image[, …])
Compute Moravec corner measure response image.
skimage.feature.corner_orientations(image, …)
Compute the orientation of corners.
skimage.feature.corner_peaks(image[, …])
Find peaks in corner measure response image.
skimage.feature.corner_shi_tomasi(image[, sigma])
Compute Shi-Tomasi (Kanade-Tomasi) corner measure response image.
skimage.feature.corner_subpix(image, corners)
Determine subpixel position of corners.
skimage.feature.daisy(image[, step, radius, …])
Extract DAISY feature descriptors densely for the given image.
skimage.feature.draw_haar_like_feature(…)
Visualization of Haar-like features.
skimage.feature.draw_multiblock_lbp(image, …)
Multi-block local binary pattern visualization.
skimage.feature.greycomatrix(image, …[, …])
Calculate the grey-level co-occurrence matrix.
skimage.feature.greycoprops(P[, prop])
Calculate texture properties of a GLCM.
skimage.feature.haar_like_feature(int_image, …)
Compute the Haar-like features for a region of interest (ROI) of an integral image.
skimage.feature.haar_like_feature_coord(…)
Compute the coordinates of Haar-like features.
skimage.feature.hessian_matrix(image[, …])
Compute Hessian matrix.
skimage.feature.hessian_matrix_det(image[, …])
Compute the approximate Hessian Determinant over an image.
skimage.feature.hessian_matrix_eigvals(H_elems)
Compute eigenvalues of Hessian matrix.
skimage.feature.hog(image[, orientations, …])
Extract Histogram of Oriented Gradients (HOG) for a given image.
skimage.feature.local_binary_pattern(image, P, R)
Gray scale and rotation invariant LBP (Local Binary Patterns).
skimage.feature.masked_register_translation(…)
Deprecated function.
skimage.feature.match_descriptors(…[, …])
Brute-force matching of descriptors.
skimage.feature.match_template(image, template)
Match a template to a 2-D or 3-D image using normalized correlation.
skimage.feature.multiblock_lbp(int_image, r, …)
Multi-block local binary pattern (MB-LBP).
skimage.feature.multiscale_basic_features(image)
Local features for a single- or multi-channel nd image.
skimage.feature.peak_local_max(image[, …])
Find peaks in an image as coordinate list or boolean mask.
skimage.feature.plot_matches(ax, image1, …)
Plot matched features.
skimage.feature.register_translation(…[, …])
Deprecated function.
skimage.feature.shape_index(image[, sigma, …])
Compute the shape index.
skimage.feature.structure_tensor(image[, …])
Compute structure tensor using sum of squared differences.
skimage.feature.structure_tensor_eigenvalues(A_elems)
Compute eigenvalues of structure tensor.
skimage.feature.structure_tensor_eigvals(…)
Compute eigenvalues of structure tensor.
skimage.feature.BRIEF([descriptor_size, …])
BRIEF binary descriptor extractor.
skimage.feature.CENSURE([min_scale, …])
CENSURE keypoint detector.
skimage.feature.Cascade
Class for cascade of classifiers that is used for object detection.
skimage.feature.ORB([downscale, n_scales, …])
Oriented FAST and rotated BRIEF feature detector and binary descriptor extractor.
Finds blobs in the given grayscale image.
Blobs are found using the Difference of Gaussian (DoG) method [1]. For each blob found, the method returns its coordinates and the standard deviation of the Gaussian kernel that detected the blob.
Input grayscale image, blobs are assumed to be light on dark background (white on black).
The minimum standard deviation for Gaussian kernel. Keep this low to detect smaller blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The ratio between the standard deviation of Gaussian Kernels used for computing the Difference of Gaussians
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect blobs with less intensities.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
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.
A 2d array with each row representing 2 coordinate values for a 2D image, and 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.
See also
The radius of each blob is approximately \(\sqrt{2}\sigma\) for a 2-D image and \(\sqrt{3}\sigma\) for a 3-D image.
https://en.wikipedia.org/wiki/Blob_detection#The_difference_of_Gaussians_approach
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].
Input grayscale image.Blobs can either be light on dark or vice versa.
The minimum standard deviation for Gaussian Kernel used to compute Hessian matrix. Keep this low to detect smaller blobs.
The maximum standard deviation for Gaussian Kernel used to compute Hessian matrix. Keep this high to detect larger blobs.
The number of intermediate values of standard deviations to consider between min_sigma and max_sigma.
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect less prominent blobs.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
If set intermediate values of standard deviations are interpolated using a logarithmic scale to the base 10. If not, linear interpolation is used.
A 2d array with each row representing 3 values, (y,x,sigma) where (y,x) are coordinates of the blob and sigma is the standard deviation of the Gaussian kernel of the Hessian Matrix whose determinant detected the blob.
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 line blob_dog() and blob_log() the computation of Gaussians for larger sigma takes more time. The downside is that this method can’t be used for detecting blobs of radius less than 3px due to the box filters used in the approximation of Hessian Determinant.
https://en.wikipedia.org/wiki/Blob_detection#The_determinant_of_the_Hessian
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
Finds blobs in the given grayscale image.
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.
Input grayscale image, blobs are assumed to be light on dark background (white on black).
the minimum standard deviation for Gaussian kernel. Keep this low to detect smaller blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The number of intermediate values of standard deviations to consider between min_sigma and max_sigma.
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect blobs with less intensities.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
If set intermediate values of standard deviations are interpolated using a logarithmic scale to the base 10. If not, linear interpolation is used.
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.
A 2d array with each row representing 2 coordinate values for a 2D image, and 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.
The radius of each blob is approximately \(\sqrt{2}\sigma\) for a 2-D image and \(\sqrt{3}\sigma\) for a 3-D image.
https://en.wikipedia.org/wiki/Blob_detection#The_Laplacian_of_Gaussian
Edge filter an image using the Canny algorithm.
Grayscale input image to detect edges on; can be of any dtype.
Standard deviation of the Gaussian filter.
Lower bound for hysteresis thresholding (linking edges). If None, low_threshold is set to 10% of dtype’s max.
Upper bound for hysteresis thresholding (linking edges). If None, high_threshold is set to 20% of dtype’s max.
Mask to limit the application of Canny to a certain area.
If True then treat low_threshold and high_threshold as quantiles of the edge magnitude image, rather than absolute edge magnitude values. If True then the thresholds must be in the range [0, 1].
The binary edge map.
See also
The steps of the algorithm are as follows:
Canny, J., A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986 DOI:10.1109/TPAMI.1986.4767851
William Green’s Canny tutorial https://en.wikipedia.org/wiki/Canny_edge_detector
Extract FAST corners for a given image.
Input image.
Minimum number of consecutive pixels out of 16 pixels on the circle that should all be either brighter or darker w.r.t testpixel. A point c on the circle is darker w.r.t test pixel p if Ic < Ip - threshold and brighter if Ic > Ip + threshold. Also stands for the n in FAST-n corner detector.
Threshold used in deciding whether the pixels on the circle are brighter, darker or similar w.r.t. the test pixel. Decrease the threshold when more corners are desired and vice-versa.
FAST corner response image.
Rosten, E., & Drummond, T. (2006, May). Machine learning for high-speed corner detection. In European conference on computer vision (pp. 430-443). Springer, Berlin, Heidelberg. DOI:10.1007/11744023_34 http://www.edwardrosten.com/work/rosten_2006_machine.pdf
Wikipedia, “Features from accelerated segment test”, https://en.wikipedia.org/wiki/Features_from_accelerated_segment_test
Compute Foerstner corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as:
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Error ellipse sizes.
Roundness of error ellipse.
Förstner, W., & Gülch, E. (1987, June). A fast operator for detection and precise location of distinct points, corners and centres of circular features. In Proc. ISPRS intercommission conference on fast processing of photogrammetric data (pp. 281-305). https://cseweb.ucsd.edu/classes/sp02/cse252/foerstner/foerstner.pdf
https://en.wikipedia.org/wiki/Corner_detection
Compute Harris corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as:
or:
Input image.
Method to compute the response image from the auto-correlation matrix.
Sensitivity factor to separate corners from edges, typically in range [0, 0.2]. Small values of k result in detection of sharp corners.
Normalisation factor (Noble’s corner measure).
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Harris response image.
https://en.wikipedia.org/wiki/Corner_detection
Compute Kitchen and Rosenfeld corner measure response image.
The corner measure is calculated as follows:
Where imx and imy are the first and imxx, imxy, imyy the second derivatives.
Input image.
How to handle values outside the image borders.
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
Kitchen and Rosenfeld response image.
Kitchen, L., & Rosenfeld, A. (1982). Gray-level corner detection. Pattern recognition letters, 1(2), 95-102. DOI:10.1016/0167-8655(82)90020-4
Compute Moravec corner measure response image.
This is one of the simplest corner detectors and is comparatively fast but has several limitations (e.g. not rotation invariant).
Input image.
Window size.
Moravec response image.
https://en.wikipedia.org/wiki/Corner_detection
Compute the orientation of corners.
The orientation of corners is computed using the first order central moment i.e. the center of mass approach. The corner orientation is the angle of the vector from the corner coordinate to the intensity centroid in the local neighborhood around the corner calculated using first order central moment.
Input grayscale image.
Corner coordinates as (row, col).
Mask defining the local neighborhood of the corner used for the calculation of the central moment.
Orientations of corners in the range [-pi, pi].
Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary Bradski “ORB : An efficient alternative to SIFT and SURF” http://www.vision.cs.chubu.ac.jp/CV-R/pdf/Rublee_iccv2011.pdf
Paul L. Rosin, “Measuring Corner Properties” http://users.cs.cf.ac.uk/Paul.Rosin/corner2.pdf
Find peaks in corner measure response image.
This differs from skimage.feature.peak_local_max in that it suppresses multiple connected peaks with the same accumulator value.
Input image.
The minimal allowed distance separating peaks.
See skimage.feature.peak_local_max().
Which Minkowski p-norm to use. Should be in the range [1, inf]. A finite large p may cause a ValueError if overflow can occur. inf corresponds to the Chebyshev distance and 2 to the Euclidean distance.
See also
Changed in version 0.18: The default value of threshold_rel has changed to None, which corresponds to letting skimage.feature.peak_local_max decide on the default. This is equivalent to threshold_rel=0.
The num_peaks limit is applied before suppression of connected peaks. To limit the number of peaks after suppression, set num_peaks=np.inf and post-process the output of this function.
Compute Shi-Tomasi (Kanade-Tomasi) corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as the smaller eigenvalue of A:
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Shi-Tomasi response image.
https://en.wikipedia.org/wiki/Corner_detection
Determine subpixel position of corners.
A statistical test decides whether the corner is defined as the intersection of two edges or a single peak. Depending on the classification result, the subpixel corner location is determined based on the local covariance of the grey-values. If the significance level for either statistical test is not sufficient, the corner cannot be classified, and the output subpixel position is set to NaN.
Input image.
Corner coordinates (row, col).
Search window size for subpixel estimation.
Significance level for corner classification.
Subpixel corner positions. NaN for “not classified” corners.
Förstner, W., & Gülch, E. (1987, June). A fast operator for detection and precise location of distinct points, corners and centres of circular features. In Proc. ISPRS intercommission conference on fast processing of photogrammetric data (pp. 281-305). https://cseweb.ucsd.edu/classes/sp02/cse252/foerstner/foerstner.pdf
https://en.wikipedia.org/wiki/Corner_detection
Extract DAISY feature descriptors densely for the given image.
DAISY is a feature descriptor similar to SIFT formulated in a way that allows for fast dense extraction. Typically, this is practical for bag-of-features image representations.
The implementation follows Tola et al. [1] but deviate on the following points:
Input image (grayscale).
Distance between descriptor sampling points.
Radius (in pixels) of the outermost ring.
Number of rings.
Number of histograms sampled per ring.
Number of orientations (bins) per histogram.
How to normalize the descriptors
Standard deviation of spatial Gaussian smoothing for the center histogram and for each ring of histograms. The array of sigmas should be sorted from the center and out. I.e. the first sigma value defines the spatial smoothing of the center histogram and the last sigma value defines the spatial smoothing of the outermost ring. Specifying sigmas overrides the following parameter.
rings = len(sigmas) - 1
Radius (in pixels) for each ring. Specifying ring_radii overrides the following two parameters.
rings = len(ring_radii) radius = ring_radii[-1]
If both sigmas and ring_radii are given, they must satisfy the following predicate since no radius is needed for the center histogram.
len(ring_radii) == len(sigmas) + 1
Generate a visualization of the DAISY descriptors
Grid of DAISY descriptors for the given image as an array dimensionality (P, Q, R) where
P = ceil((M - radius*2) / step) Q = ceil((N - radius*2) / step) R = (rings * histograms + 1) * orientations
Visualization of the DAISY descriptors.
Tola et al. “Daisy: An efficient dense descriptor applied to wide- baseline stereo.” Pattern Analysis and Machine Intelligence, IEEE Transactions on 32.5 (2010): 815-830.
http://cvlab.epfl.ch/software/daisy
Visualization of Haar-like features.
The region of an integral image for which the features need to be computed.
Row-coordinate of top left corner of the detection window.
Column-coordinate of top left corner of the detection window.
Width of the detection window.
Height of the detection window.
The array of coordinates to be extracted. This is useful when you want to recompute only a subset of features. In this case feature_type needs to be an array containing the type of each feature, as returned by haar_like_feature_coord(). By default, all coordinates are computed.
Floats specifying the color for the positive block. Corresponding values define (R, G, B) values. Default value is red (1, 0, 0).
Floats specifying the color for the negative block Corresponding values define (R, G, B) values. Default value is blue (0, 1, 0).
Value in the range [0, 1] that specifies opacity of visualization. 1 - fully transparent, 0 - opaque.
The maximum number of features to be returned. By default, all features are returned.
If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random. The random state is used when generating a set of features smaller than the total number of available features.
An image in which the different features will be added.
Multi-block local binary pattern visualization.
Blocks with higher sums are colored with alpha-blended white rectangles, whereas blocks with lower sums are colored alpha-blended cyan. Colors and the alpha parameter can be changed.
Image on which to visualize the pattern.
Row-coordinate of top left corner of a rectangle containing feature.
Column-coordinate of top left corner of a rectangle containing feature.
Width of one of 9 equal rectangles that will be used to compute a feature.
Height of one of 9 equal rectangles that will be used to compute a feature.
The descriptor of feature to visualize. If not provided, the descriptor with 0 value will be used.
Floats specifying the color for the block that has greater intensity value. They should be in the range [0, 1]. Corresponding values define (R, G, B) values. Default value is white (1, 1, 1).
Floats specifying the color for the block that has greater intensity value. They should be in the range [0, 1]. Corresponding values define (R, G, B) values. Default value is cyan (0, 0.69, 0.96).
Value in the range [0, 1] that specifies opacity of visualization. 1 - fully transparent, 0 - opaque.
Image with MB-LBP visualization.
Face Detection Based on Multi-Block LBP Representation. Lun Zhang, Rufeng Chu, Shiming Xiang, Shengcai Liao, Stan Z. Li http://www.cbsr.ia.ac.cn/users/scliao/papers/Zhang-ICB07-MBLBP.pdf
Calculate the grey-level co-occurrence matrix.
A grey level co-occurrence matrix is a histogram of co-occurring greyscale values at a given offset over an image.
Integer typed input image. Only positive valued images are supported. If type is other than uint8, the argument levels needs to be set.
List of pixel pair distance offsets.
List of pixel pair angles in radians.
The input image should contain integers in [0, levels-1], where levels indicate the number of grey-levels counted (typically 256 for an 8-bit image). This argument is required for 16-bit images or higher and is typically the maximum of the image. As the output matrix is at least levels x levels, it might be preferable to use binning of the input image rather than large values for levels.
If True, the output matrix P[:, :, d, theta] is symmetric. This is accomplished by ignoring the order of value pairs, so both (i, j) and (j, i) are accumulated when (i, j) is encountered for a given offset. The default is False.
If True, normalize each matrix P[:, :, d, theta] by dividing by the total number of accumulated co-occurrences for the given offset. The elements of the resulting matrix sum to 1. The default is False.
The grey-level co-occurrence histogram. The value P[i,j,d,theta] is the number of times that grey-level j occurs at a distance d and at an angle theta from grey-level i. If normed is False, the output is of type uint32, otherwise it is float64. The dimensions are: levels x levels x number of distances x number of angles.
The GLCM Tutorial Home Page, http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
Haralick, RM.; Shanmugam, K., “Textural features for image classification” IEEE Transactions on systems, man, and cybernetics 6 (1973): 610-621. DOI:10.1109/TSMC.1973.4309314
Pattern Recognition Engineering, Morton Nadler & Eric P. Smith
Wikipedia, https://en.wikipedia.org/wiki/Co-occurrence_matrix
Compute 2 GLCMs: One for a 1-pixel offset to the right, and one for a 1-pixel offset upwards.
GLCM Texture Features
Calculate texture properties of a GLCM.
Compute a feature of a grey level co-occurrence matrix to serve as a compact summary of the matrix. The properties are computed as follows:
Each GLCM is normalized to have a sum of 1 before the computation of texture properties.
Input array. P is the grey-level co-occurrence histogram for which to compute the specified property. The value P[i,j,d,theta] is the number of times that grey-level j occurs at a distance d and at an angle theta from grey-level i.
The property of the GLCM to compute. The default is ‘contrast’.
2-dimensional array. results[d, a] is the property ‘prop’ for the d’th distance and the a’th angle.
The GLCM Tutorial Home Page, http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
Compute the contrast for GLCMs with distances [1, 2] and angles [0 degrees, 90 degrees]
GLCM Texture Features
Compute the Haar-like features for a region of interest (ROI) of an integral image.
Haar-like features have been successfully used for image classification and object detection [1]. It has been used for real-time face detection algorithm proposed in [2].
Integral image for which the features need to be computed.
Row-coordinate of top left corner of the detection window.
Column-coordinate of top left corner of the detection window.
Width of the detection window.
Height of the detection window.
The type of feature to consider:
By default all features are extracted.
If using with feature_coord, it should correspond to the feature type of each associated coordinate feature.
The array of coordinates to be extracted. This is useful when you want to recompute only a subset of features. In this case feature_type needs to be an array containing the type of each feature, as returned by haar_like_feature_coord(). By default, all coordinates are computed.
Resulting Haar-like features. Each value is equal to the subtraction of sums of the positive and negative rectangles. The data type depends of the data type of int_image: int when the data type of int_image is uint or int and float when the data type of int_image is float.
When extracting those features in parallel, be aware that the choice of the backend (i.e. multiprocessing vs threading) will have an impact on the performance. The rule of thumb is as follows: use multiprocessing when extracting features for all possible ROI in an image; use threading when extracting the feature at specific location for a limited number of ROIs. Refer to the example Face classification using Haar-like feature descriptor for more insights.
https://en.wikipedia.org/wiki/Haar-like_feature
Oren, M., Papageorgiou, C., Sinha, P., Osuna, E., & Poggio, T. (1997, June). Pedestrian detection using wavelet templates. In Computer Vision and Pattern Recognition, 1997. Proceedings., 1997 IEEE Computer Society Conference on (pp. 193-199). IEEE. http://tinyurl.com/y6ulxfta DOI:10.1109/CVPR.1997.609319
Viola, Paul, and Michael J. Jones. “Robust real-time face detection.” International journal of computer vision 57.2 (2004): 137-154. https://www.merl.com/publications/docs/TR2004-043.pdf DOI:10.1109/CVPR.2001.990517
You can compute the feature for some pre-computed coordinates.
Compute the coordinates of Haar-like features.
Width of the detection window.
Height of the detection window.
The type of feature to consider:
By default all features are extracted.
Coordinates of the rectangles for each feature.
The corresponding type for each feature.
Compute Hessian matrix.
The Hessian matrix is defined as:
which is computed by convolving the image with the second derivatives of the Gaussian kernel in the respective r- and c-directions.
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
How to handle values outside the image borders.
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
This parameter allows for the use of reverse or forward order of the image axes in gradient computation. ‘rc’ indicates the use of the first axis initially (Hrr, Hrc, Hcc), whilst ‘xy’ indicates the usage of the last axis initially (Hxx, Hxy, Hyy)
Element of the Hessian matrix for each pixel in the input image.
Element of the Hessian matrix for each pixel in the input image.
Element of the Hessian matrix for each pixel in the input image.
Compute the approximate Hessian Determinant over an image.
The 2D approximate method uses box filters over integral images to compute the approximate Hessian Determinant, as described in [1].
The image over which to compute Hessian Determinant.
Standard deviation used for the Gaussian kernel, used for the Hessian matrix.
If True and the image is 2D, use a much faster approximate computation. This argument has no effect on 3D and higher images.
The array of the Determinant of Hessians.
For 2D images when approximate=True, the running time of this method only depends on size of the image. It is independent of sigma as one would expect. The downside is that the result for sigma less than 3 is not accurate, i.e., not similar to the result obtained if someone computed the Hessian and took its determinant.
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
Compute eigenvalues of Hessian matrix.
The upper-diagonal elements of the Hessian matrix, as returned by hessian_matrix.
The eigenvalues of the Hessian matrix, in decreasing order. The eigenvalues are the leading dimension. That is, eigs[i, j, k] contains the ith-largest eigenvalue at position (j, k).
Extract Histogram of Oriented Gradients (HOG) for a given image.
Compute a Histogram of Oriented Gradients (HOG) by
Input image.
Number of orientation bins.
Size (in pixels) of a cell.
Number of cells in each block.
Block normalization method:
Normalization using L1-norm.
Normalization using L1-norm, followed by square root.
Normalization using L2-norm.
Normalization using L2-norm, followed by limiting the maximum values to 0.2 (Hys stands for hysteresis) and renormalization using L2-norm. (default) For details, see [3], [4].
Also return an image of the HOG. For each cell and orientation bin, the image contains a line segment that is centered at the cell center, is perpendicular to the midpoint of the range of angles spanned by the orientation bin, and has intensity proportional to the corresponding histogram value.
Apply power law compression to normalize the image before processing. DO NOT use this if the image contains negative values. Also see notes section below.
Return the data as a feature vector by calling .ravel() on the result just before returning.
If True, the last image dimension is considered as a color channel, otherwise as spatial.
HOG descriptor for the image. If feature_vector is True, a 1D (flattened) array is returned.
A visualisation of the HOG image. Only provided if visualize is True.
The presented code implements the HOG extraction method from [2] with the following changes: (I) blocks of (3, 3) cells are used ((2, 2) in the paper); (II) no smoothing within cells (Gaussian spatial window with sigma=8pix in the paper); (III) L1 block normalization is used (L2-Hys in the paper).
Power law compression, also known as Gamma correction, is used to reduce the effects of shadowing and illumination variations. The compression makes the dark regions lighter. When the kwarg transform_sqrt is set to True, the function computes the square root of each color channel and then applies the hog algorithm to the image.
https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
Dalal, N and Triggs, B, Histograms of Oriented Gradients for Human Detection, IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2005 San Diego, CA, USA, https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf, DOI:10.1109/CVPR.2005.177
Lowe, D.G., Distinctive image features from scale-invatiant keypoints, International Journal of Computer Vision (2004) 60: 91, http://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf, DOI:10.1023/B:VISI.0000029664.99615.94
Dalal, N, Finding People in Images and Videos, Human-Computer Interaction [cs.HC], Institut National Polytechnique de Grenoble - INPG, 2006, https://tel.archives-ouvertes.fr/tel-00390303/file/NavneetDalalThesis.pdf
Gray scale and rotation invariant LBP (Local Binary Patterns).
LBP is an invariant descriptor that can be used for texture classification.
Graylevel image.
Number of circularly symmetric neighbour set points (quantization of the angular space).
Radius of circle (spatial resolution of the operator).
Method to determine the pattern.
rotation invariant.
rotation invariant.
finer quantization of the angular space which is gray scale and rotation invariant.
which is only gray scale invariant [2].
image texture which is rotation but not gray scale invariant.
LBP image.
Multiresolution Gray-Scale and Rotation Invariant Texture Classification with Local Binary Patterns. Timo Ojala, Matti Pietikainen, Topi Maenpaa. http://www.ee.oulu.fi/research/mvmp/mvg/files/pdf/pdf_94.pdf, 2002.
Face recognition with local binary patterns. Timo Ahonen, Abdenour Hadid, Matti Pietikainen, http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.214.6851, 2004.
Deprecated function. Use skimage.registration.phase_cross_correlation instead.
Brute-force matching of descriptors.
For each descriptor in the first set this matcher finds the closest descriptor in the second set (and vice-versa in the case of enabled cross-checking).
Descriptors of size P about M keypoints in the first image.
Descriptors of size P about N keypoints in the second image.
The metric to compute the distance between two descriptors. See scipy.spatial.distance.cdist for all possible types. The hamming distance should be used for binary descriptors. By default the L2-norm is used for all descriptors of dtype float or double and the Hamming distance is used for binary descriptors automatically.
The p-norm to apply for metric='minkowski'.
Maximum allowed distance between descriptors of two keypoints in separate images to be regarded as a match.
If True, the matched keypoints are returned after cross checking i.e. a matched pair (keypoint1, keypoint2) is returned if keypoint2 is the best match for keypoint1 in second image and keypoint1 is the best match for keypoint2 in first image.
Maximum ratio of distances between first and second closest descriptor in the second set of descriptors. This threshold is useful to filter ambiguous matches between the two descriptor sets. The choice of this value depends on the statistics of the chosen descriptor, e.g., for SIFT descriptors a value of 0.8 is usually chosen, see D.G. Lowe, “Distinctive Image Features from Scale-Invariant Keypoints”, International Journal of Computer Vision, 2004.
Indices of corresponding matches in first and second set of descriptors, where matches[:, 0] denote the indices in the first and matches[:, 1] the indices in the second set of descriptors.
Match a template to a 2-D or 3-D image using normalized correlation.
The output is an array with values between -1.0 and 1.0. The value at a given position corresponds to the correlation coefficient between the image and the template.
For pad_input=True matches correspond to the center and otherwise to the top-left corner of the template. To find the best match you must search for peaks in the response (output) image.
2-D or 3-D input image.
Template to locate. It must be (m <= M, n <= N[, d <= D]).
If True, pad image so that output is the same size as the image, and output values correspond to the template center. Otherwise, the output is an array with shape (M - m + 1, N - n + 1) for an (M, N) image and an (m, n) template, and matches correspond to origin (top-left corner) of the template.
Padding mode.
Constant values used in conjunction with mode='constant'.
Response image with correlation coefficients.
Details on the cross-correlation are presented in [1]. This implementation uses FFT convolutions of the image and the template. Reference [2] presents similar derivations but the approximation presented in this reference is not used in our implementation.
J. P. Lewis, “Fast Normalized Cross-Correlation”, Industrial Light and Magic.
Briechle and Hanebeck, “Template Matching using Fast Normalized Cross Correlation”, Proceedings of the SPIE (2001). DOI:10.1117/12.421129
Multi-block local binary pattern (MB-LBP).
The features are calculated similarly to local binary patterns (LBPs), (See local_binary_pattern()) except that summed blocks are used instead of individual pixel values.
MB-LBP is an extension of LBP that can be computed on multiple scales in constant time using the integral image. Nine equally-sized rectangles are used to compute a feature. For each rectangle, the sum of the pixel intensities is computed. Comparisons of these sums to that of the central rectangle determine the feature, similarly to LBP.
Integral image.
Row-coordinate of top left corner of a rectangle containing feature.
Column-coordinate of top left corner of a rectangle containing feature.
Width of one of the 9 equal rectangles that will be used to compute a feature.
Height of one of the 9 equal rectangles that will be used to compute a feature.
8-bit MB-LBP feature descriptor.
Face Detection Based on Multi-Block LBP Representation. Lun Zhang, Rufeng Chu, Shiming Xiang, Shengcai Liao, Stan Z. Li http://www.cbsr.ia.ac.cn/users/scliao/papers/Zhang-ICB07-MBLBP.pdf
Local features for a single- or multi-channel nd image.
Intensity, gradient intensity and local structure are computed at different scales thanks to Gaussian blurring.
Input image, which can be grayscale or multichannel.
True if the last dimension corresponds to color channels.
If True, pixel intensities averaged over the different scales are added to the feature set.
If True, intensities of local gradients averaged over the different scales are added to the feature set.
If True, eigenvalues of the Hessian matrix after Gaussian blurring at different scales are added to the feature set.
Smallest value of the Gaussian kernel used to average local neighbourhoods before extracting features.
Largest value of the Gaussian kernel used to average local neighbourhoods before extracting features.
Number of values of the Gaussian kernel between sigma_min and sigma_max. If None, sigma_min multiplied by powers of 2 are used.
The number of parallel threads to use. If set to None, the full set of available cores are used.
Array of shape image.shape + (n_features,)
Trainable segmentation using local features and random forests
Find peaks in an image as coordinate list or boolean mask.
Peaks are the local maxima in a region of 2 * min_distance + 1 (i.e. peaks are separated by at least min_distance).
If both threshold_abs and threshold_rel are provided, the maximum of the two is chosen as the minimum intensity threshold of peaks.
Changed in version 0.18: Prior to version 0.18, peaks of the same height within a radius of min_distance were all returned, but this could cause unexpected behaviour. From 0.18 onwards, an arbitrary peak within the region is returned. See issue gh-2592.
Input image.
The minimal allowed distance separating peaks. To find the maximum number of peaks, use min_distance=1.
Minimum intensity of peaks. By default, the absolute threshold is the minimum intensity of the image.
Minimum intensity of peaks, calculated as max(image) * threshold_rel.
If positive integer, exclude_border excludes peaks from within exclude_border-pixels of the border of the image. If tuple of non-negative 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 True, takes the min_distance parameter as value. If zero or False, peaks are identified regardless of their distance from the border.
If True, the output will be an array representing peak coordinates. The coordinates are sorted according to peaks values (Larger first). If False, the output will be a boolean array shaped as image.shape with peaks present at True elements. indices is deprecated and will be removed in version 0.20. Default behavior will be to always return peak coordinates. You can obtain a mask as shown in the example below.
Maximum number of peaks. When the number of peaks exceeds num_peaks, return num_peaks peaks based on highest peak intensity.
If provided, footprint == 1 represents the local region within which to search for peaks at every point in image.
If provided, each unique region labels == value represents a unique region to search for peaks. Zero is reserved for background.
Maximum number of peaks for each label.
Which Minkowski p-norm to use. Should be in the range [1, inf]. A finite large p may cause a ValueError if overflow can occur. inf corresponds to the Chebyshev distance and 2 to the Euclidean distance.
See also
The peak local maximum function returns the coordinates of local peaks (maxima) in an image. Internally, a maximum filter is used for finding local maxima. This operation dilates the original image. After comparison of the dilated and original image, this function returns the coordinates or a mask of the peaks where the dilated image equals the original image.
Finding local maxima
Watershed segmentation
Segment human cells (in mitosis)
Plot matched features.
Matches and image are drawn in this ax.
First grayscale or color image.
Second grayscale or color image.
First keypoint coordinates as (row, col).
Second keypoint coordinates as (row, col).
Indices of corresponding matches in first and second set of descriptors, where matches[:, 0] denote the indices in the first and matches[:, 1] the indices in the second set of descriptors.
Color for keypoint locations.
Color for lines which connect keypoint matches. By default the color is chosen randomly.
Whether to only plot matches and not plot the keypoint locations.
Whether to show images side by side, 'horizontal', or one above the other, 'vertical'.
Deprecated function. Use skimage.registration.phase_cross_correlation instead.
Compute the shape index.
The shape index, as defined by Koenderink & van Doorn [1], is a single valued measure of local curvature, assuming the image as a 3D plane with intensities representing heights.
It is derived from the eigen values of the Hessian, and its value ranges from -1 to 1 (and is undefined (=NaN) in flat regions), with following ranges representing following shapes:
Interval (s in …)
Shape
[ -1, -7/8)
Spherical cup
[-7/8, -5/8)
Through
[-5/8, -3/8)
Rut
[-3/8, -1/8)
Saddle rut
[-1/8, +1/8)
Saddle
[+1/8, +3/8)
Saddle ridge
[+3/8, +5/8)
Ridge
[+5/8, +7/8)
Dome
[+7/8, +1]
Spherical cap
Input image.
Standard deviation used for the Gaussian kernel, which is used for smoothing the input data before Hessian eigen value calculation.
How to handle values outside the image borders
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
Shape index
Koenderink, J. J. & van Doorn, A. J., “Surface shape and curvature scales”, Image and Vision Computing, 1992, 10, 557-564. DOI:10.1016/0262-8856(92)90076-F
Compute structure tensor using sum of squared differences.
The (2-dimensional) structure tensor A is defined as:
which is approximated by the weighted sum of squared differences in a local window around each pixel in the image. This formula can be extended to a larger number of dimensions (see [1]).
Input image.
Standard deviation used for the Gaussian kernel, which is used as a weighting function for the local summation of squared differences.
How to handle values outside the image borders.
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
NOTE: Only applies in 2D. Higher dimensions must always use ‘rc’ order. This parameter allows for the use of reverse or forward order of the image axes in gradient computation. ‘rc’ indicates the use of the first axis initially (Arr, Arc, Acc), whilst ‘xy’ indicates the usage of the last axis initially (Axx, Axy, Ayy).
Upper-diagonal elements of the structure tensor for each pixel in the input image.
See also
https://en.wikipedia.org/wiki/Structure_tensor
Compute eigenvalues of structure tensor.
The upper-diagonal elements of the structure tensor, as returned by structure_tensor.
The eigenvalues of the structure tensor, in decreasing order. The eigenvalues are the leading dimension. That is, the coordinate [i, j, k] corresponds to the ith-largest eigenvalue at position (j, k).
See also
Compute eigenvalues of structure tensor.
Element of the structure tensor for each pixel in the input image.
Element of the structure tensor for each pixel in the input image.
Element of the structure tensor for each pixel in the input image.
Larger eigen value for each input matrix.
Smaller eigen value for each input matrix.
Bases: skimage.feature.util.DescriptorExtractor
BRIEF binary descriptor extractor.
BRIEF (Binary Robust Independent Elementary Features) is an efficient feature point descriptor. It is highly discriminative even when using relatively few bits and is computed using simple intensity difference tests.
For each keypoint, intensity comparisons are carried out for a specifically distributed number N of pixel-pairs resulting in a binary descriptor of length N. For binary descriptors the Hamming distance can be used for feature matching, which leads to lower computational cost in comparison to the L2 norm.
Size of BRIEF descriptor for each keypoint. Sizes 128, 256 and 512 recommended by the authors. Default is 256.
Length of the two dimensional square patch sampling region around the keypoints. Default is 49.
Probability distribution for sampling location of decision pixel-pairs around keypoints.
Seed for the random sampling of the decision pixel-pairs. From a square window with length patch_size, pixel pairs are sampled using the mode parameter to build the descriptors using intensity comparison. The value of sample_seed must be the same for the images to be matched while building the descriptors.
Standard deviation of the Gaussian low-pass filter applied to the image to alleviate noise sensitivity, which is strongly recommended to obtain discriminative and good descriptors.
2D ndarray of binary descriptors of size descriptor_size for Q keypoints after filtering out border keypoints with value at an index (i, j) either being True or False representing the outcome of the intensity comparison for i-th keypoint on j-th decision pixel-pair. It is Q == np.sum(mask).
Mask indicating whether a keypoint has been filtered out (False) or is described in the descriptors array (True).
Initialize self. See help(type(self)) for accurate signature.
Extract BRIEF binary descriptors for given keypoints in image.
Input image.
Keypoint coordinates as (row, col).
Bases: skimage.feature.util.FeatureDetector
CENSURE keypoint detector.
Minimum scale to extract keypoints from.
Maximum scale to extract keypoints from. The keypoints will be extracted from all the scales except the first and the last i.e. from the scales in the range [min_scale + 1, max_scale - 1]. The filter sizes for different scales is such that the two adjacent scales comprise of an octave.
Type of bi-level filter used to get the scales of the input image. Possible values are ‘DoB’, ‘Octagon’ and ‘STAR’. The three modes represent the shape of the bi-level filters i.e. box(square), octagon and star respectively. For instance, a bi-level octagon filter consists of a smaller inner octagon and a larger outer octagon with the filter weights being uniformly negative in both the inner octagon while uniformly positive in the difference region. Use STAR and Octagon for better features and DoB for better performance.
Threshold value used to suppress maximas and minimas with a weak magnitude response obtained after Non-Maximal Suppression.
Threshold for rejecting interest points which have ratio of principal curvatures greater than this value.
Motilal Agrawal, Kurt Konolige and Morten Rufus Blas “CENSURE: Center Surround Extremas for Realtime Feature Detection and Matching”, https://link.springer.com/chapter/10.1007/978-3-540-88693-8_8 DOI:10.1007/978-3-540-88693-8_8
Adam Schmidt, Marek Kraft, Michal Fularz and Zuzanna Domagala “Comparative Assessment of Point Feature Detectors and Descriptors in the Context of Robot Navigation” http://yadda.icm.edu.pl/yadda/element/bwmeta1.element.baztech-268aaf28-0faf-4872-a4df-7e2e61cb364c/c/Schmidt_comparative.pdf DOI:10.1.1.465.1117
Keypoint coordinates as (row, col).
Corresponding scales.
Initialize self. See help(type(self)) for accurate signature.
Detect CENSURE keypoints along with the corresponding scale.
Input image.
Bases: object
Class for cascade of classifiers that is used for object detection.
The main idea behind cascade of classifiers is to create classifiers of medium accuracy and ensemble them into one strong classifier instead of just creating a strong one. The second advantage of cascade classifier is that easy examples can be classified only by evaluating some of the classifiers in the cascade, making the process much faster than the process of evaluating a one strong classifier.
Accuracy parameter. Increasing it, makes the classifier detect less false positives but at the same time the false negative score increases.
Amount of stages in a cascade. Each cascade consists of stumps i.e. trained features.
The overall amount of stumps in all the stages of cascade.
The overall amount of different features used by cascade. Two stumps can use the same features but has different trained values.
The width of a detection window that is used. Objects smaller than this window can’t be detected.
The height of a detection window.
A link to the c array that stores stages information using Stage struct.
Link to the c array that stores MBLBP features using MBLBP struct.
The ling to the array with look-up tables that are used by trained MBLBP features (MBLBPStumps) to evaluate a particular region.
Initialize cascade classifier.
A file in a OpenCv format from which all the cascade classifier’s parameters are loaded.
Accuracy parameter. Increasing it, makes the classifier detect less false positives but at the same time the false negative score increases.
Search for the object on multiple scales of input image.
The function takes the input image, the scale factor by which the searching window is multiplied on each step, minimum window size and maximum window size that specify the interval for the search windows that are applied to the input image to detect objects.
Ndarray that represents the input image.
The scale by which searching window is multiplied on each step.
The ratio by which the search step in multiplied on each scale of the image. 1 represents the exaustive search and usually is slow. By setting this parameter to higher values the results will be worse but the computation will be much faster. Usually, values in the interval [1, 1.5] give good results.
Minimum size of the search window.
Maximum size of the search window.
Minimum amount of intersecting detections in order for detection to be approved by the function.
The minimum value of value of ratio (intersection area) / (small rectangle ratio) in order to merge two detections into one.
Dict have form {‘r’: int, ‘c’: int, ‘width’: int, ‘height’: int}, where ‘r’ represents row position of top left corner of detected window, ‘c’ - col position, ‘width’ - width of detected window, ‘height’ - height of detected window.
Bases: skimage.feature.util.FeatureDetector, skimage.feature.util.DescriptorExtractor
Oriented FAST and rotated BRIEF feature detector and binary descriptor extractor.
Number of keypoints to be returned. The function will return the best n_keypoints according to the Harris corner response if more than n_keypoints are detected. If not, then all the detected keypoints are returned.
The n parameter in skimage.feature.corner_fast. Minimum number of consecutive pixels out of 16 pixels on the circle that should all be either brighter or darker w.r.t test-pixel. A point c on the circle is darker w.r.t test pixel p if Ic < Ip - threshold and brighter if Ic > Ip + threshold. Also stands for the n in FAST-n corner detector.
The threshold parameter in feature.corner_fast. Threshold used to decide whether the pixels on the circle are brighter, darker or similar w.r.t. the test pixel. Decrease the threshold when more corners are desired and vice-versa.
The k parameter in skimage.feature.corner_harris. Sensitivity factor to separate corners from edges, typically in range [0, 0.2]. Small values of k result in detection of sharp corners.
Downscale factor for the image pyramid. Default value 1.2 is chosen so that there are more dense scales which enable robust scale invariance for a subsequent feature description.
Maximum number of scales from the bottom of the image pyramid to extract the features from.
Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary Bradski “ORB: An efficient alternative to SIFT and SURF” http://www.vision.cs.chubu.ac.jp/CV-R/pdf/Rublee_iccv2011.pdf
Keypoint coordinates as (row, col).
Corresponding scales.
Corresponding orientations in radians.
Corresponding Harris corner responses.
2D array of binary descriptors of size descriptor_size for Q keypoints after filtering out border keypoints with value at an index (i, j) either being True or False representing the outcome of the intensity comparison for i-th keypoint on j-th decision pixel-pair. It is Q == np.sum(mask).
Initialize self. See help(type(self)) for accurate signature.
Detect oriented FAST keypoints along with the corresponding scale.
Input image.
Detect oriented FAST keypoints and extract rBRIEF descriptors.
Note that this is faster than first calling detect and then extract.
Input image.
Extract rBRIEF binary descriptors for given keypoints in image.
Note that the keypoints must be extracted using the same downscale and n_scales parameters. Additionally, if you want to extract both keypoints and descriptors you should use the faster detect_and_extract.
Input image.
Keypoint coordinates as (row, col).
Corresponding scales.
Corresponding orientations in radians.


Finds blobs in the given grayscale image.
Blobs are found using the Difference of Gaussian (DoG) method [1]. For each blob found, the method returns its coordinates and the standard deviation of the Gaussian kernel that detected the blob.
Input grayscale image, blobs are assumed to be light on dark background (white on black).
The minimum standard deviation for Gaussian kernel. Keep this low to detect smaller blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The ratio between the standard deviation of Gaussian Kernels used for computing the Difference of Gaussians
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect blobs with less intensities.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
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.
A 2d array with each row representing 2 coordinate values for a 2D image, and 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.
See also
The radius of each blob is approximately \(\sqrt{2}\sigma\) for a 2-D image and \(\sqrt{3}\sigma\) for a 3-D image.
https://en.wikipedia.org/wiki/Blob_detection#The_difference_of_Gaussians_approach


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].
Input grayscale image.Blobs can either be light on dark or vice versa.
The minimum standard deviation for Gaussian Kernel used to compute Hessian matrix. Keep this low to detect smaller blobs.
The maximum standard deviation for Gaussian Kernel used to compute Hessian matrix. Keep this high to detect larger blobs.
The number of intermediate values of standard deviations to consider between min_sigma and max_sigma.
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect less prominent blobs.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
If set intermediate values of standard deviations are interpolated using a logarithmic scale to the base 10. If not, linear interpolation is used.
A 2d array with each row representing 3 values, (y,x,sigma) where (y,x) are coordinates of the blob and sigma is the standard deviation of the Gaussian kernel of the Hessian Matrix whose determinant detected the blob.
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 line blob_dog() and blob_log() the computation of Gaussians for larger sigma takes more time. The downside is that this method can’t be used for detecting blobs of radius less than 3px due to the box filters used in the approximation of Hessian Determinant.
https://en.wikipedia.org/wiki/Blob_detection#The_determinant_of_the_Hessian
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


Finds blobs in the given grayscale image.
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.
Input grayscale image, blobs are assumed to be light on dark background (white on black).
the minimum standard deviation for Gaussian kernel. Keep this low to detect smaller blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
The number of intermediate values of standard deviations to consider between min_sigma and max_sigma.
The absolute lower bound for scale space maxima. Local maxima smaller than thresh are ignored. Reduce this to detect blobs with less intensities.
A value between 0 and 1. If the area of two blobs overlaps by a fraction greater than threshold, the smaller blob is eliminated.
If set intermediate values of standard deviations are interpolated using a logarithmic scale to the base 10. If not, linear interpolation is used.
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.
A 2d array with each row representing 2 coordinate values for a 2D image, and 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.
The radius of each blob is approximately \(\sqrt{2}\sigma\) for a 2-D image and \(\sqrt{3}\sigma\) for a 3-D image.
https://en.wikipedia.org/wiki/Blob_detection#The_Laplacian_of_Gaussian


Bases: skimage.feature.util.DescriptorExtractor
BRIEF binary descriptor extractor.
BRIEF (Binary Robust Independent Elementary Features) is an efficient feature point descriptor. It is highly discriminative even when using relatively few bits and is computed using simple intensity difference tests.
For each keypoint, intensity comparisons are carried out for a specifically distributed number N of pixel-pairs resulting in a binary descriptor of length N. For binary descriptors the Hamming distance can be used for feature matching, which leads to lower computational cost in comparison to the L2 norm.
Size of BRIEF descriptor for each keypoint. Sizes 128, 256 and 512 recommended by the authors. Default is 256.
Length of the two dimensional square patch sampling region around the keypoints. Default is 49.
Probability distribution for sampling location of decision pixel-pairs around keypoints.
Seed for the random sampling of the decision pixel-pairs. From a square window with length patch_size, pixel pairs are sampled using the mode parameter to build the descriptors using intensity comparison. The value of sample_seed must be the same for the images to be matched while building the descriptors.
Standard deviation of the Gaussian low-pass filter applied to the image to alleviate noise sensitivity, which is strongly recommended to obtain discriminative and good descriptors.
2D ndarray of binary descriptors of size descriptor_size for Q keypoints after filtering out border keypoints with value at an index (i, j) either being True or False representing the outcome of the intensity comparison for i-th keypoint on j-th decision pixel-pair. It is Q == np.sum(mask).
Mask indicating whether a keypoint has been filtered out (False) or is described in the descriptors array (True).
Initialize self. See help(type(self)) for accurate signature.
Extract BRIEF binary descriptors for given keypoints in image.
Input image.
Keypoint coordinates as (row, col).


Extract BRIEF binary descriptors for given keypoints in image.
Input image.
Keypoint coordinates as (row, col).


Initialize self. See help(type(self)) for accurate signature.


Edge filter an image using the Canny algorithm.
Grayscale input image to detect edges on; can be of any dtype.
Standard deviation of the Gaussian filter.
Lower bound for hysteresis thresholding (linking edges). If None, low_threshold is set to 10% of dtype’s max.
Upper bound for hysteresis thresholding (linking edges). If None, high_threshold is set to 20% of dtype’s max.
Mask to limit the application of Canny to a certain area.
If True then treat low_threshold and high_threshold as quantiles of the edge magnitude image, rather than absolute edge magnitude values. If True then the thresholds must be in the range [0, 1].
The binary edge map.
See also
The steps of the algorithm are as follows:
Canny, J., A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986 DOI:10.1109/TPAMI.1986.4767851
William Green’s Canny tutorial https://en.wikipedia.org/wiki/Canny_edge_detector


Bases: object
Class for cascade of classifiers that is used for object detection.
The main idea behind cascade of classifiers is to create classifiers of medium accuracy and ensemble them into one strong classifier instead of just creating a strong one. The second advantage of cascade classifier is that easy examples can be classified only by evaluating some of the classifiers in the cascade, making the process much faster than the process of evaluating a one strong classifier.
Accuracy parameter. Increasing it, makes the classifier detect less false positives but at the same time the false negative score increases.
Amount of stages in a cascade. Each cascade consists of stumps i.e. trained features.
The overall amount of stumps in all the stages of cascade.
The overall amount of different features used by cascade. Two stumps can use the same features but has different trained values.
The width of a detection window that is used. Objects smaller than this window can’t be detected.
The height of a detection window.
A link to the c array that stores stages information using Stage struct.
Link to the c array that stores MBLBP features using MBLBP struct.
The ling to the array with look-up tables that are used by trained MBLBP features (MBLBPStumps) to evaluate a particular region.
Initialize cascade classifier.
A file in a OpenCv format from which all the cascade classifier’s parameters are loaded.
Accuracy parameter. Increasing it, makes the classifier detect less false positives but at the same time the false negative score increases.
Search for the object on multiple scales of input image.
The function takes the input image, the scale factor by which the searching window is multiplied on each step, minimum window size and maximum window size that specify the interval for the search windows that are applied to the input image to detect objects.
Ndarray that represents the input image.
The scale by which searching window is multiplied on each step.
The ratio by which the search step in multiplied on each scale of the image. 1 represents the exaustive search and usually is slow. By setting this parameter to higher values the results will be worse but the computation will be much faster. Usually, values in the interval [1, 1.5] give good results.
Minimum size of the search window.
Maximum size of the search window.
Minimum amount of intersecting detections in order for detection to be approved by the function.
The minimum value of value of ratio (intersection area) / (small rectangle ratio) in order to merge two detections into one.
Dict have form {‘r’: int, ‘c’: int, ‘width’: int, ‘height’: int}, where ‘r’ represents row position of top left corner of detected window, ‘c’ - col position, ‘width’ - width of detected window, ‘height’ - height of detected window.


Search for the object on multiple scales of input image.
The function takes the input image, the scale factor by which the searching window is multiplied on each step, minimum window size and maximum window size that specify the interval for the search windows that are applied to the input image to detect objects.
Ndarray that represents the input image.
The scale by which searching window is multiplied on each step.
The ratio by which the search step in multiplied on each scale of the image. 1 represents the exaustive search and usually is slow. By setting this parameter to higher values the results will be worse but the computation will be much faster. Usually, values in the interval [1, 1.5] give good results.
Minimum size of the search window.
Maximum size of the search window.
Minimum amount of intersecting detections in order for detection to be approved by the function.
The minimum value of value of ratio (intersection area) / (small rectangle ratio) in order to merge two detections into one.
Dict have form {‘r’: int, ‘c’: int, ‘width’: int, ‘height’: int}, where ‘r’ represents row position of top left corner of detected window, ‘c’ - col position, ‘width’ - width of detected window, ‘height’ - height of detected window.


Initialize cascade classifier.
A file in a OpenCv format from which all the cascade classifier’s parameters are loaded.
Accuracy parameter. Increasing it, makes the classifier detect less false positives but at the same time the false negative score increases.


Bases: skimage.feature.util.FeatureDetector
CENSURE keypoint detector.
Minimum scale to extract keypoints from.
Maximum scale to extract keypoints from. The keypoints will be extracted from all the scales except the first and the last i.e. from the scales in the range [min_scale + 1, max_scale - 1]. The filter sizes for different scales is such that the two adjacent scales comprise of an octave.
Type of bi-level filter used to get the scales of the input image. Possible values are ‘DoB’, ‘Octagon’ and ‘STAR’. The three modes represent the shape of the bi-level filters i.e. box(square), octagon and star respectively. For instance, a bi-level octagon filter consists of a smaller inner octagon and a larger outer octagon with the filter weights being uniformly negative in both the inner octagon while uniformly positive in the difference region. Use STAR and Octagon for better features and DoB for better performance.
Threshold value used to suppress maximas and minimas with a weak magnitude response obtained after Non-Maximal Suppression.
Threshold for rejecting interest points which have ratio of principal curvatures greater than this value.
Motilal Agrawal, Kurt Konolige and Morten Rufus Blas “CENSURE: Center Surround Extremas for Realtime Feature Detection and Matching”, https://link.springer.com/chapter/10.1007/978-3-540-88693-8_8 DOI:10.1007/978-3-540-88693-8_8
Adam Schmidt, Marek Kraft, Michal Fularz and Zuzanna Domagala “Comparative Assessment of Point Feature Detectors and Descriptors in the Context of Robot Navigation” http://yadda.icm.edu.pl/yadda/element/bwmeta1.element.baztech-268aaf28-0faf-4872-a4df-7e2e61cb364c/c/Schmidt_comparative.pdf DOI:10.1.1.465.1117
Keypoint coordinates as (row, col).
Corresponding scales.
Initialize self. See help(type(self)) for accurate signature.
Detect CENSURE keypoints along with the corresponding scale.
Input image.


Detect CENSURE keypoints along with the corresponding scale.
Input image.


Extract FAST corners for a given image.
Input image.
Minimum number of consecutive pixels out of 16 pixels on the circle that should all be either brighter or darker w.r.t testpixel. A point c on the circle is darker w.r.t test pixel p if Ic < Ip - threshold and brighter if Ic > Ip + threshold. Also stands for the n in FAST-n corner detector.
Threshold used in deciding whether the pixels on the circle are brighter, darker or similar w.r.t. the test pixel. Decrease the threshold when more corners are desired and vice-versa.
FAST corner response image.
Rosten, E., & Drummond, T. (2006, May). Machine learning for high-speed corner detection. In European conference on computer vision (pp. 430-443). Springer, Berlin, Heidelberg. DOI:10.1007/11744023_34 http://www.edwardrosten.com/work/rosten_2006_machine.pdf
Wikipedia, “Features from accelerated segment test”, https://en.wikipedia.org/wiki/Features_from_accelerated_segment_test


Compute Foerstner corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as:
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Error ellipse sizes.
Roundness of error ellipse.
Förstner, W., & Gülch, E. (1987, June). A fast operator for detection and precise location of distinct points, corners and centres of circular features. In Proc. ISPRS intercommission conference on fast processing of photogrammetric data (pp. 281-305). https://cseweb.ucsd.edu/classes/sp02/cse252/foerstner/foerstner.pdf
https://en.wikipedia.org/wiki/Corner_detection


Compute Harris corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as:
or:
Input image.
Method to compute the response image from the auto-correlation matrix.
Sensitivity factor to separate corners from edges, typically in range [0, 0.2]. Small values of k result in detection of sharp corners.
Normalisation factor (Noble’s corner measure).
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Harris response image.
https://en.wikipedia.org/wiki/Corner_detection


Compute Kitchen and Rosenfeld corner measure response image.
The corner measure is calculated as follows:
Where imx and imy are the first and imxx, imxy, imyy the second derivatives.
Input image.
How to handle values outside the image borders.
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
Kitchen and Rosenfeld response image.
Kitchen, L., & Rosenfeld, A. (1982). Gray-level corner detection. Pattern recognition letters, 1(2), 95-102. DOI:10.1016/0167-8655(82)90020-4


Compute Moravec corner measure response image.
This is one of the simplest corner detectors and is comparatively fast but has several limitations (e.g. not rotation invariant).
Input image.
Window size.
Moravec response image.
https://en.wikipedia.org/wiki/Corner_detection


Compute the orientation of corners.
The orientation of corners is computed using the first order central moment i.e. the center of mass approach. The corner orientation is the angle of the vector from the corner coordinate to the intensity centroid in the local neighborhood around the corner calculated using first order central moment.
Input grayscale image.
Corner coordinates as (row, col).
Mask defining the local neighborhood of the corner used for the calculation of the central moment.
Orientations of corners in the range [-pi, pi].
Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary Bradski “ORB : An efficient alternative to SIFT and SURF” http://www.vision.cs.chubu.ac.jp/CV-R/pdf/Rublee_iccv2011.pdf
Paul L. Rosin, “Measuring Corner Properties” http://users.cs.cf.ac.uk/Paul.Rosin/corner2.pdf


Find peaks in corner measure response image.
This differs from skimage.feature.peak_local_max in that it suppresses multiple connected peaks with the same accumulator value.
Input image.
The minimal allowed distance separating peaks.
See skimage.feature.peak_local_max().
Which Minkowski p-norm to use. Should be in the range [1, inf]. A finite large p may cause a ValueError if overflow can occur. inf corresponds to the Chebyshev distance and 2 to the Euclidean distance.
See also
Changed in version 0.18: The default value of threshold_rel has changed to None, which corresponds to letting skimage.feature.peak_local_max decide on the default. This is equivalent to threshold_rel=0.
The num_peaks limit is applied before suppression of connected peaks. To limit the number of peaks after suppression, set num_peaks=np.inf and post-process the output of this function.


Compute Shi-Tomasi (Kanade-Tomasi) corner measure response image.
This corner detector uses information from the auto-correlation matrix A:
Where imx and imy are first derivatives, averaged with a gaussian filter. The corner measure is then defined as the smaller eigenvalue of A:
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
Shi-Tomasi response image.
https://en.wikipedia.org/wiki/Corner_detection


Determine subpixel position of corners.
A statistical test decides whether the corner is defined as the intersection of two edges or a single peak. Depending on the classification result, the subpixel corner location is determined based on the local covariance of the grey-values. If the significance level for either statistical test is not sufficient, the corner cannot be classified, and the output subpixel position is set to NaN.
Input image.
Corner coordinates (row, col).
Search window size for subpixel estimation.
Significance level for corner classification.
Subpixel corner positions. NaN for “not classified” corners.
Förstner, W., & Gülch, E. (1987, June). A fast operator for detection and precise location of distinct points, corners and centres of circular features. In Proc. ISPRS intercommission conference on fast processing of photogrammetric data (pp. 281-305). https://cseweb.ucsd.edu/classes/sp02/cse252/foerstner/foerstner.pdf
https://en.wikipedia.org/wiki/Corner_detection


Extract DAISY feature descriptors densely for the given image.
DAISY is a feature descriptor similar to SIFT formulated in a way that allows for fast dense extraction. Typically, this is practical for bag-of-features image representations.
The implementation follows Tola et al. [1] but deviate on the following points:
Input image (grayscale).
Distance between descriptor sampling points.
Radius (in pixels) of the outermost ring.
Number of rings.
Number of histograms sampled per ring.
Number of orientations (bins) per histogram.
How to normalize the descriptors
Standard deviation of spatial Gaussian smoothing for the center histogram and for each ring of histograms. The array of sigmas should be sorted from the center and out. I.e. the first sigma value defines the spatial smoothing of the center histogram and the last sigma value defines the spatial smoothing of the outermost ring. Specifying sigmas overrides the following parameter.
rings = len(sigmas) - 1
Radius (in pixels) for each ring. Specifying ring_radii overrides the following two parameters.
rings = len(ring_radii) radius = ring_radii[-1]
If both sigmas and ring_radii are given, they must satisfy the following predicate since no radius is needed for the center histogram.
len(ring_radii) == len(sigmas) + 1
Generate a visualization of the DAISY descriptors
Grid of DAISY descriptors for the given image as an array dimensionality (P, Q, R) where
P = ceil((M - radius*2) / step) Q = ceil((N - radius*2) / step) R = (rings * histograms + 1) * orientations
Visualization of the DAISY descriptors.
Tola et al. “Daisy: An efficient dense descriptor applied to wide- baseline stereo.” Pattern Analysis and Machine Intelligence, IEEE Transactions on 32.5 (2010): 815-830.
http://cvlab.epfl.ch/software/daisy


Visualization of Haar-like features.
The region of an integral image for which the features need to be computed.
Row-coordinate of top left corner of the detection window.
Column-coordinate of top left corner of the detection window.
Width of the detection window.
Height of the detection window.
The array of coordinates to be extracted. This is useful when you want to recompute only a subset of features. In this case feature_type needs to be an array containing the type of each feature, as returned by haar_like_feature_coord(). By default, all coordinates are computed.
Floats specifying the color for the positive block. Corresponding values define (R, G, B) values. Default value is red (1, 0, 0).
Floats specifying the color for the negative block Corresponding values define (R, G, B) values. Default value is blue (0, 1, 0).
Value in the range [0, 1] that specifies opacity of visualization. 1 - fully transparent, 0 - opaque.
The maximum number of features to be returned. By default, all features are returned.
If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random. The random state is used when generating a set of features smaller than the total number of available features.
An image in which the different features will be added.


Multi-block local binary pattern visualization.
Blocks with higher sums are colored with alpha-blended white rectangles, whereas blocks with lower sums are colored alpha-blended cyan. Colors and the alpha parameter can be changed.
Image on which to visualize the pattern.
Row-coordinate of top left corner of a rectangle containing feature.
Column-coordinate of top left corner of a rectangle containing feature.
Width of one of 9 equal rectangles that will be used to compute a feature.
Height of one of 9 equal rectangles that will be used to compute a feature.
The descriptor of feature to visualize. If not provided, the descriptor with 0 value will be used.
Floats specifying the color for the block that has greater intensity value. They should be in the range [0, 1]. Corresponding values define (R, G, B) values. Default value is white (1, 1, 1).
Floats specifying the color for the block that has greater intensity value. They should be in the range [0, 1]. Corresponding values define (R, G, B) values. Default value is cyan (0, 0.69, 0.96).
Value in the range [0, 1] that specifies opacity of visualization. 1 - fully transparent, 0 - opaque.
Image with MB-LBP visualization.
Face Detection Based on Multi-Block LBP Representation. Lun Zhang, Rufeng Chu, Shiming Xiang, Shengcai Liao, Stan Z. Li http://www.cbsr.ia.ac.cn/users/scliao/papers/Zhang-ICB07-MBLBP.pdf


Calculate the grey-level co-occurrence matrix.
A grey level co-occurrence matrix is a histogram of co-occurring greyscale values at a given offset over an image.
Integer typed input image. Only positive valued images are supported. If type is other than uint8, the argument levels needs to be set.
List of pixel pair distance offsets.
List of pixel pair angles in radians.
The input image should contain integers in [0, levels-1], where levels indicate the number of grey-levels counted (typically 256 for an 8-bit image). This argument is required for 16-bit images or higher and is typically the maximum of the image. As the output matrix is at least levels x levels, it might be preferable to use binning of the input image rather than large values for levels.
If True, the output matrix P[:, :, d, theta] is symmetric. This is accomplished by ignoring the order of value pairs, so both (i, j) and (j, i) are accumulated when (i, j) is encountered for a given offset. The default is False.
If True, normalize each matrix P[:, :, d, theta] by dividing by the total number of accumulated co-occurrences for the given offset. The elements of the resulting matrix sum to 1. The default is False.
The grey-level co-occurrence histogram. The value P[i,j,d,theta] is the number of times that grey-level j occurs at a distance d and at an angle theta from grey-level i. If normed is False, the output is of type uint32, otherwise it is float64. The dimensions are: levels x levels x number of distances x number of angles.
The GLCM Tutorial Home Page, http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
Haralick, RM.; Shanmugam, K., “Textural features for image classification” IEEE Transactions on systems, man, and cybernetics 6 (1973): 610-621. DOI:10.1109/TSMC.1973.4309314
Pattern Recognition Engineering, Morton Nadler & Eric P. Smith
Wikipedia, https://en.wikipedia.org/wiki/Co-occurrence_matrix
Compute 2 GLCMs: One for a 1-pixel offset to the right, and one for a 1-pixel offset upwards.


Calculate texture properties of a GLCM.
Compute a feature of a grey level co-occurrence matrix to serve as a compact summary of the matrix. The properties are computed as follows:
Each GLCM is normalized to have a sum of 1 before the computation of texture properties.
Input array. P is the grey-level co-occurrence histogram for which to compute the specified property. The value P[i,j,d,theta] is the number of times that grey-level j occurs at a distance d and at an angle theta from grey-level i.
The property of the GLCM to compute. The default is ‘contrast’.
2-dimensional array. results[d, a] is the property ‘prop’ for the d’th distance and the a’th angle.
The GLCM Tutorial Home Page, http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
Compute the contrast for GLCMs with distances [1, 2] and angles [0 degrees, 90 degrees]


Compute the Haar-like features for a region of interest (ROI) of an integral image.
Haar-like features have been successfully used for image classification and object detection [1]. It has been used for real-time face detection algorithm proposed in [2].
Integral image for which the features need to be computed.
Row-coordinate of top left corner of the detection window.
Column-coordinate of top left corner of the detection window.
Width of the detection window.
Height of the detection window.
The type of feature to consider:
By default all features are extracted.
If using with feature_coord, it should correspond to the feature type of each associated coordinate feature.
The array of coordinates to be extracted. This is useful when you want to recompute only a subset of features. In this case feature_type needs to be an array containing the type of each feature, as returned by haar_like_feature_coord(). By default, all coordinates are computed.
Resulting Haar-like features. Each value is equal to the subtraction of sums of the positive and negative rectangles. The data type depends of the data type of int_image: int when the data type of int_image is uint or int and float when the data type of int_image is float.
When extracting those features in parallel, be aware that the choice of the backend (i.e. multiprocessing vs threading) will have an impact on the performance. The rule of thumb is as follows: use multiprocessing when extracting features for all possible ROI in an image; use threading when extracting the feature at specific location for a limited number of ROIs. Refer to the example Face classification using Haar-like feature descriptor for more insights.
https://en.wikipedia.org/wiki/Haar-like_feature
Oren, M., Papageorgiou, C., Sinha, P., Osuna, E., & Poggio, T. (1997, June). Pedestrian detection using wavelet templates. In Computer Vision and Pattern Recognition, 1997. Proceedings., 1997 IEEE Computer Society Conference on (pp. 193-199). IEEE. http://tinyurl.com/y6ulxfta DOI:10.1109/CVPR.1997.609319
Viola, Paul, and Michael J. Jones. “Robust real-time face detection.” International journal of computer vision 57.2 (2004): 137-154. https://www.merl.com/publications/docs/TR2004-043.pdf DOI:10.1109/CVPR.2001.990517
You can compute the feature for some pre-computed coordinates.


Compute the coordinates of Haar-like features.
Width of the detection window.
Height of the detection window.
The type of feature to consider:
By default all features are extracted.
Coordinates of the rectangles for each feature.
The corresponding type for each feature.


Compute Hessian matrix.
The Hessian matrix is defined as:
which is computed by convolving the image with the second derivatives of the Gaussian kernel in the respective r- and c-directions.
Input image.
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
How to handle values outside the image borders.
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
This parameter allows for the use of reverse or forward order of the image axes in gradient computation. ‘rc’ indicates the use of the first axis initially (Hrr, Hrc, Hcc), whilst ‘xy’ indicates the usage of the last axis initially (Hxx, Hxy, Hyy)
Element of the Hessian matrix for each pixel in the input image.
Element of the Hessian matrix for each pixel in the input image.
Element of the Hessian matrix for each pixel in the input image.


Compute the approximate Hessian Determinant over an image.
The 2D approximate method uses box filters over integral images to compute the approximate Hessian Determinant, as described in [1].
The image over which to compute Hessian Determinant.
Standard deviation used for the Gaussian kernel, used for the Hessian matrix.
If True and the image is 2D, use a much faster approximate computation. This argument has no effect on 3D and higher images.
The array of the Determinant of Hessians.
For 2D images when approximate=True, the running time of this method only depends on size of the image. It is independent of sigma as one would expect. The downside is that the result for sigma less than 3 is not accurate, i.e., not similar to the result obtained if someone computed the Hessian and took its determinant.
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


Compute eigenvalues of Hessian matrix.
The upper-diagonal elements of the Hessian matrix, as returned by hessian_matrix.
The eigenvalues of the Hessian matrix, in decreasing order. The eigenvalues are the leading dimension. That is, eigs[i, j, k] contains the ith-largest eigenvalue at position (j, k).


Extract Histogram of Oriented Gradients (HOG) for a given image.
Compute a Histogram of Oriented Gradients (HOG) by
Input image.
Number of orientation bins.
Size (in pixels) of a cell.
Number of cells in each block.
Block normalization method:
Normalization using L1-norm.
Normalization using L1-norm, followed by square root.
Normalization using L2-norm.
Normalization using L2-norm, followed by limiting the maximum values to 0.2 (Hys stands for hysteresis) and renormalization using L2-norm. (default) For details, see [3], [4].
Also return an image of the HOG. For each cell and orientation bin, the image contains a line segment that is centered at the cell center, is perpendicular to the midpoint of the range of angles spanned by the orientation bin, and has intensity proportional to the corresponding histogram value.
Apply power law compression to normalize the image before processing. DO NOT use this if the image contains negative values. Also see notes section below.
Return the data as a feature vector by calling .ravel() on the result just before returning.
If True, the last image dimension is considered as a color channel, otherwise as spatial.
HOG descriptor for the image. If feature_vector is True, a 1D (flattened) array is returned.
A visualisation of the HOG image. Only provided if visualize is True.
The presented code implements the HOG extraction method from [2] with the following changes: (I) blocks of (3, 3) cells are used ((2, 2) in the paper); (II) no smoothing within cells (Gaussian spatial window with sigma=8pix in the paper); (III) L1 block normalization is used (L2-Hys in the paper).
Power law compression, also known as Gamma correction, is used to reduce the effects of shadowing and illumination variations. The compression makes the dark regions lighter. When the kwarg transform_sqrt is set to True, the function computes the square root of each color channel and then applies the hog algorithm to the image.
https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
Dalal, N and Triggs, B, Histograms of Oriented Gradients for Human Detection, IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2005 San Diego, CA, USA, https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf, DOI:10.1109/CVPR.2005.177
Lowe, D.G., Distinctive image features from scale-invatiant keypoints, International Journal of Computer Vision (2004) 60: 91, http://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf, DOI:10.1023/B:VISI.0000029664.99615.94
Dalal, N, Finding People in Images and Videos, Human-Computer Interaction [cs.HC], Institut National Polytechnique de Grenoble - INPG, 2006, https://tel.archives-ouvertes.fr/tel-00390303/file/NavneetDalalThesis.pdf


Gray scale and rotation invariant LBP (Local Binary Patterns).
LBP is an invariant descriptor that can be used for texture classification.
Graylevel image.
Number of circularly symmetric neighbour set points (quantization of the angular space).
Radius of circle (spatial resolution of the operator).
Method to determine the pattern.
rotation invariant.
rotation invariant.
finer quantization of the angular space which is gray scale and rotation invariant.
which is only gray scale invariant [2].
image texture which is rotation but not gray scale invariant.
LBP image.
Multiresolution Gray-Scale and Rotation Invariant Texture Classification with Local Binary Patterns. Timo Ojala, Matti Pietikainen, Topi Maenpaa. http://www.ee.oulu.fi/research/mvmp/mvg/files/pdf/pdf_94.pdf, 2002.
Face recognition with local binary patterns. Timo Ahonen, Abdenour Hadid, Matti Pietikainen, http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.214.6851, 2004.


Deprecated function. Use skimage.registration.phase_cross_correlation instead.


Brute-force matching of descriptors.
For each descriptor in the first set this matcher finds the closest descriptor in the second set (and vice-versa in the case of enabled cross-checking).
Descriptors of size P about M keypoints in the first image.
Descriptors of size P about N keypoints in the second image.
The metric to compute the distance between two descriptors. See scipy.spatial.distance.cdist for all possible types. The hamming distance should be used for binary descriptors. By default the L2-norm is used for all descriptors of dtype float or double and the Hamming distance is used for binary descriptors automatically.
The p-norm to apply for metric='minkowski'.
Maximum allowed distance between descriptors of two keypoints in separate images to be regarded as a match.
If True, the matched keypoints are returned after cross checking i.e. a matched pair (keypoint1, keypoint2) is returned if keypoint2 is the best match for keypoint1 in second image and keypoint1 is the best match for keypoint2 in first image.
Maximum ratio of distances between first and second closest descriptor in the second set of descriptors. This threshold is useful to filter ambiguous matches between the two descriptor sets. The choice of this value depends on the statistics of the chosen descriptor, e.g., for SIFT descriptors a value of 0.8 is usually chosen, see D.G. Lowe, “Distinctive Image Features from Scale-Invariant Keypoints”, International Journal of Computer Vision, 2004.
Indices of corresponding matches in first and second set of descriptors, where matches[:, 0] denote the indices in the first and matches[:, 1] the indices in the second set of descriptors.


Match a template to a 2-D or 3-D image using normalized correlation.
The output is an array with values between -1.0 and 1.0. The value at a given position corresponds to the correlation coefficient between the image and the template.
For pad_input=True matches correspond to the center and otherwise to the top-left corner of the template. To find the best match you must search for peaks in the response (output) image.
2-D or 3-D input image.
Template to locate. It must be (m <= M, n <= N[, d <= D]).
If True, pad image so that output is the same size as the image, and output values correspond to the template center. Otherwise, the output is an array with shape (M - m + 1, N - n + 1) for an (M, N) image and an (m, n) template, and matches correspond to origin (top-left corner) of the template.
Padding mode.
Constant values used in conjunction with mode='constant'.
Response image with correlation coefficients.
Details on the cross-correlation are presented in [1]. This implementation uses FFT convolutions of the image and the template. Reference [2] presents similar derivations but the approximation presented in this reference is not used in our implementation.
J. P. Lewis, “Fast Normalized Cross-Correlation”, Industrial Light and Magic.
Briechle and Hanebeck, “Template Matching using Fast Normalized Cross Correlation”, Proceedings of the SPIE (2001). DOI:10.1117/12.421129


Multi-block local binary pattern (MB-LBP).
The features are calculated similarly to local binary patterns (LBPs), (See local_binary_pattern()) except that summed blocks are used instead of individual pixel values.
MB-LBP is an extension of LBP that can be computed on multiple scales in constant time using the integral image. Nine equally-sized rectangles are used to compute a feature. For each rectangle, the sum of the pixel intensities is computed. Comparisons of these sums to that of the central rectangle determine the feature, similarly to LBP.
Integral image.
Row-coordinate of top left corner of a rectangle containing feature.
Column-coordinate of top left corner of a rectangle containing feature.
Width of one of the 9 equal rectangles that will be used to compute a feature.
Height of one of the 9 equal rectangles that will be used to compute a feature.
8-bit MB-LBP feature descriptor.
Face Detection Based on Multi-Block LBP Representation. Lun Zhang, Rufeng Chu, Shiming Xiang, Shengcai Liao, Stan Z. Li http://www.cbsr.ia.ac.cn/users/scliao/papers/Zhang-ICB07-MBLBP.pdf


Local features for a single- or multi-channel nd image.
Intensity, gradient intensity and local structure are computed at different scales thanks to Gaussian blurring.
Input image, which can be grayscale or multichannel.
True if the last dimension corresponds to color channels.
If True, pixel intensities averaged over the different scales are added to the feature set.
If True, intensities of local gradients averaged over the different scales are added to the feature set.
If True, eigenvalues of the Hessian matrix after Gaussian blurring at different scales are added to the feature set.
Smallest value of the Gaussian kernel used to average local neighbourhoods before extracting features.
Largest value of the Gaussian kernel used to average local neighbourhoods before extracting features.
Number of values of the Gaussian kernel between sigma_min and sigma_max. If None, sigma_min multiplied by powers of 2 are used.
The number of parallel threads to use. If set to None, the full set of available cores are used.
Array of shape image.shape + (n_features,)