mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-09 12:30:07 +08:00
ENH: Check that float images are between 0 and 1.
This commit is contained in:
@@ -63,6 +63,8 @@ def _convert(image, dtype):
|
||||
"%s to %s" % (dtypeobj_in, dtypeobj))
|
||||
|
||||
if kind_in == 'f':
|
||||
if np.min(image) < 0 or np.max(image) > 1:
|
||||
raise ValueError("Images of type float must be between 0 and 1")
|
||||
if kind == 'f':
|
||||
# floating point -> floating point
|
||||
if itemsize_in > itemsize:
|
||||
|
||||
Reference in New Issue
Block a user