OpenCores
URL https://opencores.org/ocsvn/mdct/mdct/trunk

Subversion Repositories mdct

[/] [mdct/] [tags/] [MDCT_B10/] [MATLAB/] [img2txt.m] - Blame information for rev 25

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mikel262
filename='lena512';
2
filenamet=strcat(filename,'.txt');
3
 
4
I = imread(filename,'bmp');
5
fid = fopen(filenamet,'w+');
6
[X,Y,Z] = size(I);
7
fprintf(fid, '%d\n',X);  % lines
8
fprintf(fid, '%d\n',Y);  % pixels in line
9
for x = 1:X
10
   for y = 1:Y
11
      if I(x,y) < 16
12
         fprintf(fid, '0%x', double(I(x,y)));
13
      else
14
        fprintf(fid, '%x', double(I(x,y)));
15
        end;
16
   end;
17
   fprintf(fid,'\n');
18
end;
19
fclose(fid);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.