Examples of rgb2gray function in matlab

0

Convert RGB image or colormap to grayscale

All Contributions

Read and display an RGB image, and then convert it to grayscale.

Read the sample file, peppers.png, and display the RGB image.

RGB = imread('peppers.png');
imshow(RGB);

the result 

Figure contains an axes object. The axes object contains an object of type image.

Convert the RGB image to a grayscale image and display it.

I = rgb2gray(RGB);
imshow(I);

the result

Figure contains an axes object. The axes object contains an object of type image.

total contributions (1)

This topic belongs to these lists

need a help?


find thousands of online teachers now

New to examplegeek.com?

Join us