bundles / skimage latest / skimage / util / dtype / convert
function
skimage.util.dtype:convert
source: /dev/scikit-image/src/skimage/util/dtype.py :399
Signature
def convert ( image , dtype , force_copy = False , uniform = False ) Summary
Convert an image to the requested data-type.
Extended Summary
Warnings are issued in case of precision loss, or when negative values are clipped during conversion to unsigned integer types (sign loss).
Floating point values are expected to be normalized and will be clipped to the range [0.0, 1.0] or [-1.0, 1.0] when converting to unsigned or signed integers respectively.
Numbers are not shifted to the negative side when converting from unsigned to signed integer types. Negative values will be clipped when converting to unsigned integers.
Parameters
image: ndarrayInput image.
dtype: dtypeTarget data-type.
force_copy: bool, optionalForce a copy of the data, irrespective of its current dtype.
uniform: bool, optionalUniformly quantize the floating point range to the integer range. By default (uniform=False) floating point values are scaled and rounded to the nearest integers, which minimizes back and forth conversion errors.
Warns
: FutureWarning:The use of this function is discouraged as its behavior may change dramatically in scikit-image 1.0. This function will be removed in scikit-image 1.0.
Notes
Aliases
-
skimage.util.dtype.convert