Superpixels & segmentation

Image Processing in Python

Rebeca Gonzalez

Data Engineer

Segmentation

Image Processing in Python

Segmentation

Image Processing in Python

Image representation

Image Processing in Python

Superpixels

Image Processing in Python

Benefits of superpixels

  • More meaningful regions
  • Computational efficiency
Image Processing in Python

Segmentation

  • Supervised
  • Unsupervised

Image Processing in Python

Unsupervised segmentation

Simple Linear Iterative Clustering (SLIC)

Image Processing in Python

Unsupervised segmentation (SLIC)

# Import the modules
from skimage.segmentation import slic
from skimage.color import label2rgb

# Obtain the segments segments = slic(image)
# Put segments on top of original image to compare segmented_image = label2rgb(segments, image, kind='avg')
show_image(image) show_image(segmented_image, "Segmented image")
Image Processing in Python

Unsupervised segmentation (SLIC)

Image Processing in Python

More segments

# Import the modules
from skimage.segmentation import slic
from skimage.color import label2rgb

# Obtain the segmentation with 300 regions segments = slic(image, n_segments= 300) # Put segments on top of original image to compare segmented_image = label2rgb(segments, image, kind='avg')
show_image(segmented_image)
Image Processing in Python

More segments

Image Processing in Python

Let's practice!

Image Processing in Python

Preparing Video For Download...