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

Subversion Repositories mdct

[/] [mdct/] [trunk/] [MATLAB/] [txt2img.m] - Rev 27

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

clear
fid = fopen('imageo.txt','r+');
 
line = fgetl(fid);
uns16 = sscanf(line, '%d');
y_size = double(uns16);
line = fgetl(fid);
uns16 = sscanf(line, '%d');
x_size = double(uns16);
 
for y = 1 : y_size , 
   for x = 1 : x_size , 
     signed = fscanf(fid, '%2x',1);
       E(y,x) = uint8(signed); 
   end
end
 
imwrite(E, 'imageo.jpg','jpg','Quality',100);
fclose(fid);
 
%%%%%%%%%%%%%%%
clear
fid = fopen('imagee.txt','r+');
 
line = fgetl(fid);
uns16 = sscanf(line, '%d');
y_size = double(uns16);
line = fgetl(fid);
uns16 = sscanf(line, '%d');
x_size = double(uns16);
 
for y = 1 : y_size , 
   for x = 1 : x_size , 
     signed = fscanf(fid, '%2x',1);
       E(y,x) = uint8(signed); 
   end
end
 
imwrite(E, 'imagee.jpg','jpg');
fclose(fid);

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

powered by: WebSVN 2.1.0

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