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

Subversion Repositories mdct

[/] [mdct/] [trunk/] [MATLAB/] [txt2img.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
clear
2
fid = fopen('imageo.txt','r+');
3
 
4
line = fgetl(fid);
5
uns16 = sscanf(line, '%d');
6
y_size = double(uns16);
7
line = fgetl(fid);
8
uns16 = sscanf(line, '%d');
9
x_size = double(uns16);
10
 
11
for y = 1 : y_size ,
12
   for x = 1 : x_size ,
13
     signed = fscanf(fid, '%2x',1);
14
       E(y,x) = uint8(signed);
15
   end
16
end
17
 
18
imwrite(E, 'imageo.jpg','jpg','Quality',100);
19
fclose(fid);
20
 
21
%%%%%%%%%%%%%%%
22
clear
23
fid = fopen('imagee.txt','r+');
24
 
25
line = fgetl(fid);
26
uns16 = sscanf(line, '%d');
27
y_size = double(uns16);
28
line = fgetl(fid);
29
uns16 = sscanf(line, '%d');
30
x_size = double(uns16);
31
 
32
for y = 1 : y_size ,
33
   for x = 1 : x_size ,
34
     signed = fscanf(fid, '%2x',1);
35
       E(y,x) = uint8(signed);
36
   end
37
end
38
 
39
imwrite(E, 'imagee.jpg','jpg');
40
fclose(fid);

powered by: WebSVN 2.1.0

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