【Matlab】 RGB照片转化成灰度图叠加显示

2019-04-15 14:11发布

 两张图片lena.png和fiona.jpg转化为灰度图像叠加显示


遇到问题 Error using reshapeTo RESHAPE the number of elements must not change. help reshape可知 reshape(X,M,N,P,...) returns an N-D array with the same elements as X but reshaped to have the size M-by-N-by-P-by-...M*N*P*... must be the same as PROD(SIZE(X)).
修改reshape那行代码: I3 = reshape(y,size(A2));