标签:matlab
matlab读取图像并转化为灰度图像
image = imread('C:\Users\Administrator\Desktop\图像降噪\src\original image\100.png'); image = rgb2gray(image);
image = imread('C:\Users\Administrator\Desktop\图像降噪\src\original image\1.bmp'); image = rgb2gray(image); % figure ,imshow(image); % dlmwrite('filename.txt', image, ',', 0, 0) % image = image'; figure ,imshow(image); fid = fopen('exp.txt','w'); fprintf(fid,'%d,',image); fclose(fid); fid = fopen('exp.txt', 'r');
A =load('exp.txt');%读取exp.txt数据 image2 = zeros(256,256,'uint8'); for i = 1 : 256 for j = 1 : 256 image2(j,i) = A((i-1)*256+j); end end figure,imshow(image2); % B=dlmread('exp.txt',',')
% image = double(image);
标签:matlab
原文地址:http://blog.csdn.net/xiabodan/article/details/31807033