diff --git a/skimage/exposure/tests/test_exposure.py b/skimage/exposure/tests/test_exposure.py index 2fc1f750..6471ff59 100644 --- a/skimage/exposure/tests/test_exposure.py +++ b/skimage/exposure/tests/test_exposure.py @@ -46,6 +46,8 @@ def check_cdf_slope(cdf): uint10_max = 2**10 - 1 +uint12_max = 2**12 - 1 +uint14_max = 2**14 - 1 uint16_max = 2**16 - 1 @@ -93,6 +95,18 @@ def test_rescale_named_out_range(): assert_close(out, [0, uint10_max]) +def test_rescale_uint12_limits(): + image = np.array([0, uint16_max], dtype=np.uint16) + out = exposure.rescale_intensity(image, out_range='uint12') + assert_close(out, [0, uint12_max]) + + +def test_rescale_uint14_limits(): + image = np.array([0, uint16_max], dtype=np.uint16) + out = exposure.rescale_intensity(image, out_range='uint14') + assert_close(out, [0, uint14_max]) + + # Test adaptive histogram equalization # ====================================