how do i convert rgb image to grayscale and then back to rgb?
2 次查看(过去 30 天)
显示 更早的评论
please help me out if there is any method to do this
0 个评论
回答(2 个)
Image Analyst
2017-3-30
Try
grayImage = rgb2gray(rgbImage); % Convert to gray scale.
rgbImage = ind2rgb(grayImage, colorMap); % Will not be the same original RGB image though.
0 个评论
TEJASWINI CHINAWALE
2017-9-21
You can try using jet(m) command which returns the colormap with m colors. You can change the value of m depending on how the converted image should look like.However it is not possible to obtain the original coloured image once you convert it to grayscale or any other form.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!