Function File: isbw (img)
Function File: isbw (img, logic)

Return true if img is a black and white image.

A variable can be considered a black and white image if it is a non-sparse, real array of size MxNx1xK, and, depending on the value of logic:

"logical" (default)

img must be of class logical.

"non-logical"

all values in img are either 1 or 0.

Note: despite their suggestive names, the functions isbw, isgray, isind, and isrgb, are ambiguous since it is not always possible to distinguish between those image types. For example: an uint8 matrix can be both a grayscale and indexed image; a grayscale image may have values outside the range [0 1]. They are good to dismiss input as an invalid image type, but not for identification.

See also: im2bw, isgray, isind, islogical, isrgb.

Package: image