为将彩色图片转换为灰度图像,可采用rgb2gray函数具体使用方式为:pic = rgb2gray(picture);其中picture是彩色图像,pic是转换后的灰度图像
用函数x=rgb2gray()