如何将RGB图像转换成灰度图像吗
12个视图(30天)
显示旧的评论
接受的答案
图像分析
2014年2月2日
听起来像作业。你可以得到颜色通道:
%提取个人红、绿、蓝通道。
redChannel = rgbImage (:: 1);
greenChannel = rgbImage (:: 2);
blueChannel = rgbImage (:: 3);
然后做一个加权平均。
grayImage = * redChannel a1 + a2 * greenChannel + a3 * blueChannel;
查找标准的权重,或者自己选择。