
- 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 - Numpy Images
NumPy (also known as "Numerical Python") is one of the most crucial fundamental packages in Python for numerical computing. The core data structure of NumPy is the ndarray (N-dimensional array), which is a homogeneous collection of elements of the same data type. These arrays can be of any dimension, such as 1D, 2D, or even higher-dimensional arrays. NumPy provides a vast collection of mathematical functions to operate on these N-dimensional arrays efficiently.
Images in scikit-image are represented as NumPy ndarrays (multidimensional arrays). The scikit-image library is built on top of NumPy and it uses the NumPy arrays to represent images. Hence, the scikit-image library can perform various image-processing tasks effectively.
Representing images as NumPy arrays
Representing images as NumPy arrays, provide a convenient and efficient way to store and manipulate image data.
Here, the dimensions of the NumPy array correspond to the image dimensions, such as height, width, and color channels. For grayscale images, the array is typically two-dimensional (height x width). For color images, the array is three-dimensional (height x width x 3), where the last dimension represents the Red, Green, and Blue color channels.
Example 1
The following example demonstrates how a color image can be represented as a NumPy array in scikit-image.
from skimage import io # Read an image as a grayscale image img_array = io.imread('Images/Dog.jpg') # Display image properties from the image array print('The following are the properties of the loaded image:') print("Data type of the image object:", type(img_array)) print("Image shape:", img_array.shape) print("Image data type:", img_array.dtype)
Input Image

Output
The following are the properties of the loaded image: Data type of the image object: <class 'numpy.ndarray'> Image shape: (479, 500, 3) Image data type: uint8
Example 2
Let's see the NumPy array representation of a grayscale image.
from skimage import io # Read an image as a grayscale image img_array = io.imread('Images/dog.jpg', as_gray=True) # Display image properties from the image array print('The following are the properties of the loaded image:') print("Data type of the image object:", type(img_array)) print("Image shape:", img_array.shape) print("Image data type:", img_array.dtype)
Output
The following are the properties of the loaded image: Data type of the image object: <class 'numpy.ndarray'> Image shape: (479, 500) Image data type: float64
Indexing and Slicing
NumPy's indexing and slicing feature can be used to access and manipulate image data. Croping images, selecting specific color channels, or applying operations to specific regions within the image can be possible by using NumPy's flexible indexing and slicing syntax.
Example
The following example demonstrates how the indexing and slicing syntax of NumPy can be used to modify an image in Scikit-image.
from skimage import io # Read an image as a grayscale image img_array = io.imread('Images/Tajmahal.jpg') # Get the value of the pixel at the 10th row and 20th column pixel_value = img_array[10, 20] print('The pixel at the 10th row and 20th column of the image array', pixel_value) # Set value 0 to the pixel at the 3rd row and 10th column img_array[3, 10] = 0 # Select a region in the image roi = img_array[100:200, 200:300] # Set the pixel values in the selected region to red (255, 0, 0) roi[:] = (255, 0, 0) # Display the modified image io.imshow(img_array) io.show()
Input Image

Output
Running the above code gives us the following result −
The pixel at the 10th row and 20th column of the image array [ 81 97 110]
In addition it generates the following image −
