improve performance of equalize example

percentile can compute multiple ranks in one go which in the case of the
example halves the required time.
This commit is contained in:
Julian Taylor
2014-03-13 22:34:55 +01:00
parent 4992f8bc9b
commit d4cb154d17
2 changed files with 2 additions and 5 deletions
+1 -3
View File
@@ -63,9 +63,7 @@ def plot_img_and_hist(img, axes, bins=256):
# Load an example image
img = img_as_ubyte(data.moon())
# Contrast stretching
p2 = np.percentile(img, 2)
p98 = np.percentile(img, 98)
# Global equalize
img_rescale = exposure.equalize_hist(img)
# Equalization