Conversion to bool: threshold on half dtype max.

This commit is contained in:
Stefan van der Walt
2012-09-13 18:07:52 -07:00
parent 56b4ba67e6
commit 8494a18882
+1 -1
View File
@@ -155,7 +155,7 @@ def convert(image, dtype, force_copy=False, uniform=False):
if kind_in in "fi":
sign_loss()
prec_loss()
return image > dtype_in(0)
return image > dtype_in(dtype_range[dtype_in][1] / 2)
if kind_in == 'b':
# from binary image, to float and to integer