RGB to gray pic
2 次查看(过去 30 天)
显示 更早的评论
I want to convert a RGB picture to a gray one, does anybody know how to do that?
3 个评论
Image Analyst
2020-6-18
Original question (for when it gets edited away):
I want to convert a RGB picture to a gray one, does anybody know how to do that?
采纳的回答
KALYAN ACHARJYA
2020-5-1
编辑:KALYAN ACHARJYA
2020-5-1
May be, is this to add all channels value to get the particular value
#See Whats going on, same code, just be one line see the Rik's Comments (Prefer & Recommended)
data=imread('1.jpeg');
[r,c,ch]=size(data);
for i=1:r
for j=1:c
data1(i,j)=sum(data(i,j,1:3));
end
end
imshow(data1,[]);
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!