Make images come alive with scikit-image

Image Processing in Python

Rebeca Gonzalez

Data Engineer

What is image processing?

Operations on images and videos to:

  • Enhance an image
  • Extract useful information
  • Analyze it and make decisions

Image of a group of friends where faces are detected

Image Processing in Python

What is image processing?

Operations to on images and videos to:

  • Enhance an image
  • Extract useful information
  • Analyze it and make decisions

Image that shows the original image of a man with a camera taking a photo, next to the thresholded result of that image and down below this two, the histogram of the thresholded image

Image Processing in Python

Applications

  • Medical image analysis
  • Artificial intelligence
  • Image restoration and enhancement
  • Geospatial computing
  • Surveillance
  • Robotic vision
  • Automotive safety
  • And many more...

Image that shows 6 image processing applications: Face detection, spatial image processing, medial image analysis, geospatial computing and automotive safety

Image Processing in Python

Purposes

  1. Visualization:
    • Objects that are not visible
  2. Image sharpening and restoration
    • A better image
  3. Image retrieval
    • Seek for the image of interest
  4. Measurement of pattern
    • Measures various objects
  5. Image Recognition
    • Distinguish objects in an image
Image Processing in Python

Intro to scikit-image

  • Easy to use
  • Makes use of Machine Learning
  • Out of the box complex algorithms

Logo of Scikit-image library

Image Processing in Python

What is an image?

A photo of a deer resting in the grass next to another image of a zoomed in part. Showing the pixels of the photo

Image Processing in Python

What is an image?

MAtriz of pixels intensities of grayscale image

Image Processing in Python

Images in scikit-image

from skimage import data

rocket_image = data.rocket()

Rocket

Image Processing in Python

RGB channels

Original image of a cat above 3 images showing the RGB colors

Image Processing in Python

Grayscaled images

Grayscale image next to intensities matrix

Image Processing in Python

RGB vs Grayscale

from skimage import color
grayscale = color.rgb2gray(original)

rgb = color.gray2rgb(grayscale)

Colores astronaut next to grayscaled astronaut

Image Processing in Python

Visualizing images in the course

Don't worry about Matplotlib!

def show_image(image, title='Image', cmap_type='gray'):
    plt.imshow(image, cmap=cmap_type)    
    plt.title(title)
    plt.axis('off')
    plt.show()
Image Processing in Python

Visualizing images in the course

from skimage import color
grayscale = color.rgb2gray(original)

show_image(grayscale, "Grayscale")

Astronaut

Image Processing in Python

Let's practice!

Image Processing in Python

Preparing Video For Download...