April 2020
Intermediate to advanced
438 pages
12h 2m
English
In this recipe, we will use a binary giraffe image to demonstrate how a few morphological operations can be applied to a binary image. Let's start by importing the required libraries:
%matplotlib inlinefrom skimage.io import imreadfrom skimage.color import rgb2grayfrom skimage.filters import threshold_otsufrom scipy.ndimage.morphology import binary_erosion, binary_dilation, binary_fill_holes from scipy.ndimage.morphology import morphological_gradient, distance_transform_edtfrom skimage import morphology as morphimport numpy as npimport matplotlib.pylab as plt
Read now
Unlock full access