mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Tests pass and example works on build.
This commit is contained in:
@@ -64,7 +64,7 @@ img_rescale = exposure.rescale_intensity(img, in_range=(p2, p98))
|
||||
img_eq = exposure.equalize(img)
|
||||
|
||||
# Adaptive Equalization
|
||||
img_adapteq = exposure.adapthist(img)
|
||||
img_adapteq = exposure.adapthist(img, clip_limit=0.03)
|
||||
|
||||
|
||||
# Display results
|
||||
@@ -81,7 +81,7 @@ ax_img, ax_hist, ax_cdf = plot_img_and_hist(img_eq, axes[:, 2])
|
||||
ax_img.set_title('Histogram equalization')
|
||||
ax_cdf.set_ylabel('Fraction of total intensity')
|
||||
|
||||
ax_img, ax_hist, ax_cdf = plot_img_and_hist(img_eq, axes[:, 3])
|
||||
ax_img, ax_hist, ax_cdf = plot_img_and_hist(img_adapteq, axes[:, 3])
|
||||
ax_img.set_title('Adaptive equalization')
|
||||
ax_cdf.set_ylabel('Fraction of total intensity')
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from .exposure import histogram, equalize, cumulative_distribution
|
||||
from .exposure import histogram, equalize, cumulative_distribution, adapthist
|
||||
from .exposure import rescale_intensity
|
||||
|
||||
@@ -5,6 +5,7 @@ import skimage
|
||||
from skimage import data
|
||||
from skimage import exposure
|
||||
from skimage.color import rgb2gray
|
||||
from skimage.util.dtype import dtype_range
|
||||
|
||||
|
||||
# Test histogram equalization
|
||||
@@ -94,6 +95,7 @@ def test_adapthist_float():
|
||||
img = skimage.img_as_float(data.lena())
|
||||
adapted = exposure.adapthist(img, nx=10, ny=9, clip_limit=0.01,
|
||||
nbins=128, out_range='original')
|
||||
assert_almost_equal = np.testing.assert_almost_equal
|
||||
assert_almost_equal(adapted.min() , img.min())
|
||||
assert_almost_equal(adapted.min(), img.min())
|
||||
assert img.shape == adapted.shape
|
||||
|
||||
Reference in New Issue
Block a user