3D sparse matrix
Show older comments
I have 1500 images almost each have 5000 rows and 7000 columns. so I need to load one by one. make a large matrix. The matrix size will be 5000x7000x1500. Image are Greyscale Image.
A portion of code is below. In the images variable preallocaiton will be done. To save the memory I need to do the 3D sparse matrix.
Any of your help will be appreicated. Thank you so much.
filename = sprintf(basefilename,start_idx);
full_path = fullfile(image_dir, filename);
f1 = imread(full_path);
nframes = end_idx-start_idx+1;
% preallocating the matrix
sz0 = [size(f1,1:2) nframes];
images = zeros(sz0,class(f1));
fidx = int8(start_idx:end_idx);
tic
parfor k = 1:length(fidx) % these are output frame indexes
% reading one by one frame operation.........
images(:,:,k) = tmp_img(:,:,1);
end
Accepted Answer
More Answers (0)
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!