Examples#

A gallery of examples and that showcase how scikit-image can be used. Some examples demonstrate the use of the API in general and some demonstrate specific applications in tutorial form.

Hint

Check out our User guide for a narrative introduction to key library conventions and basic image manipulation.

Data#

Image

Datasets with 3 or more spatial dimensions

Datasets with 3 or more spatial dimensions
Image

Scientific images

Scientific images
Image

General-purpose images

General-purpose images
Image

Specific images

Specific images

Operations on NumPy arrays#

Image

Using simple NumPy operations for manipulating images

Using simple NumPy operations for manipulating images
Image

Generate footprints (structuring elements)

Generate footprints (structuring elements)
Image

Block views on images/arrays

Block views on images/arrays
Image

Decompose flat footprints (structuring elements)

Decompose flat footprints (structuring elements)

Manipulating exposure and color channels#

Image

RGB to grayscale

RGB to grayscale
Image

RGB to HSV

RGB to HSV
Image

Histogram matching

Histogram matching
Image

Adapting gray-scale filters to RGB images

Adapting gray-scale filters to RGB images
Image

Filtering regional maxima

Filtering regional maxima
Image

Separate colors in immunohistochemical staining

Separate colors in immunohistochemical staining
Image

Gamma and log contrast adjustment

Gamma and log contrast adjustment
Image

Histogram Equalization

Histogram Equalization
Image

Tinting gray-scale images

Tinting gray-scale images
Image

Local Histogram Equalization

Local Histogram Equalization
Image

3D adaptive histogram equalization

3D adaptive histogram equalization

Edges and lines#

Image

Contour finding

Contour finding
Image

Convex Hull

Convex Hull
Image

Canny edge detector

Canny edge detector
Image

Marching Cubes

Marching Cubes
Image

Active Contour Model

Active Contour Model
Image

Ridge operators

Ridge operators
Image

Shapes

Shapes
Image

Random Shapes

Random Shapes
Image

Approximate and subdivide polygons

Approximate and subdivide polygons
Image

Straight line Hough transform

Straight line Hough transform
Image

Circular and Elliptical Hough Transforms

Circular and Elliptical Hough Transforms
Image

Skeletonize

Skeletonize
Image

Edge operators

Edge operators

Geometrical transformations and registration#

Image

Swirl

Swirl
Image

Interpolation: Edge Modes

Interpolation: Edge Modes
Image

Rescale, resize, and downscale

Rescale, resize, and downscale
Image

Build image pyramids

Build image pyramids
Image

Piecewise Affine Transformation

Piecewise Affine Transformation
Image

Structural similarity index

Structural similarity index
Image

Using geometric transformations

Using geometric transformations
Image

Types of homographies

Types of homographies
Image

Use thin-plate splines for image warping

Use thin-plate splines for image warping
Image

Fundamental matrix estimation

Fundamental matrix estimation
Image

Robust line model estimation using RANSAC

Robust line model estimation using RANSAC
Image

Radon transform

Radon transform
Image

Robust matching using RANSAC

Robust matching using RANSAC

Image registration#

Image

Image Registration

Image Registration
Image

Masked Normalized Cross-Correlation

Masked Normalized Cross-Correlation
Image

Registration using optical flow

Registration using optical flow
Image

Assemble images with simple image stitching

Assemble images with simple image stitching
Image

Using Polar and Log-Polar Transformations for Registration

Using Polar and Log-Polar Transformations for Registration

Filtering and restoration#

Image

Removing small objects in grayscale images with a top hat filter

Removing small objects in grayscale images with a top hat filter
Image

Hysteresis thresholding

Hysteresis thresholding
Image

Image Deconvolution

Image Deconvolution
Image

Using window functions with images

Using window functions with images
Image

Mean filters

Mean filters
Image

Unsharp masking

Unsharp masking
Image

Estimate strength of blur

Estimate strength of blur
Image

Entropy

Entropy
Image

Image Deconvolution

Image Deconvolution
Image

Calibrating Denoisers Using J-Invariance

Calibrating Denoisers Using J-Invariance
Image

Fill in defects with inpainting

Fill in defects with inpainting
Image

Band-pass filtering by Difference of Gaussians

Band-pass filtering by Difference of Gaussians
Image

Denoising a picture

Denoising a picture
Image

Shift-invariant wavelet denoising

Shift-invariant wavelet denoising
Image

Phase Unwrapping

Phase Unwrapping
Image

Non-local means denoising for preserving textures

Non-local means denoising for preserving textures
Image

Attribute operators

Attribute operators
Image

Wavelet denoising

Wavelet denoising
Image

Butterworth Filters

Butterworth Filters
Image

Full tutorial on calibrating Denoisers Using J-Invariance

Full tutorial on calibrating Denoisers Using J-Invariance

Detection of features and objects#

Image

Dense DAISY feature description

Dense DAISY feature description
Image

Histogram of Oriented Gradients

Histogram of Oriented Gradients
Image

Haar-like feature descriptor

Haar-like feature descriptor
Image

Template Matching

Template Matching
Image

Corner detection

Corner detection
Image

Multi-Block Local Binary Pattern for texture classification

