Hi all,--
I'm currently trying to use a median filter on my data, an am getting an error that I can't seem to debug.I'm taking the difference of two images (both numpy.float64), scaling them between -1 and 1, and trying to apply a median filter. My image satisfies the conditions for being between -1 and 1 when I do the following test:print diff.min()/dmax < -1.0 -> returns False (LHS evals to -1.0)print diff.max()/dmax > 1.0 -> returns False (LHS evals to 0.663919388648)The statement causing the error:filtered = fltr.median(diff/dmax, selem)where diff is my difference, and dmax is my scaling adjustment, selem is a disk of radius 2This gives me the following traceback.Traceback (most recent call last):File "/home/clustering.py", line 138, in image_ratiofiltered = fltr.median(diff/dmax/2.+0.5, selem, mask=m.astype(np.bool))File "/usr/local/lib/python2.7/dist-packages/skimage/filter/rank/generic.py", line 369, in medianout=out, mask=mask, shift_x=shift_x, shift_y=shift_y)File "/usr/local/lib/python2.7/dist-packages/skimage/filter/rank/generic.py", line 71, in _applyout_dtype)File "/usr/local/lib/python2.7/dist-packages/skimage/filter/rank/generic.py", line 34, in _handle_inputimage = img_as_ubyte(image)File "/usr/local/lib/python2.7/dist-packages/skimage/util/dtype.py", line 358, in img_as_ubytereturn convert(image, np.uint8, force_copy)File "/usr/local/lib/python2.7/dist-packages/skimage/util/dtype.py", line 191, in convertraise ValueError("Images of type float must be between -1 and 1.")ValueError: Images of type float must be between -1 and 1.Has anyone else experienced this problem before? I tried searching in the groups, but couldn't find anything relevant.Any help would be greatly appreciated!
Thanks,Aman
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.