bundles / skimage latest / skimage / util / dtype / _convert
function
skimage.util.dtype:_convert
source: /dev/scikit-image/src/skimage/util/dtype.py :209
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.
Notes
Aliases
-
skimage.util.dtype._convert