Out of memory problem

1 次查看(过去 30 天)
Pan
Pan 2012-2-12
clear all
mov = aviread('book.avi');
xy=zeros(size(mov(1).cdata));
for i=1:196
figure(10)
xy(:,:,:,i)=mov(i).cdata;
imshow(uint8(xy(:,:,:,i)));
end
save book xy
when I read the file code,matlab will show this message
??? Out of memory. Type HELP MEMORY for your options.
Error in ==> framebook at 9
xy(:,:,:,i)=mov(i).cdata;

采纳的回答

Walter Roberson
Walter Roberson 2012-2-12
You can try using
xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');
and change your imshow line to
imshow(xy(:,:,:,i));
Do not be surprised if this runs out of memory. Not matter how much memory you have, there will always be a movie large enough that you cannot make two fully-decompressed copies of it in memory.
What is it that you are going to do with your xy array? Is it certain that you cannot do the processing on the mov structure instead ?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by