M2_SETI/A4/TP_GPU-master/TP1_image/Matlab/raw2jpg.m
2022-12-09 09:03:22 +01:00

14 lines
No EOL
406 B
Matlab

function raw2jpg(name_proc)
%fid = fopen('ferrari.raw', 'r');
file_name_in=['../Image/ferrari_out_' name_proc '.raw'];
fid = fopen(file_name_in, 'r');
ima=single(fread(fid,1280*960*3, 'single'));
fclose(fid);
ima=reshape(ima,960,1280,3);
ima=ima./255;
figure('name',name_proc,'numbertitle','off');image(ima);
file_name_out=['../Image/ferrari_out_' name_proc '.jpg'];
imwrite(ima,file_name_out,'jpg');
end