
- 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
Exploring Region Properties With Pandas
Exploring region properties with pandas, refers to the process of using the pandas library to analyze and manipulate region-related data. In the context of image processing region properties refer to characteristics or measurements associated with specific areas within an image, 2D or 3D, such as blobs or objects.
This tutorial provides two examples below that demonstrates the process of determining the size of labeled regions within a series of 10 images. We begin with 2D images and then transition to 3D images. These blob-like regions are synthetically generated. As the volume fraction, representing the proportion of pixels or voxels occupied by the blobs, increases, the number of these blobs (regions) decreases, leading to the potential for individual regions to get larger in size. The area (or volume) measurements are stored in a format compatible with pandas, facilitating easy data analysis and visualization.
In addition to the area, many other region properties are also available for further analysis.
2D images
The following example demonstrates the process of generating synthetic 2D binary blob images, calculating region properties, and storing them in a pandas DataFrame. It is then used to visualize the relationship between the volume fraction and the size of regions through a scatter plot.
Example
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from skimage import data, measure # Define the range of fractions fractions = np.linspace(0.05, 0.5, 10) # Generate binary blob images with different volume fractions images = [data.binary_blobs(volume_fraction=f) for f in fractions] # Label the generated binary images labeled_images = [measure.label(image) for image in images] # Define the properties of interest properties = ['label', 'area'] # Measure region properties for each labeled image tables = [measure.regionprops_table(image, properties=properties) for image in labeled_images] # Convert the tables to DataFrames tables = [pd.DataFrame(table) for table in tables] # Add 'volume fraction' column to each DataFrame for fraction, table in zip(fractions, tables): table['volume fraction'] = fraction # Concatenate the DataFrames into a single DataFrame areas = pd.concat(tables, axis=0) # Create a custom grid of subplots grid = plt.GridSpec(2, 2) ax1 = plt.subplot(grid[0, 0]) ax2 = plt.subplot(grid[0, 1]) ax = plt.subplot(grid[1, :]) # Show the image with the lowest volume fraction ax1.imshow(images[0], cmap='gray_r') ax1.set_axis_off() ax1.set_title(f'fraction {fractions[0]}') # Show the image with the highest volume fraction ax2.imshow(images[-1], cmap='gray_r') ax2.set_axis_off() ax2.set_title(f'fraction {fractions[-1]}') # Plot area vs volume fraction sns.stripplot(x='volume fraction', y='area', data=areas, jitter=True, ax=ax) # Fix floating point rendering ax.set_xticklabels([f'{frac:.2f}' for frac in fractions]) plt.show()
Output

3D images
when performing the same analysis, a significantly more pronounced behavior is observed. As the volume fraction surpasses approximately 0.25, the blobs merge into a single massive entity. This corresponds to the percolation threshold observed in the fields of statistical physics and graph theory.
Example
Here is the example of exploring the region properties of 3D binary blob images using Pandas.
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from skimage import data, measure # Define the range of volume fractions fractions = np.linspace(0.05, 0.5, 10) # Generate 3D binary blob images with specified volume fractions images = [data.binary_blobs(length=128, n_dim=3, volume_fraction=f) for f in fractions] # Label the 3D binary images labeled_images = [measure.label(image) for image in images] # Define the properties of interest properties = ['label', 'area'] # Compute region properties for labeled 3D images tables = [measure.regionprops_table(image, properties=properties) for image in labeled_images] # Convert the result into Pandas DataFrames tables = [pd.DataFrame(table) for table in tables] # Assign volume fractions to each DataFrame for fraction, table in zip(fractions, tables): table['volume fraction'] = fraction # Concatenate all DataFrames into one blob_volumes = pd.concat(tables, axis=0) # Create a plot fig, ax = plt.subplots() sns.stripplot(x='volume fraction', y='area', data=blob_volumes, jitter=True, ax=ax) ax.set_ylabel('Blob Size (3D)') # Ensure proper rendering of x-axis labels ax.set_xticklabels([f'{frac:.2f}' for frac in fractions]) plt.show()
Output
