Convert an image to a matrix and convert to gry scale?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuesta aceptada
UJJWAL
el 2 de Mzo. de 2012
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!