- #1
Fert
- 6
- 0
Hi, I made an m-file which which outputs movies at the end. The movie frames are made from images of a 200 by 200 matrix. I wanted to input the movies into a second program which then analyzes each frame. The problem is the frames are structure files and I don't know how to convert the frame back to the 200 by 200 matrix. I've read through the MATLAB help files on structures but I still don't understand what is in the structure file.
The files are 1 by 600 structure files. If I take one frame out it is a 1 by 1 structure file which contains cdata which is a <343x435x3 uint8> file and an empty matrix 'colormap'. I don't understand how the cdata file represents a matrix or how to convert cdata back to the original data.
When looking at parts of the cdata file it contains zeros, ones and 255's, where my original matrix was all zeros and ones.
In case it matters how I made the movie, this is the code I used:
in a loop:
(A is the matrix)
imagesc(A,'colourmap','gray')
F(i)=getframe;
end
I know the imagesc scales the original matrix but shouldn't zero stay zero and ones get scaled to 255? If so why is there ones in cdata?
Any help would be greatly appreciated.
Thank you
The files are 1 by 600 structure files. If I take one frame out it is a 1 by 1 structure file which contains cdata which is a <343x435x3 uint8> file and an empty matrix 'colormap'. I don't understand how the cdata file represents a matrix or how to convert cdata back to the original data.
When looking at parts of the cdata file it contains zeros, ones and 255's, where my original matrix was all zeros and ones.
In case it matters how I made the movie, this is the code I used:
in a loop:
(A is the matrix)
imagesc(A,'colourmap','gray')
F(i)=getframe;
end
I know the imagesc scales the original matrix but shouldn't zero stay zero and ones get scaled to 255? If so why is there ones in cdata?
Any help would be greatly appreciated.
Thank you