mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-25 13:30:51 +08:00
Rename km_segmentation to slic. They have a PAMI paper now so I guess we should use their name.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
"""
|
||||
print __doc__
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from skimage.data import lena
|
||||
from skimage.segmentation import slic, visualize_boundaries
|
||||
from skimage.util import img_as_float
|
||||
from skimage.color import rgb2lab
|
||||
|
||||
img = img_as_float(lena()).copy("C")
|
||||
segments = slic(rgb2lab(img), ratio=10.0, n_segments=1000)
|
||||
|
||||
print("number of segments: %d" % len(np.unique(segments)))
|
||||
|
||||
boundaries_mine = visualize_boundaries(img, segments)
|
||||
plt.imshow(boundaries_mine)
|
||||
plt.axis("off")
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user