How to save an image converted from RGB to greyscale?
1 次查看(过去 30 天)
显示 更早的评论
I'm new to matlab and when I convert an RGB image to a greyscale intensity map, I can't get the output to save as a greyscale...it saves an an RGB. Is this because I am using imshow and then saving the figure? If so, can someone help me figure out how to work imwrite into this code? I'm using:
i = imread('sample.png');
i = im2double(i);
a = .299*i(:,:,1) + .587*i(:,:,2) + .114*i(:,:,3);
imshow(a);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!