mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
ENH first draft of felzenszwalbs graph based image segmentation in Python
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from skimage.data import lena
|
||||
from skimage.segmentation import felzenszwalb_segmentation
|
||||
|
||||
img = lena()
|
||||
segments = felzenszwalb_segmentation(img, k=1000)
|
||||
plt.imshow(img)
|
||||
plt.figure()
|
||||
plt.imshow(segments)
|
||||
plt.show()
|
||||
print("num segments: %d" % len(np.unique(segments)))
|
||||
Reference in New Issue
Block a user