DOC: Change more examples to use image_label2rgb

This commit is contained in:
Tony S Yu
2013-05-06 00:25:01 -05:00
parent 6360240c38
commit 29a29721c8
2 changed files with 7 additions and 2 deletions
@@ -160,8 +160,11 @@ individually.
"""
from skimage.color import image_label2rgb
segmentation = ndimage.binary_fill_holes(segmentation - 1)
labeled_coins, _ = ndimage.label(segmentation)
image_label_overlay = image_label2rgb(coins, labeled_coins)
plt.figure(figsize=(6, 3))
plt.subplot(121)
@@ -169,7 +172,7 @@ plt.imshow(coins, cmap=plt.cm.gray, interpolation='nearest')
plt.contour(segmentation, [0.5], linewidths=1.2, colors='y')
plt.axis('off')
plt.subplot(122)
plt.imshow(labeled_coins, cmap=plt.cm.spectral, interpolation='nearest')
plt.imshow(image_label_overlay, interpolation='nearest')
plt.axis('off')
plt.subplots_adjust(**margins)