im2bw — Convert image to binary
im2 = im2bw(im, thresh)
thresh in the range [0,1], regardless of the class of the input image.
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.)