Main Content

Image Segmentation

Segment images

Image segmentation is the process of partitioning an image into parts or regions. This division into parts is often based on the characteristics of the pixels in the image. For example, one way to find regions in an image is to look for abrupt discontinuities in pixel values, which typically indicate edges. These edges can define regions. Other methods divide the image into regions based on color values or texture.

Apps

Color ThresholderThreshold color image
Image SegmenterSegment an image by refining regions
Volume SegmenterSegment 3-D grayscale or RGB volumetric images

Functions

expand all

graythreshGlobal image threshold using Otsu's method
multithresh Multilevel image thresholds using Otsu’s method
otsuthreshGlobal histogram threshold using Otsu's method
adaptthreshAdaptive image threshold using local first-order statistics
grayconnectedSelect contiguous image region with similar gray values using flood-fill technique
watershedWatershed transform
activecontourSegment image into foreground and background using active contours (snakes) region growing technique
lazysnappingSegment image into foreground and background using graph-based segmentation
grabcutSegment image into foreground and background using iterative graph-based segmentation
imseggeodesicSegment image into two or three regions using geodesic distance-based color segmentation
imsegfmmBinary image segmentation using fast marching method
gradientweightCalculate weights for image pixels based on image gradient
graydiffweightCalculate weights for image pixels based on grayscale intensity difference
imsegkmeansK-means clustering based image segmentation
imsegkmeans3K-means clustering based volume segmentation
superpixels2-D superpixel oversegmentation of images
superpixels33-D superpixel oversegmentation of 3-D image
imoverlayBurn binary mask into 2-D image
overlayOverlay label matrix regions on 2-D image
label2idxConvert label matrix to cell array of linear indices
boundarymaskFind region boundaries of segmentation
jaccardJaccard similarity coefficient for image segmentation
diceSørensen-Dice similarity coefficient for image segmentation
bfscoreContour matching score for image segmentation

Topics

Segmentation Using the Color Thresholder

Segment Image and Create Mask Using Color Thresholder App

This example shows how to segment an image and create a binary mask image using the Color Thresholder app.

Acquire Live Images in the Color Thresholder App

You can perform color thresholding on an image acquired from a live USB webcam.

Image Segmentation Using Point Clouds in the Color Thresholder App

This example shows how to segment an image using the point cloud control in the Color Thresholder app.

Segmentation Using Gabor Filters, Superpixels, and Other Techniques

Plot Land Classification with Color Features and Superpixels

This example shows how to perform land type classification based on color features using K-means clustering and superpixels.

Segment Lungs from 3-D Chest Scan

This example shows how to perform a 3-D segmentation using active contours (snakes).

Segmentation Using the Volume Segmenter

Create Binary Mask Using Volume Segmenter

This example shows how to segment a volume in the Volume Segmenter app.

Create Semantic Segmentation Using Volume Segmenter

This example shows how to create a semantic segmentation of a volume using the Volume Segmenter app.

Featured Examples