I have a question. I have an image and I am wondering how to use MATLAB to generate a text file that contains the pixel values of the image?
u can proceed the steps:
x = imread('\'); % pixel values
imshow(x) % to show the image in MATLAB
now x is ur pixel values of the image.
On 1/28/07, heidar mhr wrote:
> Hello guys,
> I have a question. I have an image and I am wondering how to use MATLAB to
> generate a text file that contains the pixel values of the image?
> Open the read matrix (image) in array editor in Matlab. Then copy
and paste whole matrix into a notepad.
alternatively for automatic transfer write to a file using the fopen
and fprintf commands so something like
im = imread('myimage');
fid = fopen('mytxtfile.txt', 'w+');
fprintf(fid, '%c\t', im(i));
It's slightly more complicated than that depending on whether you
just want the values or whether you also want the structure of the
image (i.e. maintaining rows and columns).