
- 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 − Unsharp Mask Filter
Unsharp masking is a widely used image sharpening technique in image processing. It is a linear image operation and is known for its numerical stability, making it a preferred choice over deconvolution, which is often an ill-posed problem.
The fundamental concept behind unsharp masking is to enhance image sharpness by isolating the fine details present in the original image but not in a blurred version of it.
The formula for unsharp masking is often expressed as follows −
enhanced image = original + amount * (original - blurred)
To avoid issues like color bleeding while applying this technique to multi-channel images, it's advisable to process only the brightness, lightness, or intensity channel in a suitable color space, such as HSV, HSL, YUV, or YCbCr. This approach can yield more visually pleasing results while preserving color information.
The scikit-image (skimage) library provides a function called unsharp_mask() within its filter module for applying the Unsharp masking filter to images.
Using the skimage.filters.unsharp_mask() function
The unsharp_mask() function is used to apply an unsharp masking filter to an image. The technique finds the fine details by subtracting the blurred image from the original. These details are then adjusted and added back to the original image.
Syntax
Following is the syntax of this function −
skimage.filters.unsharp_mask(image, radius=1.0, amount=1.0, preserve_range=False, *, channel_axis=None)
Parameters
Here's an explanation of the parameters −
- image ([P, â¦, ]M[, N][, C] ndarray): This parameter represents the input image to which the unsharp masking filter will be applied. The image can have one or multiple dimensions, including color channels.
- radius (scalar or sequence of scalars, optional): It determines the extent of blurring applied to the image. If a scalar value is provided, it is used for all dimensions. If a sequence of values is provided, there must be one radius value for each dimension, except for the last dimension (for multichannel images). A radius of 0 means no blurring, and negative values are not allowed.
- amount (scalar, optional): This parameter controls the amplification factor for enhancing image details. It can be a positive, negative, or zero value. Typically, it is a small positive number (e.g., 1.0) for enhancing details.
- preserve_range (bool, optional): If set to True, it keeps the original range of values in the output image. If set to False, the input image is converted according to the conventions of img_as_float.
- channel_axis (int or None, optional): This parameter is used to indicate which axis of the input array corresponds to color channels when dealing with multichannel images. If set to None, it assumes that the image is grayscale (single-channel). This parameter was introduced in scikit-image version 0.19.
Return value
The function returns an ndarray of float values, which represents the image with the unsharp masking filter applied.
Example
Here's an example of how to apply the Unsharp masking to an image using the unsharp_mask() function −
import numpy as np import matplotlib.pyplot as plt from skimage.filters import unsharp_mask # Create an example input array array = np.ones(shape=(5, 5), dtype=np.uint8) * 100 array[2, 2] = 120 # Apply unsharp_mask function result = unsharp_mask(array, radius=0.5, amount=2, preserve_range=True) # Display the input and output images fig, axes = plt.subplots(1, 2, figsize=(10, 5)) ax = axes.ravel() ax[0].imshow(array, cmap='gray') ax[0].set_title('Input Image') ax[0].axis('off') ax[1].imshow(result, cmap='gray') ax[1].set_title('Output after Unsharp Masking') ax[1].axis('off') plt.tight_layout() plt.show()
Output
Example

Example
The following example demonstrates the application of the unsharp masking filter to a color image using different values for the radius and amount parameters −
import matplotlib.pyplot as plt from skimage import io from skimage.filters import unsharp_mask # Load an image image = io.imread('Images/group chat.jpg') # Apply unsharp masking with different parameters result_1 = unsharp_mask(image, radius=1, amount=1, channel_axis=1) result_2 = unsharp_mask(image, radius=5, amount=2, channel_axis=1) result_3 = unsharp_mask(image, radius=20, amount=1, channel_axis=1) # Create a subplot grid for displaying images fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(10, 10)) ax = axes.ravel() # Display the original image and enhanced images with titles ax[0].imshow(image, cmap=plt.cm.gray) ax[0].set_title('Original image') ax[0].axis('off') ax[1].imshow(result_1, cmap=plt.cm.gray) ax[1].set_title('Enhanced image, radius=1, amount=1.0') ax[1].axis('off') ax[2].imshow(result_2, cmap=plt.cm.gray) ax[2].set_title('Enhanced image, radius=5, amount=2.0') ax[2].axis('off') ax[3].imshow(result_3, cmap=plt.cm.gray) ax[3].set_title('Enhanced image, radius=20, amount=1.0') ax[3].axis('off') fig.tight_layout() plt.show()