Problem on gray scale image.
1 view (last 30 days)
Show older comments
Hi. i used gray = rgb2gray(I) at command window but why can't i get a grayscale image? thank you!
0 Comments
Answers (2)
Walter Roberson
on 19 Sep 2012
grayscaleimage = rgb2gray(I);
image(grayscaleimage);
colormap(gray);
Please note that "gray" is a MATLAB function for constructing grayscale colormaps. Writing to a variable named "gray" interferes with using the function "gray".
0 Comments
Esther
on 20 Sep 2012
6 Comments
Image Analyst
on 20 Sep 2012
Edited: Image Analyst
on 20 Sep 2012
So you DID get a gray scale image. Why did you say you did not?
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!