Convert an image to a matrix and convert to gry scale?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
UJJWAL
le 2 Mar 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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!