Convert RGB image or colormap to grayscale
Read and display an RGB image, and then convert it to grayscale.
Read the sample file, peppers.png, and display the RGB image.
peppers.png
RGB = imread('peppers.png'); imshow(RGB);
the result
Convert the RGB image to a grayscale image and display it.
I = rgb2gray(RGB); imshow(I);
total contributions (1)
Read and display an RGB image, and then convert it to grayscale.
Read the sample file,
peppers.png
, and display the RGB image.the result
Convert the RGB image to a grayscale image and display it.
the result