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
+3 -1
View File
@@ -21,6 +21,7 @@ from skimage.filter import threshold_otsu
from skimage.segmentation import clear_border
from skimage.morphology import label, closing, square
from skimage.measure import regionprops
from skimage.color import image_label2rgb
image = data.coins()[50:-50, 50:-50]
@@ -37,9 +38,10 @@ clear_border(cleared)
label_image = label(cleared)
borders = np.logical_xor(bw, cleared)
label_image[borders] = -1
image_label_overlay = image_label2rgb(image, label_image)
fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(6, 6))
ax.imshow(label_image, cmap='jet')
ax.imshow(image_label_overlay)
for region in regionprops(label_image, ['Area', 'BoundingBox']):