Matlab writes image data to a binary file

I am not very good at Matlab and I need help with the following code.

I have image data from a set of images, and I want to save it in a binary file along with a file signature showing how the data was saved in the file.

For example, let's say I have an image that is divided so that it consists of 4 rows and 4 columns, so that the image consists of 16 smaller images. Image data for these smaller images is stored in the structure as follows:

data = struct('imageTitleFinal', {}, 'imageDataFinal', {});

for rows = 1:numberOfRows
        for columns = 1:numberOfColumns
            data(rows,columns).imageTitleFinal = currentTile;
            data(rows,columns).imageDataFinal = currentStructure(rows,columns).imageData;
        end
end

I want to be able to write this image data for each of the smaller images to a binary file and to be able to distinguish between image data sets in the file. Any help would be greatly appreciated.

+3
source
1

- , "" .

" ", , . :

- , 'title' char - , -The '|' .

| A uint32 | , | Uint32 | |

:

fopen in append mode
fwrite(fid, numel(title), 'uint32');
fwrite(fid, title,'char'); %assuming ASCII char set
fwrite(fid, numel(data), 'uint32');
fwrite(fid, data, 'double);

"", , , " " .

+1

All Articles