ValueError: Images of type float must be between -1 and 1.

Christopher spagodo at gmail.com
Mon Feb 8 20:38:14 EST 2016


Hi, I am having a problem trying to create an image object from an array. 
The problem is the array extends beyond -1 and 1. The pixel values are raw 
32bit float values from a detector.


array.dtype
float32


summary(array)
Mean:    0.00656827

Min:    -6.1125
Median:    1.09516e-08
Max:    3.69815



image = skimage.img_as_float(array)



  File 
"/home/user/anaconda2/lib/python2.7/site-packages/skimage/util/dtype.py", 
line 291, in img_as_float
    return convert(image, np.float64, force_copy)
  File 
"/home/user/anaconda2/lib/python2.7/site-packages/skimage/util/dtype.py", 
line 195, in convert
    raise ValueError("Images of type float must be between -1 and 1.")
ValueError: Images of type float must be between -1 and 1


I am using version 0.11.3 via anaconda on fedora 23


Sometimes I can get img_as_float to work if I use astype on the array 
first, but then it doesn't seem to change the values, and then 
skimage.io.Image() will fail with a similar error

Thanks in advance for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160208/a1d0898c/attachment.html>


More information about the scikit-image mailing list