
- 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 − Lapalace Operator
Laplacian operator, often referred to as the Laplacian filter, is an image processing operator used for edge detection and enhancement. It is a second-order derivative filter, which identifies areas in the image where the intensity changes rapidly, which typically corresponds to edges or boundaries between objects.
The Laplacian operator is particularly effective in highlighting fine details and edges in an image, making it a valuable tool in computer vision, image processing, and feature extraction tasks.
The scikit-image (skimage) library provides a function called laplace() within its filter module for finding the edges of an image using the Laplacian operator.
Using the skimage.filters.laplace() function
The filters.laplace() function is used to find the edges of an image using the Laplace operator.
Syntax
Following is the syntax of this function −
skimage.filters.laplace(image, ksize=3, mask=None)
Parameters
The function accepts the following parameters −
- image (ndarray): This parameter represents the input image on which the te Laplace operator will be applied to find the edges.
- ksize (int, optional): Define the size of the discrete Laplacian operator. The operator size will be (ksize,) * image.ndim, where image.ndim represents the number of dimensions of the input image. The larger ksize values will lead to more extensive edge detection.
- mask (ndarray, optional): An optional mask can be provided to limit the application of the Laplace operator to a specific area within the image. Pixels surrounding masked regions are also masked to ensure that masked regions do not affect the result.
Return value
The function returns an ndarray representing the Laplace edge map.
Note: It is important to note that the Laplace operator is generated using the function skimage.restoration.uft.laplacian() and only the real part of the filter is kept.
Example
The following example demonstrates how to apply the Laplace filter to an image for detecting edges using the skimage.filters.laplace() function −
import matplotlib.pyplot as plt from skimage import io, color, filters # Load the input image and convert it to grayscale image = color.rgb2gray(io.imread('Images/lines_3.jpg')) # Apply the Laplace filter for edge detection edge_map = filters.laplace(image, ksize= 4) # Plot the original image and the Laplace edge map 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 Laplace Edge Map ax[1].imshow(edge_map, cmap='gray') ax[1].set_title('Laplace Edge Map') ax[1].axis('off') plt.tight_layout() plt.show()
Output
Example
The following example demonstrates edge detection using the Laplace filter with and without a mask on a color image using the skimage.filters.laplace() function −
import numpy as np from skimage import io, color, filters import matplotlib.pyplot as plt # Load the input image image = io.imread('Images/group chat.jpg') # Define the coordinates and dimensions of the square region x_0 = 200 y_0 = 20 width = 250 height = 250 # Create a mask with the same dimensions as the image mask = np.zeros_like(image, dtype=np.bool) # Create the square mask mask[y_0:(y_0 + height), x_0:(x_0 + width)] = True # Apply the Laplace filter without a mask on a color image edge_map_no_mask = filters.laplace(image) # Apply the Laplace filter with the mask edge_map_with_mask = filters.laplace(image, ksize=3, mask=mask) # Plot the original image and the results with and without the mask fig, axes = plt.subplots(1, 3, figsize=(15, 5)) ax = axes.ravel() # Display the Original Image ax[0].imshow(image) ax[0].set_title('Original Image') ax[0].axis('off') # Display the Laplace Edge Map without the Mask (Color Image) ax[1].imshow(edge_map_no_mask) ax[1].set_title('Laplace filter result without Mask ') ax[1].axis('off') # Display the Laplace Edge Map with the Mask ax[2].imshow(edge_map_with_mask) ax[2].set_title('Laplace filter result with Mask') ax[2].axis('off') plt.tight_layout() plt.show()