
- 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 - CENSURE Feature Detector
The CENSURE also know as Center Surround Extrema feature detector is a type of scale-invariant keypoint detector widely used in computer vision. It is primary purpose is to identify distinctive keypoints or interest points in an image that are invariant to changes in scale. CENSURE achieves this by analyzing extrema (maxima and minima) within center-surround filters applied to an image at multiple scales. These features are similar in nature to the Laplacian of Gaussian (LoG) features, commonly used for scale-invariant feature detection but can be computed more efficiently, often in real-time applications, using integral images.
Scikit-image offers a flexible way to detect keypoints in images using the CENSURE class. This class is a part of the feature submodule within the scikit-image library.
Using the skimage.feature.CENSURE() Class
The class skimage.feature.CENSURE() is a keypoint detector that is used to extract keypoints or interest points from an image.
Syntax
Following is the syntax of this class −
class skimage.feature.CENSURE(min_scale=1, max_scale=7, mode='DoB', non_max_threshold=0.15, line_threshold=10)
Parameters
Here is the explanation of its parameters −
min_scale (int, optional): This parameter specifies the minimum scale to extract keypoints from. The default value is 1.
max_scale (int, optional): This parameter specifies the maximum scale to extract keypoints from. The keypoints will be extracted from all scales within the range [min_scale + 1, max_scale - 1]. The filter sizes for different scales are set up so that adjacent scales form an octave. The default value is 7.
-
mode ({'DoB', 'Octagon', 'STAR'}, optional): This parameter determines the type of bi-level filter used to get the scales of the input image. The three modes are −
'DoB': Difference of Boxes filter.
'Octagon': Octagon filter.
'STAR': STAR (Scale-space Blob Detector) filter.
The choice of mode affects the shape and behavior of the filter used for feature detection. 'DoB' is recommended for better performance, while 'STAR' and 'Octagon' are recommended for better feature detection. The default mode is 'DoB'.
non_max_threshold (float, optional): This threshold is used to suppress maximas and minimas with a weak magnitude response obtained after Non-Maximal Suppression. The default value is 0.15.
line_threshold (float, optional): This threshold is used for rejecting interest points that have a ratio of principal curvatures greater than this value. The default value is 10.
Here are the attributes of the class −
keypoints ( (N, 2) array): This attribute stores the coordinates of the keypoints as (row, col) pairs.
scales ((N, ) array): This attribute stores the corresponding scales of the keypoints.
Also this class has a method called detect() which is used to detect CENSURE keypoints along with the corresponding scale.
Syntax
Syntax of the detect() method is −
detect(image)
Parameters
The detect() method Parameter −
image (2D ndarray): The input image in which CENSURE keypoints are to be detected.
Example
Here is an example that detects keypoints in the grayscale image using the CENSURE feature detector.
from skimage import io from skimage.color import rgb2gray from skimage.feature import CENSURE # Load the input image and convert it to grayscale img = rgb2gray(io.imread('Images/black rose.jpg')) # Create a CENSURE detector censure = CENSURE() # Detect CENSURE keypoints in the image censure.detect(img) # Access the detected keypoints and scales keypoints = censure.keypoints scales = censure.scales # Print the detected keypoints and their scales print("Number of keypoints:", len(keypoints)) print("Keypoint coordinates (row, col):") for keypoint in keypoints: print(keypoint) print("Scales of keypoints:") print(scales)
Output
Number of keypoints: 17 Keypoint coordinates (row, col): [ 84 429] [ 85 430] [219 169] [219 327] [220 303] [235 158] [332 180] [357 310] [368 311] [373 310] [375 336] [378 344] [380 341] [380 395] [384 401] [387 408] [393 286] Scales of keypoints: [4 6 2 3 3 3 5 3 2 5 2 4 6 2 5 2 2]
Example
The following example demonstrates the use of the CENSURE feature detector to detect keypoints in both an original and a transformed version of the input image.
from skimage import io from skimage import transform from skimage.feature import CENSURE from skimage.color import rgb2gray import matplotlib.pyplot as plt # Load the input image and Convert it to grayscale image = rgb2gray(io.imread('Images/group chat.jpg')) # Define an affine transformation for warping the image tform = transform.AffineTransform(scale=(1.5, 1.5), rotation=0.3, translation=(50, -100)) # Warp the original image using the defined transformation img_warp = transform.warp(image, tform) # Create a CENSURE detector detector = CENSURE() # Create subplots for displaying the original and transformed images with keypoints fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(12, 6)) # Detect keypoints in the original image detector.detect(image) # Display the original image with keypoints ax[0].imshow(image, cmap=plt.cm.gray) ax[0].scatter(detector.keypoints[:, 1], detector.keypoints[:, 0], 2 ** detector.scales, facecolors='none', edgecolors='r') ax[0].set_title("Original Image") # Detect keypoints in the transformed image detector.detect(img_warp) # Display the transformed image with keypoints ax[1].imshow(img_warp, cmap=plt.cm.gray) ax[1].scatter(detector.keypoints[:, 1], detector.keypoints[:, 0], 2 ** detector.scales, facecolors='none', edgecolors='r') ax[1].set_title('Transformed Image') for a in ax: a.axis('off') plt.tight_layout() plt.show()
Output
