摘要:
% 读取图象数据到矩阵[A, map] = imread('E:\\test.jpg');% 得到图象信息info = imfinfo('E:\\test.jpg');w = info.Width;h = info.Height;% 创建与图象大小相对应的网格[x,y] = meshgrid(1:w,1:h);z = x - y + y - x;i = 1;j = 1;% 用图象灰度值填充高度值while (i - 1) * w + j <= w * hz(i,j) = A(i,j);j = j + 1;if j > wj = 1;i = i + 1 阅读全文