I need help in converting a 256 colour image in an 8 colour image and the save the bits of this image in a file.This file will the be read using verilog function readmemh.
Here it is what I have so far:
-i have read the original image
% % Convert RGB to an indexed image with 8 colors
[IND,map] = rgb2ind(original_image,8);
figure('Name','Indexed image with 8 Colors')
imagesc(IND)
colormap(map)
axis image
zoom(0)
But now i do not know how to read the pixels to a file.
I would be grateful if someone could verify what i have so far and also tell me how to save these pixels.
Although no one has responded so far ,I will ask another question hoping someone will finally give an answer.
I have a matrix X that it is written in a file.I want that any value written to be written in this format:
''assign mem = value",where i is the location obtained from line*column and value is the corresponding matrix value.