
- 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 − Butterworth Filter
The Butterworth filter is a signal processing filter implemented in the frequency domain, designed to have a frequency response with minimal passband or stopband ripple. Named after Stephen Butterworth, who introduced it in 1930, this filter aims to achieve a maximally flat magnitude response in the passband, making it ideal for applications where a flat frequency response is desired. It operates in the Fourier domain, allowing it to enhance specific frequency components in an image.
The scikit image library provides the butterworth()function to perform the butterworth filtering operations on the images.
Using the skimage.filters.butterworth() filter
The filters.butterworth() function is used to apply a Butterworth filter to an input image, enhancing either high or low-frequency features in the image. And it is defined in the Fourier domain.
Syntax
Following is the syntax of this function −
skimage.filters.butterworth(image, cutoff_frequency_ratio=0.005, high_pass=True, order=2.0, channel_axis=None, *, squared_butterworth=True, npad=0)
Parameters
The function accepts the following parameters −
- Image ((M[, N[, â¦, P]][, C]) ndarray): This parameter is the input image on which the Butterworth filter will be applied.
- Cutoff_frequency_ratio (float, optional): This float parameter determines the position of the cut-off frequency relative to the shape of the FFT of the image. It should be in the range [0, 0.5].
- High_pass (bool, optional): This parameter specifies whether to perform a high-pass filter (True) or a low-pass filter (False).
- Order (float, optional): The order of the filter, which affects the slope of the filter's response near the cut-off frequency. Higher values result in steeper slopes in the frequency space.
- Channel_axis (int, optional): If the input image has multiple channels (e.g., color images), you can specify the index of the channel axis using this parameter. If set to None, all axes are assumed to be spatial dimensions.
- Squared_butterworth (bool, optional): When set to True, the square of a Butterworth filter is used.
- Npad (int, optional): This parameter determines how much padding should be added to each edge of the image using numpy's pad function with the mode='edge' extension.
Return value
The function returns the Butterworth-filtered image as an ndarray.
Note: Achieving A band-pass filter can be possible by combining a high-pass and low-pass filter of the Butterworth filter, to reduce boundary artifacts, you can increase npad parameter.
Example
The following example demonstrates how to use the filters.butterworth() function to apply both the low-pass and high-pass Butterworth filters to a grayscale image −
import numpy as np import matplotlib.pyplot as plt from skimage import io from skimage.filters import butterworth # Load a color image input_image = io.imread('Images/group chat.jpg', as_gray=True) # Apply a low-pass (squared) Butterworth filtering (order=3.0, npad=0) low_pass_filtered_image = butterworth(input_image, cutoff_frequency_ratio=0.15, high_pass=False, order=3) # Apply a high-pass (squared) Butterworth filtering (order=3.0, npad=0) high_pass_filtered_image = butterworth(input_image, cutoff_frequency_ratio=0.01, high_pass=True, order=3) # Plot the original, low-pass, and high-pass filtered grayscale images fig, axes = plt.subplots(1, 3, figsize=(15, 5)) ax = axes.ravel() # Original Grayscale Image ax[0].imshow(input_image, cmap='gray') ax[0].set_title('Original Grayscale Image') ax[0].axis('off') # Low-Pass Filtered Grayscale Image ax[1].imshow(low_pass_filtered_image, cmap='gray') ax[1].set_title('Low-Pass Filtered Grayscale Image') ax[1].axis('off') # High-Pass Filtered Grayscale Image ax[2].imshow(high_pass_filtered_image, cmap='gray') ax[2].set_title('High-Pass Filtered Grayscale Image') ax[2].axis('off') plt.tight_layout() plt.show()
Output
Example
The following example demonstrates how to use the filters.butterworth() function to apply both the low-pass and high-pass Butterworth filters to a color image −
import numpy as np import matplotlib.pyplot as plt from skimage import io from skimage.filters import butterworth # Load a color image input_color_image = io.imread('Images/Yellow Car.jpg') # Apply a low-pass (squared) Butterworth filter (order=3.0, npad=0) to a color image low_pass_filtered_image = butterworth(input_color_image, cutoff_frequency_ratio=0.05, order=3, high_pass=False, channel_axis=-1) # Apply a high-pass (squared) Butterworth filter (order=3.0, npad=0) to a color image high_pass_filtered_image = butterworth(input_color_image, cutoff_frequency_ratio=0.02, order=3, high_pass=True, channel_axis=-1) # Plot the original, low-pass, and high-pass filtered color images fig, axes = plt.subplots(1, 3, figsize=(15, 5)) ax = axes.ravel() # Display the Original Color Image ax[0].imshow(input_color_image) ax[0].axis('off') ax[0].set_title('Original Color Image') # Display the Low-Pass Filtered Color Image ax[1].imshow(low_pass_filtered_image) ax[1].axis('off') ax[1].set_title('Low-Pass Filtered Color Image') # Display the High-Pass Filtered Color Image ax[2].imshow(high_pass_filtered_image) ax[2].axis('off') ax[2].set_title('High-Pass Filtered Color Image') plt.tight_layout() plt.show()