ENH: make quickshift more tolerant to input type, just convert to float. Also keep track of random seed for reproducable tests.

Finally, do a unique on the output and add testing.
This commit is contained in:
Andreas Mueller
2012-06-18 00:37:49 +02:00
parent 4d10749a0e
commit ce26467ad4
3 changed files with 70 additions and 9 deletions
-1
View File
@@ -31,7 +31,6 @@ from skimage.util import img_as_float
img = img_as_float(lena())[::2, ::2, :].copy("C")
segments = quickshift(img, sigma=5, tau=20)
segments = np.unique(segments, return_inverse=True)[1].reshape(img.shape[:2])
print("number of segments: %d" % len(np.unique(segments)))