Multi-Block Local Binary Pattern for texture classification
Image

CENSURE feature detector

CENSURE feature detector
Image

Filling holes and finding peaks

Filling holes and finding peaks
Image

Removing objects

Removing objects
Image

Blob Detection

Blob Detection
Image

ORB feature detector and binary descriptor

ORB feature detector and binary descriptor
Image

Gabors / Primary Visual Cortex “Simple Cells” from an Image

Gabors / Primary Visual Cortex "Simple Cells" from an Image
Image

Fisher vector feature encoding

Fisher vector feature encoding
Image

BRIEF binary descriptor

BRIEF binary descriptor
Image

SIFT feature detector and descriptor extractor

SIFT feature detector and descriptor extractor
Image

GLCM Texture Features

GLCM Texture Features
Image

Shape Index

Shape Index
Image

Sliding window histogram

Sliding window histogram
Image

Gabor filter banks for texture classification

Gabor filter banks for texture classification
Image

Local Binary Pattern for texture classification

Local Binary Pattern for texture classification

Segmentation of objects#

Image

Region Boundary based Region adjacency graphs (RAGs)

Region Boundary based Region adjacency graphs (RAGs)
Image

Region adjacency graph (RAG) Thresholding

Region adjacency graph (RAG) Thresholding
Image

Normalized Cut

Normalized Cut
Image

Find Regular Segments Using Compact Watershed

Find Regular Segments Using Compact Watershed
Image

Thresholding

Thresholding
Image

Drawing Region Adjacency Graphs (RAGs)

Drawing Region Adjacency Graphs (RAGs)
Image

Chan-Vese Segmentation

Chan-Vese Segmentation
Image

Finding local maxima

Finding local maxima
Image

Multi-Otsu Thresholding

Multi-Otsu Thresholding
Image

Random walker segmentation

Random walker segmentation
Image

Apply maskSLIC vs SLIC

Apply maskSLIC vs SLIC
Image

Niblack and Sauvola Thresholding

Niblack and Sauvola Thresholding
Image

Expand segmentation labels without overlap

Expand segmentation labels without overlap
Image

Watershed segmentation

Watershed segmentation
Image

Markers for watershed transform

Markers for watershed transform
Image

Label image regions

Label image regions
Image

Comparison of segmentation and superpixel algorithms

Comparison of segmentation and superpixel algorithms
Image

Find the intersection of two segmentations

Find the intersection of two segmentations
Image

Region Adjacency Graphs (RAGs)

Region Adjacency Graphs (RAGs)
Image

Region adjacency graph (RAG) Merging

Region adjacency graph (RAG) Merging
Image

Measure perimeters with different estimators

Measure perimeters with different estimators
Image

Extrema

Extrema
Image

Explore and visualize region properties with pandas

Explore and visualize region properties with pandas
Image

Hausdorff Distance

Hausdorff Distance
Image

Hierarchical Merging of Region Boundary RAGs

Hierarchical Merging of Region Boundary RAGs
Image

Morphological Snakes

Morphological Snakes
Image

Trainable segmentation using local features and random forests

Trainable segmentation using local features and random forests
Image

Measure region properties

Measure region properties
Image

Evaluating segmentation metrics

Evaluating segmentation metrics
Image

Flood Fill

Flood Fill
Image

Use rolling-ball algorithm for estimating background intensity

Use rolling-ball algorithm for estimating background intensity
Image

Euler number

Euler number

Longer examples and demonstrations#

Image

Render text onto an image

Render text onto an image
Image

Face detection using a cascade classifier

Face detection using a cascade classifier
Image

Interact with 3D images (of kidney tissue)

Interact with 3D images (of kidney tissue)
Image

Use pixel graphs to find an object’s geodesic center

Use pixel graphs to find an object's geodesic center
Image

Visual image comparison

Visual image comparison
Image

Morphological Filtering

Morphological Filtering
Image

Comparing edge-based and region-based segmentation

Comparing edge-based and region-based segmentation
Image

Estimate anisotropy in a 3D microscopy image

Estimate anisotropy in a 3D microscopy image
Image

Colocalization metrics

Colocalization metrics
Image

Segment human cells (in mitosis)

Segment human cells (in mitosis)
Image

Thresholding

Thresholding
Image

Restore spotted cornea image with inpainting

Restore spotted cornea image with inpainting
Image

Track solidification of a metallic alloy

Track solidification of a metallic alloy
Image

Face classification using Haar-like feature descriptor

Face classification using Haar-like feature descriptor
Image

Measure fluorescence intensity at the nuclear envelope

Measure fluorescence intensity at the nuclear envelope
Image

Explore 3D images (of cells)

Explore 3D images (of cells)
Image

Rank filters

Rank filters

Examples for developers#

In this folder, we have examples for advanced topics, including detailed explanations of the inner workings of certain algorithms.

These examples require some basic knowledge of image processing. They are targeted at existing or would-be scikit-image developers wishing to develop their knowledge of image processing algorithms.

Image

Li thresholding

Li thresholding
Image

Max-tree

Max-tree

Gallery generated by Sphinx-Gallery