mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-16 11:21:25 +08:00
STY: Rename highlight_boundaries to mark_boundaries
This commit is contained in:
@@ -64,7 +64,7 @@ import numpy as np
|
||||
|
||||
from skimage.data import lena
|
||||
from skimage.segmentation import felzenszwalb, slic, quickshift
|
||||
from skimage.segmentation import highlight_boundaries
|
||||
from skimage.segmentation import mark_boundaries
|
||||
from skimage.util import img_as_float
|
||||
|
||||
img = img_as_float(lena()[::2, ::2])
|
||||
@@ -80,11 +80,11 @@ fig, ax = plt.subplots(1, 3)
|
||||
fig.set_size_inches(8, 3, forward=True)
|
||||
plt.subplots_adjust(0.05, 0.05, 0.95, 0.95, 0.05, 0.05)
|
||||
|
||||
ax[0].imshow(highlight_boundaries(img, segments_fz))
|
||||
ax[0].imshow(mark_boundaries(img, segments_fz))
|
||||
ax[0].set_title("Felzenszwalbs's method")
|
||||
ax[1].imshow(highlight_boundaries(img, segments_slic))
|
||||
ax[1].imshow(mark_boundaries(img, segments_slic))
|
||||
ax[1].set_title("SLIC")
|
||||
ax[2].imshow(highlight_boundaries(img, segments_quick))
|
||||
ax[2].imshow(mark_boundaries(img, segments_quick))
|
||||
ax[2].set_title("Quickshift")
|
||||
for a in ax:
|
||||
a.set_xticks(())
|
||||
|
||||
@@ -2,6 +2,5 @@ from .random_walker_segmentation import random_walker
|
||||
from ._felzenszwalb import felzenszwalb
|
||||
from ._slic import slic
|
||||
from ._quickshift import quickshift
|
||||
from .boundaries import (find_boundaries, visualize_boundaries,
|
||||
highlight_boundaries)
|
||||
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
|
||||
from ._clear_border import clear_border
|
||||
|
||||
@@ -13,7 +13,7 @@ def find_boundaries(label_img):
|
||||
return boundaries
|
||||
|
||||
|
||||
def highlight_boundaries(image, label_img, color=(1, 1, 0), outline_color=None):
|
||||
def mark_boundaries(image, label_img, color=(1, 1, 0), outline_color=None):
|
||||
"""Return image with boundaries between labeled regions highlighted.
|
||||
|
||||
Parameters
|
||||
@@ -40,6 +40,6 @@ def highlight_boundaries(image, label_img, color=(1, 1, 0), outline_color=None):
|
||||
return image
|
||||
|
||||
|
||||
@deprecated('highlight_boundaries')
|
||||
@deprecated('mark_boundaries')
|
||||
def visualize_boundaries(*args, **kwargs):
|
||||
return highlight_boundaries(*args, **kwargs)
|
||||
return mark_boundaries(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user