Convert an image to a matrix and convert to gry scale?

1 次查看(过去 30 天)
Hello to everyone.
I'm new of Matlab. Currently I'm working with version 2011.
My question is rather simple: I've a function taking as parameter "imagen"(which is name+extension of a RGB (colored) image).
I load the image: img1 = imread(imagen,jpeg)
Now I want do the following:
1) Convert the image to a matrix
2) Show the image
3) Convert the original image to gray scale
4) Show the new image
I looked at reference but I'm a bit confused.
Any suggestion is really appreciated. I just suppose it something like "plot"..but that's all what I understood.
Thank you in advance

采纳的回答

UJJWAL
UJJWAL 2012-3-2
hi,
It is so simple. Probably you should refer to the technical support documentations online.
Btw the simple answers are as follows :-
a) As you imread into img1, the image is converted into a matrix and stored into img1.
b) to show the image use imshow(img1);
c) convert to grayscale by img2 = rgb2gray(img1);
d) again show the image by imshow(img2);
Hope this helps
happy to help
Ujjwal

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by