Rename km_segmentation to slic. They have a PAMI paper now so I guess we should use their name.

This commit is contained in:
Andreas Mueller
2012-08-03 11:57:02 +01:00
parent 026b6b1df0
commit cd1007a0bc
4 changed files with 10 additions and 10 deletions
+21
View File
@@ -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()