IMG = imread('cameraman.tif');
In other words, what you are passing to rgb2gray() is not an RGB image.
If you want to save a step in testing whether an input is already grayscale or not, you can substitute im2gray() for rgb2gray(): im2gray() will return arrays unchanged if they are already grayscale.
Note: binarized images are usually datatype logical() and already 2D. If you had a particular reason to convert them to grayscale then use im2double() or im2uint8()