3D sparse matrix
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Sparse Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!