Borrar filtros
Borrar filtros

Creation of coe file

12 visualizaciones (últimos 30 días)
Lalitha Sivaraman
Lalitha Sivaraman el 1 de Oct. de 2013
Editada: Walter Roberson el 1 de Oct. de 2013
There is a code for creation of coe file from image with 1 Dimension, i need a help to convert it to 2 Dimension...
% Image to text conversion
% Read the image from the file
[filename, pathname] = uigetfile('*.bmp;*.tif;*.jpg;*.pgm','Pick an M-file');
img = imread('Bird128bmf.bmp');
% Image Transpose
imgTrans = img';
% iD conversion
img1D = imgTrans(:);
% Decimal to Hex value conversion
imgHex = dec2hex(img1D);
% New txt file creation
fid = fopen('inputHexp.coe', 'wt');
% Hex value write to the txt file
fprintf(fid,'memory_initialization_radix=16;\n');
fprintf(fid,'memory_initialization_vector=\n');
fprintf(fid, '%x\n', img1D);
% Close the txt file
fclose(fid)

Respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by