that can be used to convert an
intensity to a binary image with im2bw. level is a normalized
intensity value that lies in the range [0, 1].
The graythresh function uses Otsu's method, which chooses the threshold to minimize the intraclass variance of the black and white pixels.