Problem on gray scale image.
1 次查看(过去 30 天)
显示 更早的评论
Hi. i used gray = rgb2gray(I) at command window but why can't i get a grayscale image? thank you!
0 个评论
回答(2 个)
Walter Roberson
2012-9-19
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 个评论
Esther
2012-9-20
6 个评论
Image Analyst
2012-9-20
编辑:Image Analyst
2012-9-20
So you DID get a gray scale image. Why did you say you did not?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!