Matlab图像彩色转灰色

2016-01-05 来源: yxwkaifa 发布在  http://www.cnblogs.com/yxwkf/p/5103350.html

Matlab图像彩色转灰色

时间:2014年5月7日星期三

网上找的程序。实现图像彩色转灰色:

I1=imread('C:\Users\Yano\Desktop\matlab\test1\4.jpg');
I2=rgb2gray(I1);
figure(1)
imshow(I1);
title('源图像');
figure(2)
imshow(I2);
title('灰度图像');

自己拍的几张图片,通过此程序转换成功:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM3MzAyMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM3MzAyMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM3MzAyMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM3MzAyMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

相关文章