
- Scikit Image – Introduction
- Scikit Image - Image Processing
- Scikit Image - Numpy Images
- Scikit Image - Image datatypes
- Scikit Image - Using Plugins
- Scikit Image - Image Handlings
- Scikit Image - Reading Images
- Scikit Image - Writing Images
- Scikit Image - Displaying Images
- Scikit Image - Image Collections
- Scikit Image - Image Stack
- Scikit Image - Multi Image
- Scikit Image - Data Visualization
- Scikit Image - Using Matplotlib
- Scikit Image - Using Ploty
- Scikit Image - Using Mayavi
- Scikit Image - Using Napari
- Scikit Image - Color Manipulation
- Scikit Image - Alpha Channel
- Scikit Image - Conversion b/w Color & Gray Values
- Scikit Image - Conversion b/w RGB & HSV
- Scikit Image - Conversion to CIE-LAB Color Space
- Scikit Image - Conversion from CIE-LAB Color Space
- Scikit Image - Conversion to luv Color Space
- Scikit Image - Conversion from luv Color Space
- Scikit Image - Image Inversion
- Scikit Image - Painting Images with Labels
- Scikit Image - Contrast & Exposure
- Scikit Image - Contrast
- Scikit Image - Contrast enhancement
- Scikit Image - Exposure
- Scikit Image - Histogram Matching
- Scikit Image - Histogram Equalization
- Scikit Image - Local Histogram Equalization
- Scikit Image - Tinting gray-scale images
- Scikit Image - Image Transformation
- Scikit Image - Scaling an image
- Scikit Image - Rotating an Image
- Scikit Image - Warping an Image
- Scikit Image - Affine Transform
- Scikit Image - Piecewise Affine Transform
- Scikit Image - ProjectiveTransform
- Scikit Image - EuclideanTransform
- Scikit Image - Radon Transform
- Scikit Image - Line Hough Transform
- Scikit Image - Probabilistic Hough Transform
- Scikit Image - Circular Hough Transforms
- Scikit Image - Elliptical Hough Transforms
- Scikit Image - Polynomial Transform
- Scikit Image - Image Pyramids
- Scikit Image - Pyramid Gaussian Transform
- Scikit Image - Pyramid Laplacian Transform
- Scikit Image - Swirl Transform
- Scikit Image - Morphological Operations
- Scikit Image - Erosion
- Scikit Image - Dilation
- Scikit Image - Black & White Tophat Morphologies
- Scikit Image - Convex Hull
- Scikit Image - Generating footprints
- Scikit Image - Isotopic Dilation & Erosion
- Scikit Image - Isotopic Closing & Opening of an Image
- Scikit Image - Skelitonizing an Image
- Scikit Image - Morphological Thinning
- Scikit Image - Masking an image
- Scikit Image - Area Closing & Opening of an Image
- Scikit Image - Diameter Closing & Opening of an Image
- Scikit Image - Morphological reconstruction of an Image
- Scikit Image - Finding local Maxima
- Scikit Image - Finding local Minima
- Scikit Image - Removing Small Holes from an Image
- Scikit Image - Removing Small Objects from an Image
- Scikit Image - Filters
- Scikit Image - Image Filters
- Scikit Image - Median Filter
- Scikit Image - Mean Filters
- Scikit Image - Morphological gray-level Filters
- Scikit Image - Gabor Filter
- Scikit Image - Gaussian Filter
- Scikit Image - Butterworth Filter
- Scikit Image - Frangi Filter
- Scikit Image - Hessian Filter
- Scikit Image - Meijering Neuriteness Filter
- Scikit Image - Sato Filter
- Scikit Image - Sobel Filter
- Scikit Image - Farid Filter
- Scikit Image - Scharr Filter
- Scikit Image - Unsharp Mask Filter
- Scikit Image - Roberts Cross Operator
- Scikit Image - Lapalace Operator
- Scikit Image - Window Functions With Images
- Scikit Image - Thresholding
- Scikit Image - Applying Threshold
- Scikit Image - Otsu Thresholding
- Scikit Image - Local thresholding
- Scikit Image - Hysteresis Thresholding
- Scikit Image - Li thresholding
- Scikit Image - Multi-Otsu Thresholding
- Scikit Image - Niblack and Sauvola Thresholding
- Scikit Image - Restoring Images
- Scikit Image - Rolling-ball Algorithm
- Scikit Image - Denoising an Image
- Scikit Image - Wavelet Denoising
- Scikit Image - Non-local means denoising for preserving textures
- Scikit Image - Calibrating Denoisers Using J-Invariance
- Scikit Image - Total Variation Denoising
- Scikit Image - Shift-invariant wavelet denoising
- Scikit Image - Image Deconvolution
- Scikit Image - Richardson-Lucy Deconvolution
- Scikit Image - Recover the original from a wrapped phase image
- Scikit Image - Image Inpainting
- Scikit Image - Registering Images
- Scikit Image - Image Registration
- Scikit Image - Masked Normalized Cross-Correlation
- Scikit Image - Registration using optical flow
- Scikit Image - Assemble images with simple image stitching
- Scikit Image - Registration using Polar and Log-Polar
- Scikit Image - Feature Detection
- Scikit Image - Dense DAISY Feature Description
- Scikit Image - Histogram of Oriented Gradients
- Scikit Image - Template Matching
- Scikit Image - CENSURE Feature Detector
- Scikit Image - BRIEF Binary Descriptor
- Scikit Image - SIFT Feature Detector and Descriptor Extractor
- Scikit Image - GLCM Texture Features
- Scikit Image - Shape Index
- Scikit Image - Sliding Window Histogram
- Scikit Image - Finding Contour
- Scikit Image - Texture Classification Using Local Binary Pattern
- Scikit Image - Texture Classification Using Multi-Block Local Binary Pattern
- Scikit Image - Active Contour Model
- Scikit Image - Canny Edge Detection
- Scikit Image - Marching Cubes
- Scikit Image - Foerstner Corner Detection
- Scikit Image - Harris Corner Detection
- Scikit Image - Extracting FAST Corners
- Scikit Image - Shi-Tomasi Corner Detection
- Scikit Image - Haar Like Feature Detection
- Scikit Image - Haar Feature detection of coordinates
- Scikit Image - Hessian matrix
- Scikit Image - ORB feature Detection
- Scikit Image - Additional Concepts
- Scikit Image - Render text onto an image
- Scikit Image - Face detection using a cascade classifier
- Scikit Image - Face classification using Haar-like feature descriptor
- Scikit Image - Visual image comparison
- Scikit Image - Exploring Region Properties With Pandas
Scikit Image − Hessian Filter
The Hessian filter is a commonly used technique in image processing for detecting ridge-like structures within an image. These structures can take various forms, such as neurites, tubes, vessels, wrinkles, or rivers. The Hessian filter belongs to a class of ridge filters that rely on the eigenvalues of the Hessian matrix of image intensities to identify ridge structures.
This filter can be used to enhance and analyze the features of interest in an image. The choice of parameters like alpha, beta, and gamma can be adjusted to fine-tune the filter's behavior for a specific application.
The scikit image library provides the hessian() function in the filters module to apply the Hybrid Hessian filter on images.
Using the skimage.filters.hessian() function
The filters.hessian() function is used to filter an image with the Hybrid Hessian filter, primarily designed for detecting continuous edges such as vessels, wrinkles, or rivers.
This filter works on 2-D and 3-D images and is similar to the Frangi filter but it uses an alternative smoothing method. The parameters of this function include:
Syntax
Following is the syntax of this function −
skimage.filters.hessian(image, sigmas=range(1, 10, 2), scale_range=None, scale_step=None, alpha=0.5, beta=0.5, gamma=15, black_ridges=True, mode='reflect', cval=0)
Parameters
The function accepts the following parameters −
- Image ((N, M[, P]) ndarray): This parameter is the input image on which the Hessian filter will be applied.
- Sigmas (iterable of floats, optional): It specifying the scales of the filter. i.e., np.arange(scale_range[0], scale_range[1], scale_step).
- Scale_range (2-tuple of floats, optional): It defines the range of sigmas used.
- Scale_step (float, optional): This parameter specifies the step size between sigmas.
- Beta (float, optional): The Frangi correction constant, adjusting the filter's sensitivity to deviations from blob-like structures.
- Gamma (float, optional): The Frangi correction constant, adjusting the filter's sensitivity to areas with high variance, texture, or structure.
- Black_ridges (boolean, optional): The default value is True, determining whether the filter detects black ridges (True) or white ridges (False).
- Mode (string, optional): This parameter specifies how to handle values outside the image borders, with options like 'constant', 'reflect', 'wrap', 'nearest', or 'mirror'.
- Cval (float, optional): This is used in conjunction with mode 'constant' to specify the value outside the image boundaries.
Return value
The function returns a filtered image as an ndarray, which is the maximum pixel value across all scales.
Example
This example demonstrates the use of the skimage.filters.hessian() function with its default parameter values −
import matplotlib.pyplot as plt from skimage.filters import hessian from skimage import io, color # Load the input image in_image = io.imread('Images/tree.jpg') x_0 = 250 y_0 = 100 width = 250 height = 150 # Crop the image to the specified region and convert it to grayscale image = color.rgb2gray(in_image[y_0:(y_0 + height), x_0:(x_0 + width)]) # Apply the Hessian filter with the default values filtered_image = hessian(image) # Plot the original and filtered images fig, axes = plt.subplots(1, 2, figsize=(10, 5)) ax = axes.ravel() # Display the Original Image ax[0].imshow(image, cmap='gray') ax[0].set_title('Original Image') ax[0].axis('off') # Display the Filtered Image ax[1].imshow(filtered_image, cmap='gray') ax[1].axis('off') ax[1].set_title('Hessian Filter Result') plt.tight_layout() plt.show()
Output
Example
The following example demonstrates the use of the Hessian filter using the skimage.filters.hessian() function on an image with different sigmas to enhance and visualize structures in an image −
from skimage import io from skimage import color from skimage.filters import hessian import matplotlib.pyplot as plt # Load the input image in_image = io.imread('Images/tree.jpg') x_0 = 250 y_0 = 100 width = 250 height = 150 # Crop the image to the specified region and convert it to grayscale image = color.rgb2gray(in_image[y_0:(y_0 + height), x_0:(x_0 + width)]) # Apply the Hessian filter with differnt sigmas result_hessian_black_ridges = hessian(image, sigmas=[1], black_ridges=True) result_hessian_sigmas_black_ridges = hessian(image, sigmas=range(1, 5), black_ridges=True) # Plot the original and filtered images fig, axes = plt.subplots(2, 3, figsize=(10, 5)) ax = axes.ravel() # Display the Original Image ax[0].imshow(image, cmap='gray') ax[0].set_title('Original Image') ax[0].axis('off') # Display the Result with black_ridges=True ax[1].imshow(result_hessian_black_ridges, cmap='gray') ax[1].axis('off') ax[1].set_title('Hessian Filter (black_ridges=True)\n \N{GREEK SMALL LETTER SIGMA}=[1]') # Display the Result with black_ridges=True ax[2].imshow(result_hessian_sigmas_black_ridges, cmap='gray') ax[2].axis('off') ax[2].set_title('Hessian Filter (black_ridges=True)\n \N{GREEK SMALL LETTER SIGMA} =[1,2,3,4]') # Display the Original Image again (for the second row) ax[3].imshow(image, cmap='gray') ax[3].axis('off') ax[3].set_title('Original Image') # Display the Result with black_ridges=True ax[4].imshow(result_hessian_black_ridges, cmap='gray') ax[4].axis('off') ax[4].set_title('Hessian Filter (black_ridges=True)\n \N{GREEK SMALL LETTER SIGMA}=[1]') # Display the Result with black_ridges=True ax[5].imshow(result_hessian_sigmas_black_ridges, cmap='gray') ax[5].axis('off') ax[5].set_title('Hessian Filter (black_ridges=True)\n \N{GREEK SMALL LETTER SIGMA} =[1,2,3,4]') plt.tight_layout() plt.show()