mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
ENH: Check that float images are between 0 and 1.
This commit is contained in:
@@ -67,6 +67,13 @@ def test_unsupported_dtype():
|
||||
assert_raises(ValueError, img_as_int, x)
|
||||
|
||||
|
||||
def test_float_out_of_range():
|
||||
too_high = np.array([2], dtype=np.float32)
|
||||
assert_raises(ValueError, img_as_int, too_high)
|
||||
too_low = np.array([-1], dtype=np.float32)
|
||||
assert_raises(ValueError, img_as_int, too_low)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
np.testing.run_module_suite()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user