mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Fix rescale_intensity
This commit is contained in:
@@ -174,12 +174,11 @@ def rescale_intensity(image, in_range=None, out_range=None):
|
||||
|
||||
if out_range is None:
|
||||
omin, omax = dtype_range[dtype]
|
||||
if imin >= 0:
|
||||
omin = 0
|
||||
else:
|
||||
omin, omax = out_range
|
||||
|
||||
if imin >= 0:
|
||||
omin = 0
|
||||
|
||||
image = np.clip(image, imin, imax)
|
||||
|
||||
image = (image - imin) / float(imax - imin)
|
||||
|
||||
Reference in New Issue
Block a user