Azzera filtri
Azzera filtri

Out of memory problem

1 visualizzazione (ultimi 30 giorni)
Pan
Pan il 12 Feb 2012
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;

Risposta accettata

Walter Roberson
Walter Roberson il 12 Feb 2012
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 ?

Più risposte (0)

Categorie

Scopri di più su Files and Folders in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by