fanwel
Full Member level 3
Hi all;
How to write a program to output a specified image to a stream of integers in Matlab? The file later will be used as an input file in vhdl. I have found 1 example but I don't understand much. Can anyone help me..Below is the Matlab code that I make as my reference:
function m2vhdl(input_bmp,output_bin);
% detail: a program to output a specified image to a stream of
% integers for VHDL file input
% parameters: input_bmp - file to convert to bin format
% output_bin - file ready for vhdl file input
I = LoadImage(input_bmp);
J = int16(I);
K = double(J);
K = K';
M = reshape(K,128*128,1);
fid = fopen(output_bin,'wb');
fprintf(fid,'%d\n',M);
fclose(fid);
Need helps..thank you
How to write a program to output a specified image to a stream of integers in Matlab? The file later will be used as an input file in vhdl. I have found 1 example but I don't understand much. Can anyone help me..Below is the Matlab code that I make as my reference:
function m2vhdl(input_bmp,output_bin);
% detail: a program to output a specified image to a stream of
% integers for VHDL file input
% parameters: input_bmp - file to convert to bin format
% output_bin - file ready for vhdl file input
I = LoadImage(input_bmp);
J = int16(I);
K = double(J);
K = K';
M = reshape(K,128*128,1);
fid = fopen(output_bin,'wb');
fprintf(fid,'%d\n',M);
fclose(fid);
Need helps..thank you