hessian_matrix
-
skimage.feature.hessian_matrix(image, sigma=1, mode='constant', cval=0)
[source] -
Compute Hessian matrix.
The Hessian matrix is defined as:
H = [Hxx Hxy] [Hxy Hyy]
which is computed by convolving the image with the second derivatives of the Gaussian kernel in the respective x- and y-directions.
Parameters: image : ndarray
Input image.
sigma : float
Standard deviation used for the Gaussian kernel, which is used as weighting function for the auto-correlation matrix.
mode : {‘constant’, ‘reflect’, ‘wrap’, ‘nearest’, ‘mirror’}, optional
How to handle values outside the image borders.
cval : float, optional
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
Returns: Hxx : ndarray
Element of the Hessian matrix for each pixel in the input image.
Hxy : ndarray
Element of the Hessian matrix for each pixel in the input image.
Hyy : ndarray
Element of the Hessian matrix for each pixel in the input image.
Examples
>>> from skimage.feature import hessian_matrix >>> square = np.zeros((5, 5)) >>> square[2, 2] = -1.0 / 1591.54943092 >>> Hxx, Hxy, Hyy = hessian_matrix(square, sigma=0.1) >>> Hxx array([[ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.], [ 0., 0., 1., 0., 0.], [ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.]])
Please login to continue.