mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user