<< hsv2rgb2 Image Types and Color Space Conversions im2double >>

IPCV >> Image Types and Color Space Conversions > im2bw

im2bw

Convert image to binary

Syntax

im2 = im2bw(im, thresh)

Parameters

im :

An matrix/image, which can be ANY image supported by IPCV.

thresh :

Threshold value. You specify thresh in the range [0,1], regardless of the class of the input image.

im2 :

Boolean matrix.

Description

im2bw convert intensity or RGB images to binary images. The output is a boolean matrix, which has value of %T for all pixels in the input image with luminance grater than thresh and %F for all the other pixels. (You specify thresh in the range [0,1], regardless of the type of the input image.)

Examples

S = imread(fullpath(getIPCVpath() + "/images/balloons.png"));
S2 = rgb2gray(S);
Sbin = im2bw(S2,0.5);
imshow(Sbin);

See also

Authors


Report an issue
<< hsv2rgb2 Image Types and Color Space Conversions im2double >>