{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / util / dtype / img_as_bool

function

skimage.util.dtype:img_as_bool

source: /dev/scikit-image/src/skimage/util/dtype.py :581

Signature

def   img_as_bool ( image force_copy = False )

Summary

Convert an image to boolean format.

Parameters

image : ndarray

Input image.

force_copy : bool, optional

Force a copy of the data, irrespective of its current dtype.

Returns

out : ndarray of dtype bool

Output image.

Notes

The upper half of the input dtype's positive range is True, and the lower half is False. All negative values (if present) are False.

Aliases

  • skimage.util.img_as_bool