Converts an RGB image to an 8 bit monochrome image.
An array, the RGB image.
An array, an 8 bit monochrome image.
W1 contains an image of a random surface shaded with the colors of the spectrum ranging from red to blue. W2 converts the image into a 24 bit color image.
W3 contains the monochrome image displayed in the current colormap. The monochrome image contains values ranging from 0 to 255.
RGB2MONO converts the 24 bit image into 8 bit integer values ranging from 0 to 255. The resulting image is displayed using the current colormap.
For each RGB pixel, the converted pixel is determined as follows:
mono = 0.56*r + 0.33*g + 0.11*b
where r, g, b are the red, green and blue components of the original RGB image.