필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Manuel
Manuel 2012년 3월 2일
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
  댓글 수: 1
Manuel
Manuel 2012년 3월 2일
I will try it later but it's very clear. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (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