Image Segmentation

Image Segmentation

Image segmentation is the task of labeling the pixels of objects of interest in an image.

In this tutorial, we will see how to segment objects from a background. We use the coins image from skimage.data. This image shows several coins outlined against a darker background. The segmentation of the coins cannot be done directly from the histogram of grey values, because the background shares enough grey levels with the coins that a thresholding segmentation is not sufficient.

../_images/plot_coins_segmentation_11.png

>>> import numpy as np
>>> from skimage import data
>>> coins = data.coins()
>>> histo = np.histogram(coins, bins=np.arange(0, 256))

Simply thresholding the image leads either to missing significant parts of the coins, or to merging parts of the background with the coins. This is due to the inhomogeneous lighting of the image.

../_images/plot_coins_segmentation_21.png

A first idea is to take advantage of the local contrast, that is, to use the gradients rather than the grey values.

doc_scikit_image
2017-01-12 17:21:23
Comments
Leave a Comment

Please login to continue.